/* ==========================================================================
   CryoVerse - Polar Science Portal Stylesheet
   Modern Glassmorphism, Aurora & Deep Polar Midnight Theme
   ========================================================================== */

:root {
  --bg-primary: #060d17;
  --bg-secondary: #0b1728;
  --bg-card: rgba(13, 26, 45, 0.72);
  --bg-card-hover: rgba(18, 36, 62, 0.85);
  --glass-border: rgba(94, 234, 212, 0.18);
  --glass-border-hover: rgba(94, 234, 212, 0.45);
  
  --ice-blue: #38bdf8;
  --ice-cyan: #22d3ee;
  --frost-teal: #2dd4bf;
  --aurora-green: #34d399;
  --aurora-purple: #818cf8;
  --deep-navy: #030712;
  --snow-white: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-gold: #fbbf24;
  --danger-crimson: #f43f5e;
  --success-emerald: #10b981;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.25);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--snow-white);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(ellipse at 20% -10%, rgba(34, 211, 238, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 10%, rgba(129, 140, 248, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 90%, rgba(52, 211, 153, 0.08) 0%, transparent 70%);
  background-attachment: fixed;
}

/* Background animated subtle aurora wave */
.aurora-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.05), rgba(52, 211, 153, 0.04), rgba(129, 140, 248, 0.05));
  filter: blur(80px);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ice-blue);
}

/* Layout Container */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(6, 13, 23, 0.85);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--snow-white);
  cursor: pointer;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--ice-blue), var(--frost-teal));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

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

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #ffffff, var(--ice-blue), var(--frost-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Navigation Links & Layer Switcher */
.nav-layers {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.7);
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
}

.layer-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.layer-btn:hover {
  color: var(--snow-white);
  background: rgba(255, 255, 255, 0.06);
}

.layer-btn.active {
  color: #030712;
  background: linear-gradient(90deg, var(--ice-cyan), var(--frost-teal));
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.4);
}

.layer-btn.active-learn {
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  color: #ffffff;
}

.layer-btn.active-teach {
  background: linear-gradient(90deg, #34d399, #10b981);
  color: #030712;
}

.layer-btn.active-research {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  color: #030712;
}

/* Navigation Utilities */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.polar-clock {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: rgba(15, 23, 42, 0.6);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ice-cyan);
}

.util-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.util-btn:hover, .util-btn.active {
  color: var(--ice-cyan);
  border-color: var(--ice-cyan);
  background: rgba(34, 211, 238, 0.1);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
}

.ai-launch-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border: none;
  border-radius: var(--radius-full);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.ai-launch-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.6);
}

/* Hero Section */
.hero-banner {
  padding: 2rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.hero-title-group h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.hero-title-group p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.4rem;
  max-width: 700px;
}

.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.875rem;
}

.stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
}

.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ice-cyan);
  font-family: var(--font-mono);
}

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

/* Layer Notice Strip */
.layer-indicator-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.layer-indicator-strip.learn-theme {
  background: rgba(129, 140, 248, 0.08);
  border-color: rgba(129, 140, 248, 0.25);
}

.layer-indicator-strip.teach-theme {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.25);
}

.layer-indicator-strip.research-theme {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.25);
}

/* Interactive Map Section */
.map-view-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
  width: 100%;
}

.map-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg-card);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.region-toggles {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.region-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.region-btn:hover {
  color: var(--snow-white);
  border-color: var(--ice-blue);
}

.region-btn.active {
  background: var(--ice-blue);
  color: #030712;
  border-color: var(--ice-blue);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.station-chips-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.station-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--snow-white);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.station-chip:hover, .station-chip.active {
  background: rgba(34, 211, 238, 0.15);
  border-color: var(--ice-cyan);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.3);
}

.chip-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success-emerald);
}
.chip-status-dot.historic {
  background: var(--accent-gold);
}
.chip-status-dot.future {
  background: var(--aurora-purple);
}

/* The Leaflet Map Canvas Frame */
.map-canvas-frame {
  position: relative;
  width: 100%;
  height: 520px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card), 0 0 30px rgba(56, 189, 248, 0.15);
  background: #020617;
}

#polar-map {
  width: 100%;
  height: 100%;
  background: #020617;
}

