/* Chronos: The Human Odyssey - Core Stylesheet (Awwwards White, Blue & Orange Theme) */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;800;900&family=Inter:wght@300;400;500;600;700&family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=Montserrat:wght@400;500;600;700;800&family=Orbitron:wght@500;700;900&display=swap');

:root {
  --text-body-font: 'Inter', sans-serif;
  --text-heading-font: 'Lora', serif;
  --transition-speed: 0.6s; /* Snappier, modern page transitions */
  
  /* Unified Premium Dark Slate & Champagne Gold Defaults */
  --bg-gradient: linear-gradient(135deg, #05070a 0%, #0a0f1d 100%);
  --card-bg: rgba(10, 14, 22, 0.75);
  --accent-color: #c5a880; /* Champagne Gold */
  --accent-rgb: 197, 168, 128;
  --text-color: #cbd5e1; /* Off-white slate */
  --text-muted: rgba(203, 213, 225, 0.65);
  --border-color: rgba(197, 168, 128, 0.15);
  --glow-color: rgba(197, 168, 128, 0.12);
  --highlight-color: #c5a880;
  --highlight-rgb: 197, 168, 128;
}

/* =========================================================================
   Awwwards Interactive Light Themes
   ========================================================================= */

body.theme-prehistoric {
  --bg-gradient: linear-gradient(135deg, #05070a 0%, #0d1117 100%);
  --card-bg: rgba(10, 14, 22, 0.72);
  --accent-color: #c5a880; /* Champagne Gold */
  --accent-rgb: 197, 168, 128;
  --text-color: #cbd5e1; /* Off-white slate */
  --text-muted: rgba(203, 213, 225, 0.65);
  --border-color: rgba(197, 168, 128, 0.15);
  --glow-color: rgba(230, 81, 0, 0.12);
  --highlight-color: #ea580c; /* Warm Copper Orange */
  --highlight-rgb: 234, 88, 12;
}

body.theme-ancient {
  --bg-gradient: linear-gradient(135deg, #04060d 0%, #0a0f1d 100%);
  --card-bg: rgba(8, 12, 20, 0.75);
  --accent-color: #c5a880;
  --accent-rgb: 197, 168, 128;
  --text-color: #cbd5e1;
  --text-muted: rgba(203, 213, 225, 0.65);
  --border-color: rgba(197, 168, 128, 0.15);
  --glow-color: rgba(249, 115, 22, 0.12);
  --highlight-color: #f97316; /* Terracotta Orange */
  --highlight-rgb: 249, 115, 22;
}

body.theme-medieval {
  --bg-gradient: linear-gradient(135deg, #070604 0%, #120f0a 100%);
  --card-bg: rgba(12, 10, 8, 0.75);
  --accent-color: #c5a880;
  --accent-rgb: 197, 168, 128;
  --text-color: #cbd5e1;
  --text-muted: rgba(203, 213, 225, 0.65);
  --border-color: rgba(197, 168, 128, 0.15);
  --glow-color: rgba(234, 88, 12, 0.12);
  --highlight-color: #d97706; /* Amber Gold */
  --highlight-rgb: 217, 119, 6;
}

body.theme-modern {
  --bg-gradient: linear-gradient(135deg, #080c14 0%, #0e1422 100%);
  --card-bg: rgba(9, 13, 22, 0.75);
  --accent-color: #c5a880;
  --accent-rgb: 197, 168, 128;
  --text-color: #cbd5e1;
  --text-muted: rgba(203, 213, 225, 0.65);
  --border-color: rgba(197, 168, 128, 0.15);
  --glow-color: rgba(255, 107, 0, 0.12);
  --highlight-color: #ea580c; /* Warm Orange */
  --highlight-rgb: 234, 88, 12;
}

body.theme-future {
  --bg-gradient: linear-gradient(135deg, #010414 0%, #060b20 100%);
  --card-bg: rgba(6, 10, 26, 0.75);
  --accent-color: #c5a880;
  --accent-rgb: 197, 168, 128;
  --text-color: #cbd5e1;
  --text-muted: rgba(203, 213, 225, 0.65);
  --border-color: rgba(197, 168, 128, 0.15);
  --glow-color: rgba(0, 230, 240, 0.15);
  --highlight-color: #06b6d4; /* Cyan */
  --highlight-rgb: 6, 182, 212;
}

/* =========================================================================
   RESET AND CORE LAYOUT
   ========================================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--text-body-font);
  background: var(--bg-gradient);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background var(--transition-speed) ease, color 0.5s ease;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}
::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.5);
}

.glass-panel {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.06);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease, box-shadow 0.5s ease;
}

/* =========================================================================
   HEADER SECTION
   ========================================================================= */
header {
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand h1 {
  font-family: var(--text-heading-font);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--accent-color);
  transition: font-family var(--transition-speed) ease, color var(--transition-speed) ease;
  text-transform: uppercase;
}

.brand p {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* Audio Widget */
.audio-controller {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-color);
}

.audio-btn {
  background: rgba(var(--accent-rgb), 0.05);
  border: 1px solid var(--accent-color);
  color: var(--text-color);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--text-body-font);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.3s ease;
}

.audio-btn:hover {
  background: rgba(var(--accent-rgb), 0.12);
  box-shadow: 0 0 8px var(--glow-color);
}

.audio-btn.playing {
  animation: pulse-border 2s infinite;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume-slider {
  -webkit-appearance: none;
  width: 70px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.15);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
}

.audio-pulse {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 15px;
}
.audio-pulse span {
  width: 2px;
  background-color: var(--accent-color);
  border-radius: 1px;
  height: 3px;
  transition: height 0.3s ease;
}

.audio-btn.playing + .volume-container .audio-pulse span:nth-child(1) { animation: wave-anim 0.8s ease-in-out infinite alternate; }
.audio-btn.playing + .volume-container .audio-pulse span:nth-child(2) { animation: wave-anim 1.2s ease-in-out infinite alternate; }
.audio-btn.playing + .volume-container .audio-pulse span:nth-child(3) { animation: wave-anim 0.6s ease-in-out infinite alternate; }
.audio-btn.playing + .volume-container .audio-pulse span:nth-child(4) { animation: wave-anim 1.0s ease-in-out infinite alternate; }

/* =========================================================================
   MAIN APP CONTENT LAYOUT
   ========================================================================= */
.app-container {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  padding: 0 2rem 2rem 2rem;
  gap: 1.25rem;
  overflow: hidden;
  height: calc(100vh - 170px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 0.75rem;
  overflow-y: auto;
}

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  padding-left: 0.5rem;
}

.category-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.category-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--text-body-font);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.3s ease;
}

.category-btn:hover {
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--text-color);
  padding-left: 1.1rem;
}

.category-btn.active {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-color);
  border-left: 3px solid var(--accent-color);
  font-weight: 600;
}

.viewport {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  overflow: hidden;
}

/* Left Pane: Article browser & reader */
.article-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-bar-container {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  color: var(--text-color);
  font-family: var(--text-body-font);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 6px var(--glow-color);
}

.search-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* =========================================================================
   Awwwards-style Hero Banner & Header
   ========================================================================= */
.hero-banner {
  position: relative;
  min-height: 280px;
  border-radius: 12px;
  margin: 1.25rem 1.25rem 0 1.25rem;
  background-image: url('../images/hero.png');
  background-size: cover;
  background-position: center;
  overflow: hidden;
  display: flex;
  align-items: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
  animation: fade-in-hero 0.8s cubic-bezier(0.25, 1, 0.5, 1) both;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(11, 30, 54, 0.95) 0%, rgba(11, 30, 54, 0.75) 45%, rgba(11, 30, 54, 0.1) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 2.5rem;
  color: #ffffff;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--highlight-color);
  font-weight: 700;
}

.hero-title {
  font-family: var(--text-heading-font);
  font-size: 2.4rem;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.hero-subtitle {
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 400;
}

.hero-stats {
  display: flex;
  gap: 2.2rem;
  margin-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1.1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--highlight-color);
}

.stat-lbl {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}

@keyframes fade-in-hero {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.article-card {
  padding: 0 !important;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.4s ease, box-shadow 0.4s ease !important;
}

.article-card:hover {
  transform: translateY(-5px);
  border-color: var(--highlight-color) !important;
  box-shadow: 0 12px 28px rgba(var(--accent-rgb), 0.08);
}

.card-image-header {
  width: 100%;
  height: 150px;
  background-color: var(--border-color);
  background-image: linear-gradient(135deg, rgba(var(--accent-rgb), 0.03) 0%, rgba(var(--accent-rgb), 0.12) 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border-color);
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.article-card:hover .card-image-header {
  transform: scale(1.06);
}

.card-content-wrapper {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.article-tag {
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--accent-color);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.article-card h3 {
  font-family: var(--text-heading-font);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--accent-color);
  transition: color 0.3s ease;
}

.article-card:hover h3 {
  color: var(--highlight-color);
}

.article-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 0.6rem;
}

/* Immersive Article Reader View */
.article-reader {
  display: none;
  flex-direction: column;
  padding: 1.5rem 2.5rem;
  overflow-y: auto;
  flex: 1;
}

.reader-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.reader-hero-image {
  width: 100%;
  height: 320px;
  background-color: var(--border-color);
  background-image: linear-gradient(135deg, rgba(var(--accent-rgb), 0.03) 0%, rgba(var(--accent-rgb), 0.12) 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 12px;
  margin-bottom: 1.75rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.05);
}

.back-to-grid {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--accent-color);
  cursor: pointer;
  font-family: var(--text-body-font);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.back-to-grid:hover {
  background: rgba(var(--accent-rgb), 0.08);
}

.reader-title {
  font-family: var(--text-heading-font);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
}

.reader-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.reader-body {
  font-size: 0.98rem;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 760px;
}

.reader-body p strong:first-child {
  color: var(--accent-color);
}

.reader-body h3 {
  font-family: var(--text-heading-font);
  font-size: 1.25rem;
  margin-top: 1.25rem;
  color: var(--accent-color);
}

.reader-body ul, .reader-body ol {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.reader-body li::marker {
  color: var(--accent-color);
}

.fact-box {
  background: rgba(var(--accent-rgb), 0.05);
  border-left: 4px solid var(--accent-color);
  padding: 1.1rem;
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
}

.fact-box h4 {
  font-family: var(--text-heading-font);
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--accent-color);
}

.fact-box p {
  font-size: 0.88rem;
  color: var(--text-color);
  line-height: 1.5;
}

/* Right Pane: Era Dashboard */
.era-pane {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.era-pane-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.era-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 0.2rem;
}

.era-name {
  font-family: var(--text-heading-font);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.1rem;
}

.era-span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.era-summary {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-color);
}


/* =========================================================================================================
   GEOGRAPHIC MAP (LEAFLET.JS IMPLEMENTATION)
   ========================================================================= */
.historical-map-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.map-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}

