/* Modern font stack optimized for readability */
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Loading screen */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease-out;
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-icon {
  width: 75vmin;
  height: 75vmin;
  color: #fff;
  filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.3))
          drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5))
          drop-shadow(0 -4px 8px rgba(255, 255, 255, 0.1));
  animation: subtleFloat 4s ease-in-out infinite;
}

@keyframes subtleFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.3))
            drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5))
            drop-shadow(0 -4px 8px rgba(255, 255, 255, 0.1));
  }
  50% {
    transform: translateY(-10px) scale(1.02);
    filter: drop-shadow(0 0 50px rgba(255, 255, 255, 0.4))
            drop-shadow(0 12px 20px rgba(0, 0, 0, 0.6))
            drop-shadow(0 -6px 12px rgba(255, 255, 255, 0.15));
  }
}

#image-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  z-index: 0;
}

.slide-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  will-change: opacity;
  z-index: 1;
}

.slide-image.active {
  opacity: 1;
  z-index: 2;
}

/* Keyframe animations */
@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes subtlePulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.5;
  }
}

/* Attribution overlay - modern and subtle */
#attribution {
  position: fixed;
  bottom: 40px;
  left: 40px;
  right: 40px;
  max-width: 800px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.25));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 24px 32px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: slideInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#attribution.hidden {
  animation: slideOutDown 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53);
  animation-fill-mode: forwards;
  pointer-events: none;
}

#attribution-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Attribution photographer name - larger */
.attribution-photographer {
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.attribution-photographer a {
  color: #ffffff;
  text-decoration: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  padding-bottom: 2px;
}

.attribution-photographer a:hover {
  border-bottom-color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Provider attribution - smaller and subtle */
.provider-attribution {
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0;
}

.provider-attribution a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.3s ease;
  padding-bottom: 1px;
}

.provider-attribution a:hover {
  color: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

/* Attribution details - smaller, subtle */
.attribution-details {
  font-size: 1.3rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.attribution-location {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
}

/* Offline indicator - very subtle */
#offline-indicator {
  position: fixed;
  top: 40px;
  right: 40px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.9);
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: capitalize;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.5s ease-out, subtlePulse 3s ease-in-out infinite;
}

#offline-indicator.hidden {
  animation: fadeOut 0.5s ease-out;
  animation-fill-mode: forwards;
  pointer-events: none;
  visibility: hidden;
}

/* Search dialog - modern, centered */
#search-dialog {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.35));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 32px 40px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
  min-width: 400px;
  max-width: 600px;
  z-index: 10000;
  animation: slideInDown 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#search-dialog.hidden {
  animation: slideOutUp 0.3s cubic-bezier(0.55, 0.085, 0.68, 0.53);
  animation-fill-mode: forwards;
  pointer-events: none;
  visibility: hidden;
}

@keyframes slideInDown {
  from {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutUp {
  from {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  to {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
  }
}

#search-dialog-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#search-label {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.02em;
}

#search-input {
  font-size: 2rem;
  font-weight: 500;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #ffffff;
  outline: none;
  transition: all 0.3s ease;
  font-family: inherit;
}

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

#search-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

/* Warning message - top-center */
#warning-message {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(255, 69, 69, 0.8), rgba(255, 69, 69, 0.6));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 20px 32px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(255, 69, 69, 0.3);
  z-index: 10000;
  animation: slideInDown 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}

#warning-message.hidden {
  animation: slideOutUp 0.3s cubic-bezier(0.55, 0.085, 0.68, 0.53);
  animation-fill-mode: forwards;
  pointer-events: none;
  visibility: hidden;
}

#warning-message-content {
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.02em;
}

/* Mobile: Scale down all UI elements for touch devices */
@media (hover: none) and (pointer: coarse) {
  /* Attribution overlay - reduce by 50% */
  #attribution {
    bottom: 20px;
    left: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 12px;
  }

  .attribution-photographer {
    font-size: 1.1rem;
  }
  
  .provider-attribution {
    font-size: 0.55rem;
  }
  
  .attribution-details {
    font-size: 0.65rem;
  }

  /* Search dialog - more compact */
  #search-dialog {
    top: 40px;
    padding: 20px 24px;
    border-radius: 16px;
    min-width: auto;
    max-width: 90vw;
    left: 50%;
  }

  #search-label {
    font-size: 0.75rem;
  }

  #search-input {
    font-size: 1.2rem;
    padding: 12px 16px;
    border-radius: 10px;
  }

  /* Warning message - more compact */
  #warning-message {
    top: 20px;
    padding: 12px 20px;
    border-radius: 10px;
  }

  #warning-message-content {
    font-size: 0.9rem;
  }

  /* Offline indicator - more compact */
  #offline-indicator {
    top: 20px;
    right: 20px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
  }
}

