/* PaceCast - Visual Aesthetics & Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-base: #07090d;
  --bg-card: rgba(15, 20, 28, 0.88);
  --bg-card-hover: rgba(22, 30, 42, 0.95);
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-glow: rgba(16, 185, 129, 0.4);

  --accent-primary: #10b981;
  --accent-light: #34d399;
  --accent-lime: #06d6a0;
  --accent-foliage: #f59e0b;
  --accent-crimson: #f43f5e;
  --accent-blue: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.65);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Header & Live Grass Freedom Meter */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 2rem;
  background: rgba(7, 9, 13, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #10b981, #06d6a0);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #a7f3d0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
}

.header-meters {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.meter-box {
  background: var(--bg-card);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  text-align: right;
}

.meter-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.meter-val {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-light);
}

.grass-ratio-box {
  border-color: var(--border-glow);
  background: rgba(16, 185, 129, 0.08);
}

.grass-ratio-box .meter-val {
  color: #34d399;
}

/* Main Dashboard Grid */
.main-dashboard {
  display: grid;
  grid-template-columns: 330px 1fr 340px;
  gap: 1.25rem;
  padding: 1.25rem 2rem;
  max-width: 1720px;
  margin: 0 auto;
  height: calc(100vh - 76px);
}

@media (max-width: 1280px) {
  .main-dashboard {
    grid-template-columns: 310px 1fr;
    height: auto;
  }
  .column-right {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .main-dashboard {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* Glass Panels */
.panel-glass {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.panel-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.65rem;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-select, .form-input {
  background: rgba(9, 12, 18, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

/* Route Info Banner */
.route-badge-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
}

.route-badge-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 0.2rem;
}

.route-badge-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.route-badge-tag {
  display: inline-block;
  margin-top: 0.35rem;
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Action Buttons */
.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.btn-secondary {
  background: rgba(26, 34, 48, 0.8);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(40, 52, 72, 0.9);
  border-color: var(--accent-light);
}

.btn-danger {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: white;
  border: none;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 700;
  cursor: pointer;
}

/* Center Map & 3D Viewport */
.column-center {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.view-mode-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view-tabs {
  display: flex;
  gap: 0.5rem;
}

.tab-btn {
  background: rgba(18, 24, 34, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-primary);
  color: #34d399;
}

.map-container {
  flex: 1;
  min-height: 420px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  position: relative;
  box-shadow: var(--shadow-card);
  background: #07090d;
}

#map {
  width: 100%;
  height: 100%;
}

#trail-3d-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Elevation Canvas Card */
.elevation-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.95rem;
}

.elevation-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

#elevation-canvas {
  width: 100%;
  height: 55px;
  display: block;
}

/* Map Markers */
.custom-pin .pin-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.start-badge {
  background: #10b981;
  color: #000;
}

.km-badge {
  background: #f59e0b;
  color: #000;
}

.runner-pin .runner-dot {
  width: 18px;
  height: 18px;
  background: #38bdf8;
  border: 3px solid #ffffff;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 15px #38bdf8;
}

.runner-pulse {
  position: absolute;
  width: 32px;
  height: 32px;
  left: -10px;
  top: -10px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.4);
  animation: pulse-ring 1.5s infinite ease-out;
}

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

/* Live Telemetry Card */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.telemetry-cell {
  background: rgba(9, 12, 18, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.45rem;
  text-align: center;
}

.cell-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  display: block;
}

.cell-val {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Live Soundwave Bar */
.soundwave-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(9, 12, 18, 0.6);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  height: 38px;
}

.soundwave-bar .bar {
  width: 3px;
  height: 8px;
  background: #10b981;
  border-radius: 2px;
  transition: height 0.15s ease;
}

.soundwave-bar.speaking .bar {
  background: #38bdf8;
  animation: soundwave 0.6s infinite ease-in-out alternate;
}

.soundwave-bar.speaking .bar:nth-child(1) { animation-delay: 0.05s; }
.soundwave-bar.speaking .bar:nth-child(2) { animation-delay: 0.15s; }
.soundwave-bar.speaking .bar:nth-child(3) { animation-delay: 0.25s; }
.soundwave-bar.speaking .bar:nth-child(4) { animation-delay: 0.35s; }
.soundwave-bar.speaking .bar:nth-child(5) { animation-delay: 0.2s; }
.soundwave-bar.speaking .bar:nth-child(6) { animation-delay: 0.1s; }
.soundwave-bar.speaking .bar:nth-child(7) { animation-delay: 0.3s; }
.soundwave-bar.speaking .bar:nth-child(8) { animation-delay: 0.4s; }

@keyframes soundwave {
  0% { height: 6px; }
  100% { height: 26px; }
}

.soundwave-label {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Audio Transcript Drawer */
.transcript-drawer {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.transcript-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow-y: auto;
  max-height: 310px;
  padding-right: 4px;
}

.transcript-item {
  background: rgba(9, 12, 18, 0.6);
  border-left: 3px solid var(--accent-primary);
  border-radius: 4px;
  padding: 0.5rem 0.7rem;
  animation: fadeIn 0.3s ease;
}

.transcript-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--accent-light);
  margin-bottom: 0.15rem;
  font-weight: 600;
}

.transcript-text {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.35;
}

.anti-screen-banner {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid var(--border-glow);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Pocket Mode Overlay (Anti-Screen Experience) */
/* Pocket Mode Overlay (High-End Athletic AMOLED HUD) */
.pocket-mode-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 32%, #0a141a 0%, #050b0f 50%, #010406 100%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 2.2rem 1.75rem;
  overflow-y: auto;
  user-select: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pocket-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 580px;
  gap: 1rem;
}

.pocket-badge-glow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
  color: #34d399;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.pulsing-emerald-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: emeraldBlink 1.4s infinite ease-in-out;
}