.historical-map {
  width: 100%;
  height: 160px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f4f3eb;
  z-index: 10;
}

/* Leaflet control tweaks to fit clean theme */
.leaflet-bar {
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06) !important;
  border-radius: 4px !important;
  overflow: hidden;
}
.leaflet-bar a {
  background-color: rgba(255, 255, 255, 0.9) !important;
  color: var(--text-color) !important;
  border-bottom: 1px solid var(--border-color) !important;
  font-size: 0.8rem !important;
  width: 22px !important;
  height: 22px !important;
  line-height: 22px !important;
}
.leaflet-bar a:hover {
  background-color: #ffffff !important;
  color: var(--accent-color) !important;
}

/* Map tooltip overlay text */
.map-tooltip {
  font-size: 0.7rem;
  text-align: center;
  color: var(--text-muted);
  min-height: 1rem;
  margin-top: 0.15rem;
  font-style: italic;
}

/* =========================================================================
   HISTORICAL TIME ENGINE CONTROL WIDGET
   ========================================================================= */
.time-engine-panel {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.time-engine-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.engine-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.engine-year-readout {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-color);
  transition: color var(--transition-speed) ease;
}

.time-engine-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.engine-play-btn {
  background: var(--accent-color);
  border: none;
  color: #ffffff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.3s;
}

.engine-play-btn:hover {
  transform: scale(1.1);
}

.engine-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.1);
  outline: none;
  cursor: pointer;
}

.engine-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-color);
  transition: background var(--transition-speed) ease;
}

/* City inspect card layout */
.city-detail-card {
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--accent-color);
  border-radius: 8px;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  animation: slide-in-card 0.3s ease-out;
}

.city-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.city-detail-header h4 {
  font-family: var(--text-heading-font);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-color);
}

.city-detail-header span {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-color);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.city-detail-card p {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-color);
}

.city-search-btn {
  align-self: flex-end;
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  font-family: var(--text-body-font);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.city-search-btn:hover {
  background: var(--accent-color);
  color: #ffffff;
}

/* =========================================================================
   HISTORY LAB INTERACTIVE TOOL VIEW
   ========================================================================= */
.history-lab-view {
  flex-direction: column;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  flex: 1;
}

.lab-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.8rem;
  margin-bottom: 1.25rem;
}

.lab-header h2 {
  font-family: var(--text-heading-font);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-color);
}

.lab-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 800px) {
  .lab-grid {
    grid-template-columns: 1fr;
  }
}