/* Custom Leaflet Dark adjustments */
.leaflet-container {
  background-color: #020617 !important;
  font-family: var(--font-sans) !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(11, 23, 40, 0.95) !important;
  backdrop-filter: blur(12px);
  color: var(--snow-white) !important;
  border: 1px solid var(--ice-cyan) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
}

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

/* Custom Pulsing Polar Markers */
.polar-station-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.2);
  border: 2px solid var(--ice-cyan);
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease;
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.6);
  position: relative;
}

.polar-station-marker::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 1px solid var(--ice-cyan);
  animation: pulse-ring 2s infinite ease-out;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Map Overlay Quick Legend */
.map-legend-overlay {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 400;
  background: rgba(6, 13, 23, 0.85);
  backdrop-filter: blur(10px);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

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

/* ==========================================================================
   Station Research Dossier Modal / Details Panel
   ========================================================================== */
.dossier-panel {
  position: fixed;
  top: 0;
  right: -650px;
  width: 620px;
  max-width: 90vw;
  height: 100vh;
  background: rgba(11, 23, 40, 0.96);
  backdrop-filter: blur(25px);
  border-left: 1px solid var(--glass-border);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.7);
  z-index: 1200;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dossier-panel.open {
  right: 0;
}

.dossier-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.1) 0%, transparent 100%);
}

.dossier-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--snow-white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition);
}

.dossier-close-btn:hover {
  background: rgba(244, 63, 94, 0.3);
  color: var(--danger-crimson);
}

.dossier-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.dossier-badge {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

/* Dossier Navigation Tabs */
.dossier-tabs {
  display: flex;
  background: rgba(6, 13, 23, 0.9);
  border-bottom: 1px solid var(--glass-border);
  padding: 0 1rem;
  overflow-x: auto;
}

.dossier-tab-btn {
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.dossier-tab-btn:hover {
  color: var(--snow-white);
}

.dossier-tab-btn.active {
  color: var(--ice-cyan);
  border-bottom-color: var(--ice-cyan);
}

.dossier-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Dossier Telemetry Cards Grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.telemetry-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

.telemetry-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ice-cyan);
  font-family: var(--font-mono);
}

.telemetry-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.dossier-chart-container {
  height: 220px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

/* Timeline Milestones in Dossier */
.milestones-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  padding-left: 1.5rem;
}

.milestones-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background: linear-gradient(180deg, var(--ice-cyan), rgba(34, 211, 238, 0.1));
}

.milestone-item {
  position: relative;
}

.milestone-dot {
  position: absolute;
  left: -1.5rem;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--ice-cyan);
}

.milestone-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ice-cyan);
}

.milestone-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0.2rem 0;
}

.milestone-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Section: Three Specialized Persona Layers
   ========================================================================== */
.layer-section {
  display: none;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem 3rem;
  width: 100%;
}

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

/* Sub-card grid styling */
.feature-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.glass-card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.card-badge {
  align-self: flex-start;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   CryoLearn: Student Interactive Features
   ========================================================================== */
/* Ice Core Simulator */
.ice-core-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ice-core-slider-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.depth-slider {
  width: 100%;
  accent-color: var(--ice-cyan);
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
}

.ice-core-readout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  background: rgba(6, 13, 23, 0.7);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.ice-core-cylinder-visual {
  height: 70px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #bae6fd 0%, #38bdf8 30%, #0284c7 70%, #0369a1 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #030712;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

/* Polar Quiz Game */
.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quiz-option-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--glass-border);
  color: var(--snow-white);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  text-align: left;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.quiz-option-btn:hover {
  background: rgba(34, 211, 238, 0.15);
  border-color: var(--ice-cyan);
}

.quiz-option-btn.correct {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: var(--success-emerald) !important;
  color: #a7f3d0;
}

.quiz-option-btn.incorrect {
  background: rgba(244, 63, 94, 0.25) !important;
  border-color: var(--danger-crimson) !important;
  color: #fecdd3;
}

/* Badges list */
.badge-shelf {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
}

.badge-item.unlocked {
  border-color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.12);
  color: var(--accent-gold);
}

/* ==========================================================================
   CryoTeach: Interactive Albedo Lab & Lesson Plans
   ========================================================================== */
