:root {
  /* Seoul 2027 Color Palette */
  --bg-ivory: #ffffff;
  --text-blue: #1a1e29;
  --accent-gold: #e62b3a; /* Seoul Red */
  --accent-blue: #1b43aa; /* Seoul Blue */
  --accent-yellow: #fce16d; /* Seoul Yellow */
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg-ivory);
  color: var(--text-blue);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  line-height: 1.2;
}

/* Fullscreen Map Background */
#map-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

#map {
  width: 100%;
  height: 100%;
  background-color: var(--bg-ivory);
}

/* Custom Marker */
.custom-map-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.leaflet-marker-pane {
  transition: opacity 0.8s ease;
}
#map.hide-markers .leaflet-marker-pane {
  opacity: 0 !important;
  pointer-events: none;
}

.marker-dot {
  width: 18px;
  height: 18px;
  background: radial-gradient(circle at 35% 35%, #eb4e5a, var(--accent-gold));
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50% !important;
  box-shadow: 
    0 4px 8px rgba(0,0,0,0.3),
    inset -2px -2px 4px rgba(0,0,0,0.25),
    inset 2px 2px 3px rgba(255,255,255,0.2) !important;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.6s ease;
}

.custom-map-marker.active-pin {
  opacity: 1;
}

.custom-map-marker.active-pin .marker-dot {
  transform: scale(1.6);
  background: radial-gradient(circle at 35% 35%, #2a5ddb, var(--accent-blue));
  box-shadow: 
    0 6px 15px rgba(27, 67, 170, 0.5),
    inset -2px -2px 5px rgba(0,0,0,0.3),
    inset 2px 2px 3px rgba(255,255,255,0.25) !important;
  z-index: 1000;
}

.city-label {
  display: none !important;
  position: absolute;
  left: 20px;
  background: transparent;
  color: #888888;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff, 0 0 10px rgba(255,255,255,0.9);
  white-space: nowrap;
  pointer-events: none;
  transition: color 0.6s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.city-label.label-left {
  left: auto;
  right: 20px;
}

.custom-map-marker.active-pin .city-label {
  color: var(--accent-blue);
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff, 0 0 15px rgba(255,255,255,1);
}

/* Right Side Navigation List */
#place-nav {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  background-color: var(--bg-ivory);
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 1.2rem; /* Wider padding */
  box-shadow: -2px 0 10px rgba(0,0,0,0.05);
  border-left: 1px solid rgba(26, 30, 41, 0.05);
}

#place-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: right;
  padding-right: 0.2rem;
}

#place-list a {
  text-decoration: none;
  color: var(--text-blue);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.4;
  transition: opacity 0.3s ease, color 0.3s ease, transform 0.3s ease;
  display: block;
}

#place-list a:hover,
#place-list a.active {
  opacity: 1;
  color: var(--accent-blue);
  transform: translateX(-2px);
}

/* Intro Screen */
#intro-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.intro-content {
  text-align: center;
  pointer-events: auto;
  text-shadow: 0 0 30px rgba(255,255,255,1), 0 0 15px rgba(255,255,255,0.9);
  width: 100%;
  max-width: 75vw;
  margin: 0 auto;
}
.intro-kicker {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  color: var(--accent-gold);
  font-style: italic;
  margin-bottom: -10px;
}
.intro-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 8vw; /* Scales with screen width */
  font-weight: 700;
  color: var(--text-blue);
  line-height: 1.1;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -2px;
}
.intro-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  font-style: italic;
  color: var(--accent-blue);
  margin-top: -10px;
}
.intro-description {
  margin-top: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-blue);
  font-weight: 500;
}

/* Narrative Timeline Container Overlay */
#timeline-container {
  position: relative;
  z-index: 5;
  width: 35vw;
  margin-left: 8vw;
  margin-right: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

#dynamic-timeline {
  display: flex;
  flex-direction: column;
  gap: 80vh;
}

.timeline-footer-spacer {
  height: 30vh;
}

/* Timeline Cards (Just Text) */
.timeline-card {
  pointer-events: auto;
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0.1;
  transform: translateY(40px);
  text-shadow: 0 0 25px rgba(255, 255, 255, 1), 0 0 10px rgba(255, 255, 255, 0.9);
}

.timeline-card.active {
  opacity: 1;
  transform: translateY(0);
}

.card-meta {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  color: var(--accent-blue);
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

.card-logo {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
}

.card-logo img {
  max-height: 100px;
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
  border-radius: 4px;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.timeline-card.active .card-logo img {
  transform: scale(1.05);
  filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.25));
}

.timeline-card h2 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--text-blue);
}

/* Seoul 2027 specific title gradient */
.seoul-title {
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.card-details {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--accent-blue);
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  border-left: 4px solid var(--accent-gold); /* Changed to red */
  padding-left: 1rem;
}

.card-details p:first-child {
  color: var(--accent-gold); /* Date in red */
  font-weight: 700;
}

.card-description {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-style: italic;
  color: var(--text-blue);
  line-height: 1.4;
}

/* Symbols Card */
.symbols-card {
  margin-top: 80vh; 
}
.symbols-card p {
  margin-bottom: 1rem;
}

/* Final Card */
.final-card {
  margin-top: 60vh;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
}
.jesus-title {
  font-size: 4rem !important;
  color: var(--text-blue) !important;
  font-style: italic;
}

/* Custom Language Selector */
.custom-lang-selector {
  position: fixed;
  top: 30px;
  left: 30px;
  z-index: 1000;
  font-family: var(--font-body);
  user-select: none;
}
.lang-current {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-blue);
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  border: 1px solid rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lang-current:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.lang-current svg {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.custom-lang-selector.open .lang-current svg {
  transform: rotate(180deg);
}
.lang-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.8);
  list-style: none;
  padding: 8px;
  margin: 0;
  min-width: 180px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transform-origin: top left;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.custom-lang-selector.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.lang-dropdown li {
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-light);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lang-dropdown li:hover {
  background: rgba(0,0,0,0.04);
  color: var(--text-blue);
}
.lang-dropdown li.active {
  background: var(--accent-blue);
  color: #fff;
}
.jesus-painting {
  max-width: 100%;
  height: auto;
  max-height: 550px;
  border-radius: 12px !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3) !important;
}

/* Credits Card */
.credits-card {
  margin-top: 60vh;
}
.credits-card h2 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  #timeline-container {
    width: 90vw;
    margin-left: 5vw;
    margin-right: 5vw;
  }
  
  #place-nav {
    display: none;
  }

  .intro-title {
    font-size: 3.5rem;
  }
  .timeline-card h2 {
    font-size: 2.5rem;
  }
}

/* Move Leaflet attribution left to avoid overlapping with right navbar on desktop */
@media (min-width: 1025px) {
  .leaflet-bottom.leaflet-right {
    margin-right: 110px;
  }
}