.lab-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lab-card h3 {
  font-family: var(--text-heading-font);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-color);
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.4rem;
}

.simulator-selects, .currency-inputs {
  display: flex;
  gap: 1rem;
}

.select-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.select-col label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lab-select, .lab-input {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: 6px;
  color: var(--text-color);
  font-family: var(--text-body-font);
  font-size: 0.85rem;
  outline: none;
}

.lab-select:focus, .lab-input:focus {
  border-color: var(--accent-color);
}

.simulate-btn {
  background: var(--accent-color);
  border: none;
  color: #ffffff;
  padding: 0.6rem;
  border-radius: 6px;
  font-family: var(--text-body-font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.simulate-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Matchup Simulator Visual Bars */
.matchup-results {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: slide-in-card 0.4s ease-out;
}

.stat-bar-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-label-row strong {
  color: var(--text-color);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-progress-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 5px;
  overflow: hidden;
  gap: 2px;
}

.stat-progress-left {
  background: var(--accent-color);
  height: 100%;
  width: 0%;
  justify-self: end;
  border-radius: 5px 0 0 5px;
  transition: width 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.stat-progress-right {
  background: var(--highlight-color);
  height: 100%;
  width: 0%;
  justify-self: start;
  border-radius: 0 5px 5px 0;
  transition: width 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.stat-val-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-color);
}

.stat-val-row span:nth-child(2) {
  color: var(--highlight-color);
}

/* Tactical narrative writeup box */
.tactical-writeup {
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed var(--border-color);
  margin-top: 0.5rem;
}

.tactical-writeup h4 {
  font-family: var(--text-heading-font);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: var(--accent-color);
}

.tactical-writeup p {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-color);
}

/* Currency Output Displays */
.currency-output-box {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: slide-in-card 0.3s ease-out;
}

.modern-val-badge {
  background: rgba(var(--accent-rgb), 0.05);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.modern-val-badge span {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
}

.modern-val-badge h4 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-top: 0.25rem;
}

.purchasing-power-desc {
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
}

.purchasing-power-desc strong {
  font-size: 0.8rem;
  color: var(--accent-color);
  display: block;
  margin-bottom: 0.25rem;
}

.purchasing-power-desc p {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-color);
}

/* =========================================================================
   LANDMARKS TIMELINE LISTING
   ========================================================================= */
.landmarks-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.landmarks-list-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.landmarks-scroller {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  max-height: 180px;
}

.landmark-item {
  padding: 0.6rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.3s ease;
}

.landmark-item:hover {
  background: rgba(var(--accent-rgb), 0.05);
  border-color: var(--border-color);
}

.landmark-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.15rem;
}

.landmark-item-year {
  opacity: 0.8;
}

.landmark-item p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* =========================================================================
   TIMELINE SCALE (FOOTER)
   ========================================================================= */
.timeline-outer {
  padding: 1rem 2rem;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  position: sticky;
  bottom: 0;
  background: var(--bg-gradient);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.03);
  transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.timeline-wrapper {
  position: relative;
  height: 55px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: var(--card-bg);
}

.timeline-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 2px;
  z-index: 1;
}

.timeline-progress {
  position: absolute;
  left: 0;
  width: 0%;
  height: 4px;
  background: var(--accent-color);
  border-radius: 2px;
  z-index: 2;
  transition: width var(--transition-speed) cubic-bezier(0.25, 0.8, 0.25, 1), background var(--transition-speed) ease;
}

.timeline-eras {
  position: absolute;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  z-index: 3;
  height: 100%;
}

.timeline-era-point {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  height: 100%;
  flex: 1;
}

.era-node {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid rgba(0, 0, 0, 0.15);
  z-index: 4;
  transition: all 0.5s ease;
}

.timeline-era-point:hover .era-node {
  transform: scale(1.2);
  border-color: var(--accent-color);
}

.timeline-era-point.active .era-node {
  background: var(--accent-color);
  border-color: var(--accent-color);
  transform: scale(1.3);
  box-shadow: 0 0 8px var(--glow-color);
}

.era-label {
  position: absolute;
  bottom: 0px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.timeline-era-point.active .era-label {
  color: var(--accent-color);
  font-weight: 700;
}

.era-years {
  position: absolute;
  top: 0px;
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.landmark-pin {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--text-color);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  z-index: 5;
  cursor: pointer;
  transition: all 0.3s ease;
}

.landmark-pin:hover {
  width: 11px;
  height: 11px;
  background: var(--accent-color);
  box-shadow: 0 0 6px var(--glow-color);
}

.landmark-pin.active {
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--glow-color);
  transform: translate(-50%, -50%) scale(1.3);
}

.landmark-tooltip {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.7rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.landmark-pin:hover .landmark-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================================
   ANIMATIONS & RESPONSIVE DESIGN
   ========================================================================= */

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.25); }
  70% { box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}

@keyframes wave-anim {
  0% { height: 3px; }
  100% { height: 15px; }
}

