/* ============================================
   World Wonders - Interactive Photo Gallery
   ============================================ */

:root {
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-blur: 18px;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.75);
  --text-muted: rgba(255, 255, 255, 0.5);
  --accent: #ffe600;
  --accent-glow: rgba(255, 230, 0, 0.4);
  --radius: 18px;
  --transition-slow: 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  --transition-med: 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
  background: #0a0a12;
  color: var(--text-primary);
}

.app-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ---- Animated Background Gradient ---- */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e, #0f0c29);
  background-size: 400% 400%;
  animation: gradientShift 18s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---- Floating Particles ---- */
.particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateY(90vh) scale(1);
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) scale(0.5);
    opacity: 0;
  }
}

/* ---- Hero Stage ---- */
.hero-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.15);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  pointer-events: none;
  overflow: hidden;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  animation: kenBurns 20s ease-out forwards;
}

@keyframes kenBurns {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.18) translate(-2%, -2%); }
}

.hero-slide .hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero-slide .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 20, 0.25) 0%,
    rgba(10, 10, 20, 0.15) 40%,
    rgba(10, 10, 20, 0.75) 100%
  );
}

/* ---- Glassmorphism ---- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ---- Navigation Bar ---- */
.nav-bar {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px 24px;
  max-width: 95vw;
  animation: slideDown 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -40px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  white-space: nowrap;
}

.brand-icon {
  font-size: 1.5rem;
  animation: spinGlobe 8s linear infinite;
}

@keyframes spinGlobe {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.country-nav {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.country-nav::-webkit-scrollbar {
  display: none;
}

.country-pill {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-med);
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

.country-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.country-pill.active {
  color: #1a1a2e;
  background: var(--accent);
  box-shadow: 0 4px 20px var(--accent-glow);
  font-weight: 600;
}

.country-pill .flag {
  font-size: 1rem;
}

.nav-controls {
  display: flex;
  gap: 8px;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.ctrl-btn:hover {
  background: rgba(255, 230, 0, 0.2);
  border-color: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 0 20px var(--accent-glow);
}

.ctrl-btn:active {
  transform: scale(0.95);
}

/* ---- Info Panel ---- */
.info-panel {
  position: fixed;
  left: 32px;
  bottom: 110px;
  z-index: 40;
  width: 420px;
  max-width: calc(100vw - 64px);
  padding: 28px;
  animation: panelSlideIn var(--transition-slow) 0.6s both;
}

.info-panel.switching {
  animation: panelSwitchOut 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes panelSlideIn {
  from {
    opacity: 0;
    transform: translateX(-60px) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes panelSwitchOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-40px);
  }
}

.info-flag {
  font-size: 3rem;
  margin-bottom: 12px;
  display: inline-block;
  animation: flagPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes flagPop {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.info-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.15;
  animation: textRevealUp 0.6s ease 0.1s both;
}

.info-content .country-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
  animation: textRevealUp 0.6s ease 0.2s both;
}

.info-content .landmark-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
  animation: textRevealUp 0.6s ease 0.3s both;
}

@keyframes textRevealUp {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.info-stats {
  display: flex;
  gap: 16px;
  animation: textRevealUp 0.6s ease 0.4s both;
}

.stat-item {
  flex: 1;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-value .accent {
  color: var(--accent);
}

/* ---- Thumbnail Strip ---- */
.thumb-strip {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  animation: slideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 40px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.thumb {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  transition: opacity 0.3s ease;
}

.thumb:hover {
  transform: translateY(-6px) scale(1.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.thumb:hover::after {
  opacity: 0.1;
}

.thumb.active {
  border-color: var(--accent);
  transform: translateY(-4px) scale(1.12);
  box-shadow: 0 8px 25px var(--accent-glow);
}

.thumb.active::after {
  opacity: 0;
}

/* ---- Progress Bar ---- */
.progress-track {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 60;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #ff8a00);
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.1s linear;
}

/* ---- Slide Counter ---- */
.slide-counter {
  position: fixed;
  top: 32px;
  right: 32px;
  z-index: 50;
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: 'Playfair Display', serif;
  color: var(--text-primary);
  animation: fadeIn 1s ease 0.8s both;
}

#currentSlide {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.counter-divider {
  font-size: 1.5rem;
  color: var(--text-muted);
}

#totalSlides {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

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

/* ---- Scroll Hint ---- */
.scroll-hint {
  position: fixed;
  right: 32px;
  bottom: 120px;
  z-index: 40;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
  animation: fadeIn 1s ease 1.2s both, pulseHint 3s ease infinite 2s;
}

.hint-arrow {
  font-size: 1.5rem;
  margin-top: 8px;
  animation: bounceDown 2s ease infinite;
}

@keyframes pulseHint {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .nav-bar {
    flex-direction: column;
    gap: 14px;
    padding: 14px 18px;
    top: 16px;
    max-width: 92vw;
  }

  .country-nav {
    max-width: 80vw;
  }

  .info-panel {
    left: 16px;
    right: 16px;
    width: auto;
    bottom: 120px;
    padding: 20px;
  }

  .info-content h2 {
    font-size: 1.5rem;
  }

  .slide-counter {
    top: 16px;
    right: 16px;
  }

  #currentSlide {
    font-size: 2rem;
  }

  .scroll-hint {
    display: none;
  }

  .thumb {
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 600px) {
  .nav-brand .brand-text {
    display: none;
  }

  .thumb-strip {
    gap: 8px;
    padding: 8px 10px;
    max-width: 95vw;
    overflow-x: auto;
  }

  .thumb {
    width: 44px;
    height: 44px;
  }
}