.albedo-sim-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.albedo-visual-display {
  height: 120px;
  border-radius: var(--radius-md);
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.albedo-ice-side {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  color: #030712;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: width 0.3s ease;
}

.albedo-ocean-side {
  background: linear-gradient(135deg, #0c4a6e, #082f49);
  color: #bae6fd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: width 0.3s ease;
}

.albedo-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  text-align: center;
}

/* ==========================================================================
   CryoResearch: Datasets Table & Filtering
   ========================================================================== */
.dataset-filter-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--snow-white);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
}

.filter-select option {
  background: var(--bg-secondary);
  color: var(--snow-white);
}

.data-table-container {
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.research-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  text-align: left;
}

.research-table th {
  background: rgba(15, 23, 42, 0.9);
  padding: 0.75rem 1rem;
  color: var(--ice-cyan);
  font-weight: 600;
  border-bottom: 1px solid var(--glass-border);
}

.research-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--snow-white);
}

.research-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.btn-csv {
  background: linear-gradient(90deg, var(--ice-cyan), var(--frost-teal));
  color: #030712;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-csv:hover {
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
  transform: translateY(-1px);
}

/* ==========================================================================
   CryoBot AI Assistant Floating Drawer & Chat UI
   ========================================================================== */
.chatbot-drawer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 440px;
  max-width: calc(100vw - 48px);
  height: 640px;
  max-height: calc(100vh - 48px);
  background: rgba(11, 23, 40, 0.95);
  backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: -5px 15px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.2);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  transform: translateY(120%) scale(0.9);
  opacity: 0;
  pointer-events: none;
}

.chatbot-drawer.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.chat-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.2), rgba(99, 102, 241, 0.2));
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.chat-persona-pills {
  display: flex;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  background: rgba(6, 13, 23, 0.6);
  border-bottom: 1px solid var(--glass-border);
}

.persona-pill-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition);
}

.persona-pill-btn.active {
  background: var(--ice-cyan);
  color: #030712;
  font-weight: 700;
  border-color: var(--ice-cyan);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.chat-bubble {
  max-width: 88%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
  animation: fadeInMsg 0.25s ease-out;
}

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

.chat-bubble.bot {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  color: var(--snow-white);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-bubble.bot h3 {
  font-size: 0.95rem;
  color: var(--ice-cyan);
  margin-bottom: 0.4rem;
}

.chat-bubble.bot ul {
  margin-left: 1.25rem;
  margin-top: 0.4rem;
}

.chat-bubble.user {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.map-action-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(34, 211, 238, 0.2);
  border: 1px solid var(--ice-cyan);
  color: var(--ice-cyan);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
  cursor: pointer;
}

.chat-suggestions {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.5rem 1rem;
  background: rgba(6, 13, 23, 0.4);
  scrollbar-width: none;
}

.suggestion-chip {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--glass-border);
  color: var(--ice-cyan);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.suggestion-chip:hover {
  background: var(--ice-cyan);
  color: #030712;
}

.chat-input-bar {
  padding: 0.85rem 1rem;
  background: rgba(6, 13, 23, 0.9);
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  color: var(--snow-white);
  font-size: 0.875rem;
  outline: none;
}

.chat-input:focus {
  border-color: var(--ice-cyan);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
}

.chat-send-btn {
  background: linear-gradient(135deg, var(--ice-cyan), #3b82f6);
  border: none;
  color: #030712;
  font-weight: 700;
  padding: 0 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.chat-send-btn:hover {
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.5);
}

/* Floating AI Button */
.chat-floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ice-cyan), #6366f1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 25px rgba(34, 211, 238, 0.5);
  cursor: pointer;
  z-index: 1900;
  transition: var(--transition);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.chat-floating-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 35px rgba(34, 211, 238, 0.8);
}

/* Footer */
.portal-footer {
  margin-top: auto;
  border-top: 1px solid var(--glass-border);
  background: rgba(6, 13, 23, 0.9);
  padding: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive queries */
@media (max-width: 900px) {
  .navbar {
    flex-wrap: wrap;
  }
  .nav-layers {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }
  .dossier-panel {
    width: 100vw;
    right: -100vw;
  }
  .hero-banner {
    padding: 1.25rem 1rem;
  }
  .map-view-container {
    padding: 0 1rem 1.5rem;
  }
  .map-canvas-frame {
    height: 400px;
  }
}