@keyframes slide-in-card {
  0% { opacity: 0; transform: translateY(5px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Responsive grid/layouts */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
    height: auto;
    overflow-y: auto;
    padding: 0 1rem 1rem 1rem;
    gap: 1rem;
  }
  
  .sidebar {
    flex-direction: column !important;
    overflow-x: hidden !important;
    padding: 0.8rem !important;
    width: 100% !important;
    height: auto !important;
    gap: 0.8rem !important;
  }
  
  .sidebar-title {
    display: block !important;
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin: 0.1rem 0 0.4rem 0 !important;
    color: var(--accent-color) !important;
  }
  
  .sidebar-era-nav, .category-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    width: 100% !important;
    gap: 0.5rem !important;
    padding-bottom: 0.35rem !important;
    scrollbar-width: none !important;
    margin: 0 !important;
    list-style: none !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .sidebar-era-nav::-webkit-scrollbar, .category-nav::-webkit-scrollbar {
    display: none !important;
  }

  .sidebar-era-nav li, .category-nav li {
    flex-shrink: 0 !important;
    margin: 0 !important;
  }
  
  .sidebar-era-btn, .category-btn {
    white-space: nowrap !important;
    width: auto !important;
    padding: 0.5rem 0.8rem !important;
    font-size: 0.8rem !important;
  }
  
  .sidebar-era-btn .premium-icon, .category-btn .premium-icon {
    width: 32px !important;
    height: 32px !important;
  }

  .viewport {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .era-pane {
    border-top: 1px solid var(--border-color);
  }

  header {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
    padding: 1rem;
  }
  
  .timeline-outer {
    position: relative;
    padding: 1rem;
  }
  
  .era-years {
    display: none;
  }
}

@media (max-width: 600px) {
  .brand h1 {
    font-size: 1.5rem;
  }
  
  .timeline-wrapper {
    height: 75px;
  }
  
  .era-label {
    font-size: 0.6rem;
    bottom: 5px;
    transform: rotate(-10deg);
  }
  
  .articles-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   EXTENDED HISTORY LAB & QUIZ/GENERATOR STYLES
   ========================================================================= */

.quiz-choice-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-color);
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  font-family: var(--text-body-font);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-choice-btn:hover:not(:disabled) {
  background: rgba(var(--accent-rgb), 0.05);
  border-color: var(--accent-color);
  transform: translateX(3px);
}

.quiz-choice-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.quiz-choice-btn.correct {
  background: rgba(40, 167, 69, 0.1) !important;
  border-color: #28a745 !important;
  color: #155724 !important;
  font-weight: 600;
}

.quiz-choice-btn.incorrect {
  background: rgba(220, 53, 69, 0.1) !important;
  border-color: #dc3545 !important;
  color: #721c24 !important;
}

.quiz-feedback-box.correct {
  background: rgba(40, 167, 69, 0.08);
  border: 1px solid rgba(40, 167, 69, 0.2);
  color: #155724;
}

.quiz-feedback-box.incorrect {
  background: rgba(220, 53, 69, 0.08);
  border: 1px solid rgba(220, 53, 69, 0.2);
  color: #721c24;
}

/* Ensure Leaflet stays fully aligned and clean during reflows */
.leaflet-container {
  font-family: var(--text-body-font) !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.95) !important;
}

.leaflet-popup-close-button {
  color: var(--text-muted) !important;
  font-size: 14px !important;
  top: 4px !important;
  right: 4px !important;
}

/* =========================================================================
   NEW: HISTORICAL HOME-PAGE ANIMATION & MORPHING SCENES
   ========================================================================= */

.hero-scenes-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s ease-in-out, transform 1.8s cubic-bezier(0.25, 1, 0.5, 1);
  transform: scale(1.05);
}

.hero-scene.active {
  opacity: 1;
  transform: scale(1.0);
}

.scene-sky {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.prehistoric-sky {
  background: linear-gradient(rgba(27, 7, 0, 0.45), rgba(97, 39, 11, 0.85)), url('../images/prehistoric_era.png') no-repeat center/cover;
}

.ancient-sky {
  background: linear-gradient(rgba(5, 22, 42, 0.45), rgba(110, 80, 8, 0.85)), url('../images/ancient_era.png') no-repeat center/cover;
}

.medieval-sky {
  background: linear-gradient(rgba(10, 1, 1, 0.45), rgba(84, 17, 18, 0.85)), url('../images/medieval_era.png') no-repeat center/cover;
}

.modern-sky {
  background: linear-gradient(rgba(5, 11, 24, 0.45), rgba(21, 70, 163, 0.85)), url('../images/modern_era.png') no-repeat center/cover;
}

.future-sky {
  background: linear-gradient(rgba(3, 0, 7, 0.45), rgba(70, 12, 130, 0.85)), url('../images/future_era.png') no-repeat center/cover;
}

.scene-vectors {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.hero-gear-spin {
  transform-origin: 550px 180px;
  animation: heroGearRotation 20s linear infinite;
}

@keyframes heroGearRotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Sidebar Era Navigation */
.sidebar-era-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-era-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-color);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--text-body-font);
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.3s ease;
}

.sidebar-era-btn:hover {
  background: rgba(var(--accent-rgb), 0.05);
  color: var(--accent-color);
}

.sidebar-era-btn.active {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-color), 0.25);
  color: var(--accent-color);
  font-weight: 700;
}

/* =========================================================================
   CINEMATIC LANDING HOMEPAGE VIEW
   ========================================================================= */
.homepage-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2500;
  background: #080a10;
  color: #ffffff;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 5rem 2rem 2rem 2rem;
  transition: opacity 0.7s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 0.7s cubic-bezier(0.25, 1, 0.5, 1), 
              visibility 0.7s;
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

body.homepage-inactive .homepage-view {
  opacity: 0;
  transform: translateY(-40px);
  pointer-events: none;
  visibility: hidden;
}

/* Transitions for dashboard workspace elements */
header, .app-container, footer.timeline-outer {
  transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
              visibility 0.6s !important;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

body.homepage-active {
  cursor: default !important;
}

body.homepage-active header,
body.homepage-active .app-container,
body.homepage-active footer.timeline-outer {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transform: scale(0.98);
}

/* Background animated particle layer and deep space panorama */
.homepage-bg-panorama {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(5, 7, 12, 0.72), rgba(5, 7, 12, 0.96)), url('../images/history_panorama.png') no-repeat center center/cover;
  z-index: -2;
  filter: grayscale(35%) contrast(108%) brightness(50%) blur(3px);
  transform: scale(1.06);
}

.homepage-stars {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(1.5px 1.5px at 20px 30px, #ffffff 100%, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.7) 100%, transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.5) 100%, transparent),
    radial-gradient(2px 2px at 150px 120px, #ffffff 100%, transparent);
  background-repeat: repeat;
  background-size: 250px 250px;
  opacity: 0.15;
  z-index: -1;
  animation: bgScroll 180s linear infinite;
}

@keyframes bgScroll {
  from { background-position: 0 0; }
  to { background-position: 0 1000px; }
}

/* Top Navigation Bar */
.homepage-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 4rem;
  background: rgba(8, 10, 15, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1.2px solid rgba(197, 168, 128, 0.22);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2600;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
}

.nav-brand-logo {
  font-size: 1.6rem;
  color: #c5a880;
  filter: drop-shadow(0 0 6px rgba(197, 168, 128, 0.35));
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
}

.nav-brand-title {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 4px;
  line-height: 1.1;
  color: #ffffff;
}

.nav-brand-subtitle {
  font-size: 0.58rem;
  letter-spacing: 2px;
  color: rgba(197, 168, 128, 0.85);
  font-weight: 600;
  margin-top: 0.15rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.4rem 0;
}

.nav-links a:hover,
.nav-links li.active a {
  color: #c5a880;
  text-shadow: 0 0 8px rgba(197, 168, 128, 0.3);
}

.nav-links li.active a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #c5a880;
  box-shadow: 0 0 6px rgba(197, 168, 128, 0.6);
  border-radius: 2px;
}

/* Nav links Dropdown styling */
.nav-links li.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(10, 12, 18, 0.95);
  border: 1px solid rgba(197, 168, 128, 0.25);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border-radius: 4px;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  min-width: 160px;
  display: none;
  z-index: 2700;
  backdrop-filter: blur(8px);
}

