/* ==========================================================================
   Outscape - Outdoor AI Companion Design System
   Modern Obsidian & Emerald Glassmorphism Palette
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Nature & Wilderness Theme Tokens */
  --bg-primary: #060b08;
  --bg-secondary: #0c1410;
  --bg-surface: rgba(18, 28, 23, 0.75);
  --bg-surface-hover: rgba(26, 42, 34, 0.85);
  --bg-glass: rgba(12, 22, 17, 0.65);
  
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-600: #059669;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-glow: rgba(245, 158, 11, 0.25);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-faint: #6b7280;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-emerald: rgba(16, 185, 129, 0.35);

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light / High-Contrast Sunlight Mode for outdoors */
body.outdoor-contrast {
  --bg-primary: #000000;
  --bg-secondary: #0a0f0d;
  --bg-surface: #111a14;
  --border-subtle: rgba(255, 255, 255, 0.25);
  --text-main: #ffffff;
  --text-muted: #d1d5db;
  --emerald-500: #00ff9d;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(245, 158, 11, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
}

/* Header & Top Bar */
.app-header {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 12px var(--emerald-glow));
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, var(--emerald-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-400);
  border: 1px solid var(--border-emerald);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

/* Button & Control Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  outline: none;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-600));
  color: #ffffff;
  box-shadow: 0 4px 16px var(--emerald-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-subtle);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-pill {
  border-radius: var(--radius-full);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* Main Layout Grid (Responsive PC & Mobile) */
.main-container {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .main-container {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
  }
}

/* Sidebar & Biome Selector */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.glass-card {
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: border-color var(--transition-fast);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

/* Biome Selection Cards */
.biome-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.biome-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.biome-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(3px);
}

.biome-card.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--emerald-500);
  box-shadow: 0 0 16px var(--emerald-glow);
}

.biome-icon {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.biome-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.biome-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.biome-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--emerald-400);
  font-weight: 600;
}

/* Live Session Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.metric-item {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  text-align: center;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.2rem;
}

.metric-unit {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.metric-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Map & Explorer Stage */
.stage-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 520px;
}

.map-wrapper {
  position: relative;
  width: 100%;
  height: 420px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #0d1612;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Map Overlays */
.map-badge-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  display: flex;
  gap: 0.5rem;
}

.map-controls-overlay {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Audio Player Bar (Minimal, Screen-Less Focus) */
.audio-player-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 32px var(--emerald-glow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.player-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.now-observing {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.audio-pulse-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--emerald-500);
  position: relative;
  flex-shrink: 0;
}

.audio-pulse-indicator.active::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--emerald-400);
  animation: radar-pulse 1.8s infinite ease-out;
}

@keyframes radar-pulse {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.observing-text {
  overflow: hidden;
}

.observing-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.observing-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Audio Waveform Canvas Animation */
.waveform-canvas {
  width: 100%;
  height: 38px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  display: block;
}

.narration-transcript-box {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.28);
  border-left: 3px solid var(--emerald-500);
  font-size: 0.92rem;
  line-height: 1.5;
  color: #e5e7eb;
}

.mindful-alert {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--amber-400);
  background: rgba(245, 158, 11, 0.1);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Pocket Mode Overlay (Touch Grass Screen-Off Mode) */
.pocket-mode-overlay {
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 3rem 1.5rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.pocket-mode-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.pocket-orb {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--emerald-500) 0%, transparent 70%);
  filter: blur(24px);
  animation: orb-breathe 4s infinite ease-in-out;
}

@keyframes orb-breathe {
  0%, 100% { transform: scale(0.9); opacity: 0.4; }
  50% { transform: scale(1.25); opacity: 0.85; }
}

.pocket-content h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: #ffffff;
}

.pocket-content p {
  color: #9ca3af;
  font-size: 1rem;
  max-width: 320px;
}

/* AI Engine Inspector Modal */
dialog.ai-modal {
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 580px;
  width: 90%;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

dialog.ai-modal::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.88rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-field {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: #ffffff;
  font-family: monospace;
  font-size: 0.85rem;
  outline: none;
}
.input-field:focus {
  border-color: var(--emerald-500);
}

.prompt-preview {
  background: #020503;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-family: monospace;
  font-size: 0.78rem;
  color: #a7f3d0;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Leaflet Custom Marker & Path Styling */
.custom-walker-icon {
  background: var(--emerald-500);
  border: 3px solid #ffffff;
  width: 18px !important;
  height: 18px !important;
  border-radius: 50%;
  box-shadow: 0 0 16px var(--emerald-500);
}

.custom-poi-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(18, 28, 23, 0.85);
  border: 2px solid var(--amber-500);
  border-radius: 50%;
  width: 32px !important;
  height: 32px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