@keyframes emeraldBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.pocket-freedom-chip {
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: #fb923c;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: var(--font-heading);
}

/* Hero Center Gauge */
.pocket-hero-gauge {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 1.5rem auto 1rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pocket-progress-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pocket-track-circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 10;
}

.pocket-fill-circle {
  fill: none;
  stroke: url(#pocketRingGrad);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 741.4;
  stroke-dashoffset: 741.4;
  transition: stroke-dashoffset 0.6s ease;
  filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.5));
}

.pocket-gauge-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 2;
}

.pocket-metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #64748b;
  margin-bottom: -0.2rem;
}

.pocket-distance-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem;
}

.pocket-dist-num {
  font-family: var(--font-heading);
  font-size: 4.8rem;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  letter-spacing: -2px;
  text-shadow: 0 0 28px rgba(255, 255, 255, 0.2);
}

.pocket-dist-unit {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #10b981;
}

.pocket-target-pill {
  font-size: 0.78rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  margin-top: 0.4rem;
}

/* Telemetry Glass Grid */
.pocket-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
}

.pocket-telemetry-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 1.1rem 0.8rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.pocket-telemetry-card.highlight-card {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.04);
}

.pocket-card-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.35rem;
}

.pocket-card-val {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  display: block;
  margin-bottom: 0.25rem;
}

.pocket-card-sub {
  font-size: 0.72rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Audio Status Strip */
.pocket-audio-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 580px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 0.7rem 1.25rem;
  margin: 1.25rem auto 0 auto;
}

.pocket-soundtrack-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pocket-soundwave-anim {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.pocket-soundwave-anim span {
  width: 3px;
  height: 6px;
  background: #f97316;
  border-radius: 2px;
  animation: pocketEqualize 1.2s infinite ease-in-out;
}

.pocket-soundwave-anim span:nth-child(2) { animation-delay: 0.2s; }
.pocket-soundwave-anim span:nth-child(3) { animation-delay: 0.4s; }
.pocket-soundwave-anim span:nth-child(4) { animation-delay: 0.1s; }

@keyframes pocketEqualize {
  0%, 100% { height: 4px; }
  50% { height: 16px; }
}

.pocket-track-lead {
  font-size: 0.75rem;
  color: #64748b;
  margin-right: 0.25rem;
}

.pocket-track-name {
  font-size: 0.82rem;
  color: #f8fafc;
  font-weight: 600;
}

.pocket-coach-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #38bdf8;
  font-weight: 500;
}

/* Bottom Actions */
.pocket-bottom-bar {
  text-align: center;
  width: 100%;
  max-width: 580px;
  margin-top: 1.5rem;
}

.pocket-hint-text {
  font-size: 0.78rem;
  color: #475569;
  margin-bottom: 0.75rem;
}

.btn-pocket-unlock {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.15);
  color: #f8fafc;
  padding: 0.85rem 2.2rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-pocket-unlock:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.3);
}

/* Custom Music Volume Slider */
input[type="range"]#music-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  transition: background 0.2s;
}

input[type="range"]#music-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-orange);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
  transition: transform 0.15s ease, background 0.15s ease;
}

input[type="range"]#music-volume::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: #fb923c;
}

.hidden {
  display: none !important;
}