.dropdown-menu li a {
  display: block;
  padding: 0.6rem 1.2rem;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 0.72rem;
  letter-spacing: 1px;
}

.dropdown-menu li a:hover {
  background: rgba(197, 168, 128, 0.08);
  color: #c5a880 !important;
}

.nav-links li.dropdown:hover .dropdown-menu {
  display: block;
  animation: fadeInUpSmall 0.3s ease;
}

@keyframes fadeInUpSmall {
  from { opacity: 0; transform: translateX(-50%) translateY(15px); }
  to { opacity: 1; transform: translateX(-50%) translateY(10px); }
}

.arrow-down {
  font-size: 0.55rem;
  margin-left: 0.2rem;
  display: inline-block;
  vertical-align: middle;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.auth-btn {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.auth-btn:hover {
  color: #c5a880;
}

.signup-btn {
  border: 1px solid #c5a880;
  padding: 0.4rem 1.1rem;
  border-radius: 3px;
  background: rgba(197, 168, 128, 0.04);
}

.signup-btn:hover {
  background: #c5a880;
  color: #080a10 !important;
}

.auth-divider {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
}

.homepage-content-wrapper {
  max-width: 1400px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Hero introductory layout */
.homepage-hero {
  text-align: center;
  margin: 2vh auto 1.25rem auto;
  max-width: 900px;
  animation: fadeInUp 0.8s ease-out;
}

.homepage-main-title {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 8px;
  text-transform: uppercase;
  margin: 0 0 0.6rem 0;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.homepage-tagline {
  font-family: 'Lora', serif;
  font-size: 1.02rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1.2rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.homepage-enter-btn {
  background: rgba(8, 10, 16, 0.55);
  border: 1.5px solid #c5a880;
  color: #c5a880;
  padding: 0.75rem 2.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(197, 168, 128, 0.1);
  transition: all 0.3s ease;
  font-family: 'Cinzel', serif;
  margin: 0 auto;
}

.homepage-enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(197, 168, 128, 0.4);
  background: #c5a880;
  color: #080a10;
}

/* Legacy Epoch Timeline Banner replaced by visual-era-card navigator */

/* Bottom Dashboard Layout */
.homepage-bottom-layout {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 2rem;
  width: 100%;
  margin-bottom: 2rem;
  animation: fadeInUp 1.2s ease-out;
  align-items: stretch;
}

/* Visual Era Navigator Grid */
.homepage-era-navigator {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  width: 100%;
  margin: 1rem auto 2rem auto;
  animation: fadeInUp 1s ease-out;
}

.visual-era-card {
  position: relative;
  height: 330px;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem;
  cursor: pointer;
  transition: all 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  background: rgba(8, 10, 15, 0.4);
}

.visual-era-card .era-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 1;
}

.visual-era-card .era-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(8, 10, 15, 0.1) 0%,
    rgba(8, 10, 15, 0.45) 40%,
    rgba(8, 10, 15, 0.95) 100%
  );
  z-index: 2;
  transition: background 0.4s ease;
}

.visual-era-card .era-card-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.visual-era-card .epoch-date {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-color);
  background: rgba(197, 168, 128, 0.15);
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  align-self: flex-start;
  letter-spacing: 0.5px;
}

.visual-era-card .epoch-title {
  font-family: 'Cinzel', serif;
  font-size: 1.02rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1.2px;
  margin: 0.15rem 0 0 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.visual-era-card .epoch-subtitle {
  font-size: 0.65rem;
  color: #c5a880;
  letter-spacing: 1px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0;
}

.visual-era-card .epoch-description {
  font-size: 0.72rem;
  line-height: 1.45;
  color: #cbd5e1;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  margin: 0;
}

.visual-era-card .epoch-action {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.4rem;
  opacity: 0.7;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Hover & Active Effects */
.visual-era-card:hover {
  transform: translateY(-8px);
  border-color: rgba(197, 168, 128, 0.4);
  box-shadow: 0 12px 40px rgba(197, 168, 128, 0.2);
}

.visual-era-card:hover .era-card-bg {
  transform: scale(1.08);
}

.visual-era-card:hover .era-card-overlay {
  background: linear-gradient(
    to bottom,
    rgba(8, 10, 15, 0.05) 0%,
    rgba(8, 10, 15, 0.25) 30%,
    rgba(8, 10, 15, 0.98) 100%
  );
}

.visual-era-card:hover .epoch-description {
  opacity: 0.95;
  max-height: 100px;
  margin-top: 0.3rem;
  margin-bottom: 0.2rem;
}

.visual-era-card:hover .epoch-action {
  color: var(--accent-color);
  opacity: 1;
}

/* Spotlight Showcase Section */
.homepage-spotlight-showcase {
  padding: 1.8rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 10, 15, 0.82);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.spotlight-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.6rem;
}

.spotlight-main-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  color: #ffffff;
  margin: 0.2rem 0 0 0;
  letter-spacing: 0.5px;
}

.spotlight-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.spotlight-item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.8rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.3s ease;
}

.spotlight-item:hover {
  background: rgba(197, 168, 128, 0.05);
  border-color: rgba(197, 168, 128, 0.2);
  transform: translateX(4px);
}

.spotlight-icon {
  font-size: 1.25rem;
  background: rgba(197, 168, 128, 0.1);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--accent-color);
  flex-shrink: 0;
}

.spotlight-info h5 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.15rem 0;
}

.spotlight-info p {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-color);
  opacity: 0.8;
  margin: 0;
}

/* Right Sidebar Dashboard */
.homepage-sidebar {
  background: rgba(8, 10, 15, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.sidebar-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.6rem;
}

.timeline-title-kicker {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: #c5a880;
  font-weight: 700;
}

.sidebar-action-icons {
  display: flex;
  gap: 0.6rem;
}

.sidebar-action-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.sidebar-action-btn:hover {
  background: rgba(197, 168, 128, 0.1);
  border-color: rgba(197, 168, 128, 0.4);
  color: #c5a880;
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(197, 168, 128, 0.25);
}

.sidebar-section {
  text-align: left;
}

.sidebar-section-title {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: #ffffff;
  margin: 0 0 0.8rem 0;
  font-weight: 600;
}

.featured-articles-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.featured-art-link {
  color: #cbd5e1;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  font-family: 'Lora', serif;
  display: inline-block;
}

.featured-art-link:hover {
  color: #c5a880;
  transform: translateX(4px);
  text-shadow: 0 0 8px rgba(197, 168, 128, 0.25);
}

.featured-artifact-card {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1.25rem;
}

.artifact-card-body {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.artifact-card-img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(197, 168, 128, 0.35);
  box-shadow: 0 0 12px rgba(197, 168, 128, 0.15);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.3s ease;
  flex-shrink: 0;
}

.artifact-card-img:hover {
  transform: scale(1.06) rotate(3deg);
  border-color: rgba(197, 168, 128, 0.6);
  box-shadow: 0 0 18px rgba(197, 168, 128, 0.25);
}

.artifact-card-info {
  flex: 1;
  text-align: left;
}

.artifact-card-title {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  color: #ffffff;
  margin: 0 0 0.25rem 0;
}

.artifact-card-desc {
  font-size: 0.7rem;
  color: #a0a5b5;
  line-height: 1.35;
  margin: 0 0 0.4rem 0;
}

.artifact-card-link {
  font-size: 0.72rem;
  color: #c5a880;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
  display: inline-block;
}

.artifact-card-link:hover {
  text-decoration: underline;
  transform: translateX(2px);
}

/* Footer Section */
.homepage-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1rem;
  margin-top: 1.5rem;
}

.footer-link {
  color: #a0a5b5;
  font-size: 0.75rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #c5a880;
}

.footer-dot {
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
}

.footer-copyright {
  color: #707585;
  font-size: 0.72rem;
  margin-left: auto;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjust */
@media (max-width: 1024px) {
  .homepage-bottom-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .homepage-nav-bar {
    padding: 0.8rem 2rem;
  }
  .homepage-main-title {
    font-size: 2.2rem;
    letter-spacing: 6px;
  }
  .visual-era-card {
    height: 310px;
  }
}

@media (max-width: 768px) {
  .homepage-nav-bar {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    position: relative;
  }
  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .homepage-view {
    padding-top: 2rem;
  }
  .homepage-main-title {
    font-size: 1.8rem;
    letter-spacing: 4px;
  }
  .homepage-era-navigator {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    margin: 1rem auto 1.5rem auto;
  }
  .homepage-era-navigator .visual-era-card:nth-child(5) {
    grid-column: span 2;
  }
  .visual-era-card {
    height: 280px;
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .homepage-main-title {
    font-size: 1.4rem;
    letter-spacing: 3px;
  }
  .homepage-tagline {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
  }
  .homepage-era-navigator {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .homepage-era-navigator .visual-era-card:nth-child(5) {
    grid-column: span 1;
  }
  .visual-era-card {
    height: 230px;
  }
}


/* =========================================================================
   PREMIUM GLASSMORPHIC ILLUSTRATIVE ICONS
   ========================================================================= */
.premium-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 3px 8px rgba(0, 0, 0, 0.25);
  font-size: 0 !important; /* Hide legacy emojis */
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  flex-shrink: 0;
  line-height: 1;
  overflow: hidden;
}

.premium-icon.large-icon {
  width: 76px;
  height: 76px;
  background-size: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.15), 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Era-specific Premium Icon Glows */
.prehistoric-icon {
  background-image: url('../images/prehistoric_icon_clean.png');
  border-color: rgba(230, 81, 0, 0.4);
  background-color: rgba(230, 81, 0, 0.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 0 10px rgba(230, 81, 0, 0.2);
}

.ancient-icon {
  background-image: url('../images/ancient_icon_clean.png');
  border-color: rgba(249, 115, 22, 0.4);
  background-color: rgba(249, 115, 22, 0.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 0 10px rgba(249, 115, 22, 0.2);
}

.medieval-icon {
  background-image: url('../images/medieval_icon_clean.png');
  border-color: rgba(234, 88, 12, 0.4);
  background-color: rgba(234, 88, 12, 0.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 0 10px rgba(234, 88, 12, 0.2);
}

.modern-icon {
  background-image: url('../images/modern_icon_clean.png');
  border-color: rgba(255, 107, 0, 0.4);
  background-color: rgba(255, 107, 0, 0.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 0 10px rgba(255, 107, 0, 0.2);
}

.future-icon {
  background-image: url('../images/future_icon_clean.png');
  border-color: rgba(255, 118, 0, 0.4);
  background-color: rgba(255, 118, 0, 0.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 0 10px rgba(255, 118, 0, 0.2);
}

/* Category-specific Premium Icon borders & subtle coloring */
.all-icon {
  background-image: url('../images/topic_all.png');
  border-color: rgba(255, 255, 255, 0.25);
  background-color: rgba(255, 255, 255, 0.05);
}

.empires-icon {
  background-image: url('../images/topic_empires.png');
  border-color: rgba(251, 191, 36, 0.35);
  background-color: rgba(251, 191, 36, 0.05);
}

.science-icon {
  background-image: url('../images/topic_science.png');
  border-color: rgba(96, 165, 250, 0.35);
  background-color: rgba(96, 165, 250, 0.05);
}

.economics-icon {
  background-image: url('../images/topic_economics.png');
  border-color: rgba(245, 158, 11, 0.35);
  background-color: rgba(245, 158, 11, 0.05);
}

.languages-icon {
  background-image: url('../images/topic_languages.png');
  border-color: rgba(244, 63, 94, 0.35);
  background-color: rgba(244, 63, 94, 0.05);
}

.society-icon {
  background-image: url('../images/topic_society.png');
  border-color: rgba(16, 185, 129, 0.35);
  background-color: rgba(16, 185, 129, 0.05);
}

.transport-icon {
  background-image: url('../images/topic_transport.png');
  border-color: rgba(6, 182, 212, 0.35);
  background-color: rgba(6, 182, 212, 0.05);
}

.lab-icon {
  background-image: url('../images/topic_lab.png');
  border-color: rgba(168, 85, 247, 0.35);
  background-color: rgba(168, 85, 247, 0.05);
}

.bookmarks-icon {
  background-image: url('../images/topic_bookmarks.png');
  border-color: rgba(236, 72, 153, 0.35);
  background-color: rgba(236, 72, 153, 0.05);
}

/* Zoom in on topic icons to crop out the outer square margins and align their circular design perfectly */
.premium-icon.all-icon,
.premium-icon.empires-icon,
.premium-icon.science-icon,
.premium-icon.economics-icon,
.premium-icon.languages-icon,
.premium-icon.society-icon,
.premium-icon.transport-icon,
.premium-icon.lab-icon,
.premium-icon.bookmarks-icon {
  background-size: 135% 135% !important;
}

/* Button Hover interactions for premium icons */
.sidebar-era-btn:hover .premium-icon,
.category-btn:hover .premium-icon,
.homepage-topic-btn:hover .premium-icon,
.homepage-era-card:hover .premium-icon {
  transform: scale(1.1) rotate(5deg);
  border-color: var(--accent-color);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.4);
}

/* Article Inline Figures and Images */
.reader-body figure {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.reader-body figure img {
  width: 100%;
  max-width: 680px;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.reader-body figure img:hover {
  transform: scale(1.01);
  box-shadow: 0 12px 35px rgba(var(--accent-rgb), 0.12);
  border-color: var(--accent-color);
}

.reader-body figcaption {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  max-width: 600px;
  line-height: 1.4;
  padding: 0 1rem;
}

/* Glassmorphic Toast Notification */
.chronos-toast {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(10, 12, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(197, 168, 128, 0.35);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 15px rgba(197, 168, 128, 0.2);
  color: #ffffff;
  padding: 0.9rem 2.2rem;
  border-radius: 6px;
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-align: center;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.chronos-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* =========================================================================
   HOMEPAGE SUB-SECTIONS NAVIGATION & LAYOUT
   ========================================================================= */
.homepage-section {
  display: none;
  width: 100%;
  animation: fadeInSection 0.5s ease-out forwards;
}

.homepage-section.active {
  display: block;
}

@keyframes fadeInSection {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.homepage-section .section-header {
  text-align: center;
  margin-bottom: 3rem;
  margin-top: 1rem;
}

.homepage-section .section-title {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  color: #ffffff;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.homepage-section .section-subtitle {
  font-family: 'Lora', serif;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ----------------------------------------------------
   ILLUSTRATIVE VERTICAL TIMELINE
   ---------------------------------------------------- */
.vertical-timeline-container {
  position: relative;
  max-width: 900px;
  margin: 2rem auto 5rem auto;
  padding: 2rem 0;
}

.vertical-timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, 
    rgba(197, 168, 128, 0.1) 0%, 
    rgba(197, 168, 128, 0.6) 20%, 
    rgba(197, 168, 128, 0.6) 80%, 
    rgba(197, 168, 128, 0.1) 100%);
  transform: translateX(-50%);
}

.v-timeline-node {
  position: relative;
  width: 50%;
  margin-bottom: 3.5rem;
  display: flex;
  justify-content: flex-end;
  padding-right: 3rem;
}

.v-timeline-node.right {
  align-self: flex-end;
  justify-content: flex-start;
  margin-left: 50%;
  padding-right: 0;
  padding-left: 3rem;
}

.v-timeline-badge {
  position: absolute;
  top: 1.5rem;
  left: 100%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0f131a;
  border: 2px solid #c5a880;
  box-shadow: 0 0 10px rgba(197, 168, 128, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  z-index: 10;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.v-timeline-node.right .v-timeline-badge {
  left: 0;
}

.v-timeline-node:hover .v-timeline-badge {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 0 15px rgba(197, 168, 128, 0.8);
  background: #c5a880;
  color: #0f131a;
}

.v-timeline-content {
  width: 100%;
  padding: 1.5rem 1.8rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.v-timeline-content:hover {
  border-color: rgba(197, 168, 128, 0.45) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 15px rgba(197, 168, 128, 0.15) !important;
  transform: translateY(-3px);
}

.v-timeline-content::after {
  content: "";
  position: absolute;
  top: 1.5rem;
  right: -8px;
  width: 16px;
  height: 16px;
  background: inherit;
  border-right: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  transform: translateY(-50%) rotate(45deg);
  z-index: 1;
}

.v-timeline-node.right .v-timeline-content::after {
  right: auto;
  left: -8px;
  border-right: none;
  border-top: none;
  border-left: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.v-timeline-date {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #c5a880;
  letter-spacing: 1.5px;
  display: block;
  margin-bottom: 0.5rem;
}

.v-timeline-title {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  color: #ffffff;
  letter-spacing: 1px;
}

.v-timeline-desc {
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.9rem;
}

.v-timeline-link {
  font-size: 0.75rem;
  color: #c5a880;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 1px;
  display: inline-block;
  transition: transform 0.2s ease, color 0.2s ease;
}

.v-timeline-link:hover {
  color: #ffffff;
  transform: translateX(4px);
}

/* ----------------------------------------------------
   ARTIFACTS GALLERY GRID
   ---------------------------------------------------- */
.artifacts-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 5rem auto;
}

.artifact-gallery-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
}

.artifact-gallery-card:hover {
  transform: translateY(-8px);
  border-color: rgba(197, 168, 128, 0.4);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 15px rgba(197, 168, 128, 0.15);
}

.artifact-gallery-img-wrapper {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(197, 168, 128, 0.1);
}

.artifact-gallery-img-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 1.5rem;
  transition: transform 0.5s ease;
}

.artifact-gallery-card:hover .artifact-gallery-img-wrapper img {
  transform: scale(1.08);
}

.artifact-gallery-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.artifact-gallery-tag {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #c5a880;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

.artifact-gallery-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.artifact-gallery-desc {
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1.2rem;
  flex: 1;
}

.artifact-gallery-link {
  font-size: 0.75rem;
  color: #c5a880;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 1px;
  align-self: flex-start;
  transition: color 0.2s ease, transform 0.2s ease;
}

.artifact-gallery-link:hover {
  color: #ffffff;
  transform: translateX(4px);
}

/* ----------------------------------------------------
   ACADEMIC PASSPORT PROFILE SECTION
   ---------------------------------------------------- */
.profile-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto 5rem auto;
}

.profile-passport-card {
  border: 1px solid rgba(197, 168, 128, 0.25);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 440px;
  position: relative;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
}

.profile-passport-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(circle at 80% 20%, rgba(197, 168, 128, 0.04), transparent 50%);
  pointer-events: none;
}

.passport-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(197, 168, 128, 0.25);
  padding-bottom: 0.75rem;
}

.passport-kicker {
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: #c5a880;
}

.passport-seal {
  font-size: 1.5rem;
  animation: pulse-glow 3s infinite ease-in-out;
}

.passport-body {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0;
  align-items: center;
}

.passport-photo-placeholder {
  width: 110px;
  height: 140px;
  border: 1.5px solid rgba(197, 168, 128, 0.3);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  gap: 0.5rem;
}

.photo-icon {
  font-size: 2.2rem;
  opacity: 0.4;
  color: #ffffff;
}

.photo-label {
  font-size: 0.55rem;
  color: #c5a880;
  text-transform: uppercase;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5px;
}

.passport-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.detail-row {
  display: flex;
  flex-direction: column;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.2rem;
}

.detail-lbl {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.detail-val {
  font-family: "Lora", serif;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.passport-footer {
  border-top: 1px solid rgba(197, 168, 128, 0.25);
  padding-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 1px;
}

.profile-achievements {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.35);
  padding: 2rem;
}

.profile-achievements h3 {
  font-family: "Cinzel", serif;
  color: #c5a880;
  font-size: 1.1rem;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.badges-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.2rem;
}

.badge-itemlocked, .badge-itemunlocked {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.badge-itemlocked {
  opacity: 0.35;
  filter: grayscale(1);
}

.badge-itemunlocked {
  opacity: 1;
  filter: none;
  border: 1.5px solid rgba(197, 168, 128, 0.45);
  background: radial-gradient(circle, rgba(197, 168, 128, 0.08), transparent 80%);
  box-shadow: 0 4px 16px rgba(197, 168, 128, 0.15);
  transform: translateY(-2px);
}

.badge-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.badge-name {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: #c5a880;
  margin-bottom: 0.25rem;
}

.badge-desc {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.3;
}

.recent-activities-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 0.76rem;
  color: #a0a5b5;
  border-left: 2px solid rgba(197, 168, 128, 0.3);
}

@media (max-width: 768px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
  .profile-passport-card {
    height: auto;
  }
}

/* ----------------------------------------------------
   INTERACTIVE MAPS PORTAL
   ---------------------------------------------------- */
.homepage-map-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 5rem auto;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(197, 168, 128, 0.25);
}

.homepage-leaflet-map {
  width: 100%;
  height: 550px;
  background: #080a10;
  z-index: 1;
}

.homepage-map-legend {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  background: rgba(8, 10, 15, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(197, 168, 128, 0.25);
  padding: 1rem;
  border-radius: 8px;
  z-index: 1000;
  pointer-events: none;
  max-width: 220px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.homepage-map-legend h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: #ffffff;
  margin-bottom: 0.6rem;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.3rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 0.4rem;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Premium Dark Map Leaflet Popups */
.homepage-leaflet-popup .leaflet-popup-content-wrapper {
  background: #0c0f17 !important;
  color: #e2e8f0 !important;
  border: 1.5px solid rgba(197, 168, 128, 0.3) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
  padding: 0 !important;
}

.homepage-leaflet-popup .leaflet-popup-content {
  margin: 0 !important;
  padding: 0.75rem !important;
}

.homepage-leaflet-popup .leaflet-popup-tip {
  background: #0c0f17 !important;
  border-left: 1px solid rgba(197, 168, 128, 0.3) !important;
  border-bottom: 1px solid rgba(197, 168, 128, 0.3) !important;
  box-shadow: none !important;
}

/* ----------------------------------------------------
   COMMUNITY GRID & DISCUSSIONS
   ---------------------------------------------------- */
.community-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 5rem auto;
}

.community-left, .community-right .glass-panel {
  padding: 2rem;
  border-radius: 12px;
}

.community-left h3, .community-right h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: #ffffff;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(197, 168, 128, 0.15);
  padding-bottom: 0.6rem;
}

.discussion-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.discussion-item {
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.discussion-item:hover {
  border-color: rgba(197, 168, 128, 0.3);
  background: rgba(197, 168, 128, 0.02);
  transform: translateX(4px);
}

.disc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  color: #a0a5b5;
  margin-bottom: 0.5rem;
}

.disc-author {
  color: #c5a880;
  font-weight: 700;
}

.disc-time {
  opacity: 0.75;
}

.disc-title {
  font-size: 0.95rem;
  font-family: 'Lora', serif;
  color: #ffffff;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.disc-preview {
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
}

.disc-actions {
  display: flex;
  gap: 1.5rem;
  font-size: 0.7rem;
  color: #a0a5b5;
}

.community-form .form-row {
  margin-bottom: 1rem;
}

.community-input, .community-select, .community-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(197, 168, 128, 0.2);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  color: #ffffff;
  font-family: var(--text-body-font);
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.community-input:focus, .community-select:focus, .community-textarea:focus {
  border-color: #c5a880;
  box-shadow: 0 0 8px rgba(197, 168, 128, 0.25);
}

.community-select {
  cursor: pointer;
}

.community-select option {
  background: #0c0f17;
  color: #ffffff;
}

.study-guide-stats {
  background: rgba(197, 168, 128, 0.03);
  border: 1px solid rgba(197, 168, 128, 0.2);
  border-radius: 12px;
  padding: 1.5rem 2rem;
}

/* ----------------------------------------------------
   RESPONSIVE ADJUSTMENTS
   ---------------------------------------------------- */
@media (max-width: 900px) {
  .community-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .homepage-nav-bar {
    padding: 0.8rem 1.5rem;
  }
  .nav-links {
    display: flex; /* Ensure navigation links are visible on mobile */
  }
  .homepage-section .section-title {
    font-size: 1.6rem;
  }
  .homepage-section .section-subtitle {
    font-size: 0.85rem;
  }
  .vertical-timeline-container {
    padding: 1rem 0;
  }
  .v-timeline-node {
    margin-bottom: 2.5rem;
  }
}

/* =========================================================================
   TIME ENGINE CHRONICLE CARD
   ========================================================================= */
.time-engine-chronicle-card {
  margin-top: 1rem;
  padding: 1.2rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.chronicle-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

#chronicle-card-title {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.5px;
}

.chronicle-card-year {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: #c5a880;
  background: rgba(197, 168, 128, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

#chronicle-card-desc {
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-color);
  opacity: 0.9;
  margin: 0.2rem 0;
}

.chronicle-card-link {
  font-size: 0.75rem;
  color: #c5a880;
  text-decoration: none;
  font-weight: 700;
  align-self: flex-start;
  transition: transform 0.2s ease;
  margin-top: 0.2rem;
}

.chronicle-card-link:hover {
  text-decoration: underline;
  transform: translateX(3px);
}

/* Custom Leaflet Popup styling for Historical Map */
.historical-map-custom-popup .leaflet-popup-content-wrapper {
  background: rgba(12, 15, 23, 0.95) !important;
  border: 1px solid rgba(197, 168, 128, 0.25) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  color: #e2e8f0 !important;
  padding: 6px !important;
}

.historical-map-custom-popup .leaflet-popup-tip {
  background: rgba(12, 15, 23, 0.95) !important;
  border-left: 1px solid rgba(197, 168, 128, 0.25) !important;
  border-bottom: 1px solid rgba(197, 168, 128, 0.25) !important;
}

.historical-map-custom-popup .leaflet-popup-close-button {
  color: #a0a5b5 !important;
  font-size: 14px !important;
  padding: 6px 8px 0 0 !important;
}

/* Homepage Leaflet popup alignment */
.homepage-leaflet-popup .leaflet-popup-content-wrapper {
  background: rgba(12, 15, 23, 0.95) !important;
  border: 1px solid rgba(197, 168, 128, 0.25) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  padding: 6px !important;
}

.homepage-leaflet-popup .leaflet-popup-tip {
  background: rgba(12, 15, 23, 0.95) !important;
  border-left: 1px solid rgba(197, 168, 128, 0.25) !important;
  border-bottom: 1px solid rgba(197, 168, 128, 0.25) !important;
}
