/**
 * Tesla POI & News Browser App - Main Stylesheet
 * Material 3 Automotive Design System
 */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Roboto:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24..48,400..600,0..1,0');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  font-family: 'Google Sans', 'Roboto', system-ui, -apple-system, sans-serif;
  touch-action: manipulation;
}

/* App Container */
#app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--md-sys-color-background);
}

/* =========================================================
   1. HERO CANVAS, BACKDROP & COLLAGE SHOWCASE
   ========================================================= */
.stage-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

/* Ambient blurred backdrop behind the collage */
.stage-backdrop {
  position: absolute;
  top: -8%;
  left: -8%;
  width: 116%;
  height: 116%;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.6);
  transform: scale(1.05);
  transition: background-image 0.8s ease;
  z-index: 1;
}

[data-theme='light'] .stage-backdrop {
  filter: blur(28px) brightness(0.9);
}

[data-theme='oled'] .stage-backdrop {
  filter: blur(32px) brightness(0.4);
}

/* Collage Showcase in Main Window */
.stage-collage {
  position: absolute;
  top: 76px;
  bottom: 215px;
  left: 24px;
  right: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity 0.5s ease;
}

.collage-grid {
  width: 100%;
  height: 100%;
  max-width: 1540px;
  display: grid;
  gap: 16px;
  transition: all 0.5s cubic-bezier(0.2, 0, 0, 1);
}

/* 1 Photo: Full Hero */
.collage-grid.collage-1 {
  grid-template-columns: 1fr;
}

/* 2 Photos: Split Hero */
.collage-grid.collage-2 {
  grid-template-columns: 1.35fr 0.95fr;
}

/* 3 Photos: Bento (Hero Left + 2 Stacked Right) */
.collage-grid.collage-3 {
  grid-template-columns: 1.4fr 1fr;
}

/* 4 Photos: Bento (Hero Left + 3 Stacked Right) */
.collage-grid.collage-4 {
  grid-template-columns: 1.35fr 1fr;
}

.collage-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.collage-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
}

.collage-item {
  position: relative;
  border-radius: var(--md-sys-shape-corner-extra-large);
  overflow: hidden;
  background-size: cover;
  background-position: center 38%; /* Golden-ratio focal point for food dishes, bowls & venues */
  background-repeat: no-repeat;
  background-color: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.35s ease;
  will-change: transform;
}

/* Subtle focal vignette so food & architecture fit naturally without harsh clipping */
.collage-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center 38%, transparent 50%, rgba(0, 0, 0, 0.28) 100%),
              linear-gradient(to bottom, rgba(0, 0, 0, 0.15) 0%, transparent 20%, transparent 80%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
  z-index: 1;
}

.collage-item.is-review::before {
  display: none;
}

.collage-item:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.65);
  z-index: 4;
}

.collage-item.ken-burns {
  animation: kenBurnsMotion 24s ease-in-out infinite alternate;
}

.collage-hero {
  flex: 1;
  height: 100%;
}

/* =========================================================
   BENTO COLLAGE: HIGH-CONTRAST SUMMATIVE REVIEW CARD
   ========================================================= */
.collage-review-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 26px;
  background: rgba(13, 17, 24, 0.94);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  color: #ffffff;
  overflow: hidden;
  z-index: 2;
  box-sizing: border-box;
}

[data-theme='light'] .collage-review-card {
  background: rgba(248, 250, 252, 0.97);
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

[data-theme='oled'] .collage-review-card {
  background: rgba(4, 6, 8, 0.98);
  border-color: rgba(255, 255, 255, 0.25);
}

.review-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.review-card-stars {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-star-rating {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffb74d;
  letter-spacing: -0.01em;
}

.review-star-icons {
  color: #ffb74d;
  font-size: 1.15rem;
  letter-spacing: 2px;
}

.review-count-badge {
  font-size: 0.82rem;
  opacity: 0.85;
  font-weight: 500;
}

.review-engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(138, 180, 248, 0.18);
  color: #8ab4f8;
  border: 1px solid rgba(138, 180, 248, 0.32);
  letter-spacing: 0.02em;
}

[data-theme='light'] .review-engine-pill {
  background: rgba(26, 115, 232, 0.12);
  color: #1a73e8;
  border-color: rgba(26, 115, 232, 0.25);
}

.review-quote-body {
  position: relative;
  margin: 0 0 14px 0;
  font-size: 1.08rem;
  line-height: 1.5;
  font-weight: 500;
  color: #ffffff;
  font-style: normal;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

[data-theme='light'] .review-quote-body {
  color: #0f172a;
  text-shadow: none;
}

.review-quote-body::before {
  content: '“';
  font-size: 2rem;
  line-height: 1;
  font-family: Georgia, serif;
  color: #ffb74d;
  margin-right: 4px;
  vertical-align: -0.15em;
}

.review-quote-body::after {
  content: '”';
  font-size: 2rem;
  line-height: 1;
  font-family: Georgia, serif;
  color: #ffb74d;
  margin-left: 4px;
  vertical-align: -0.15em;
}

.review-card-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.review-must-try-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(255, 145, 0, 0.18);
  color: #ffb74d;
  border: 1px solid rgba(255, 145, 0, 0.35);
  width: fit-content;
}

[data-theme='light'] .review-must-try-pill {
  background: rgba(230, 81, 0, 0.12);
  color: #c2410c;
  border-color: rgba(230, 81, 0, 0.28);
}

.review-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.review-tag-chip {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

[data-theme='light'] .review-tag-chip {
  background: rgba(0, 0, 0, 0.07);
  color: #334155;
}

.stage-layer {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  background-size: cover;
  background-position: center center;
  opacity: 0;
  transform: scale(1);
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity;
}

.stage-layer.active {
  opacity: 1;
}

.stage-layer.active.ken-burns {
  animation: kenBurnsMotion 24s ease-in-out infinite alternate;
}

@keyframes kenBurnsMotion {
  0% {
    transform: scale(1) translate(0%, 0%);
  }
  50% {
    transform: scale(1.08) translate(-1.5%, 1%);
  }
  100% {
    transform: scale(1.04) translate(1.5%, -1%);
  }
}

/* Cinema Gradient Overlay for Readability */
.stage-scrim {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(17, 19, 24, 0.75) 0%,
    rgba(17, 19, 24, 0.15) 30%,
    rgba(17, 19, 24, 0.2) 60%,
    rgba(17, 19, 24, 0.85) 85%,
    rgba(17, 19, 24, 0.98) 100%
  );
}

[data-theme='light'] .stage-scrim {
  background: linear-gradient(
    to bottom,
    rgba(253, 252, 255, 0.85) 0%,
    rgba(253, 252, 255, 0.2) 30%,
    rgba(253, 252, 255, 0.25) 60%,
    rgba(253, 252, 255, 0.88) 85%,
    rgba(253, 252, 255, 0.98) 100%
  );
}

[data-theme='oled'] .stage-scrim {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.2) 30%,
    rgba(0, 0, 0, 0.25) 60%,
    rgba(0, 0, 0, 0.9) 85%,
    rgba(0, 0, 0, 1) 100%
  );
}

/* =========================================================
   6. SUNK BOTTOM DOCK & CONSOLE
   ========================================================= */
.bottom-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px 14px 24px;
  pointer-events: none;
}

/* Trip Demo Floating Banner */
.demo-trip-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 920px;
  margin: 0 auto 8px auto;
  padding: 8px 20px;
  border-radius: var(--md-sys-shape-corner-full);
  background: rgba(11, 87, 208, 0.9);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(11, 87, 208, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.3s ease;
}

.demo-trip-bar.active {
  display: flex;
}

.demo-trip-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.demo-trip-progress-track {
  flex: 1;
  max-width: 240px;
  height: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  overflow: hidden;
}

.demo-trip-progress-fill {
  height: 100%;
  width: 0%;
  background: #ffffff;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Sunk POI Card Console at bottom edge */
.poi-card {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  background: rgba(29, 32, 36, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--md-sys-shape-corner-extra-large);
  padding: 16px 24px;
  box-shadow: var(--md-sys-elevation-level4);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.35s cubic-bezier(0.2, 0, 0, 1);
  text-align: left;
}

[data-theme='light'] .poi-card {
  background: rgba(247, 249, 254, 0.94);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme='oled'] .poi-card {
  background: rgba(12, 13, 16, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
}

.poi-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.poi-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.poi-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.poi-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.poi-badge.news {
  background: #f2b8b5;
  color: #601410;
}

.poi-badge.charger {
  background: #8ef7aa;
  color: #003919;
}

.poi-distance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.compass-arrow-icon {
  font-size: 16px;
  color: var(--md-sys-color-primary);
  transform-origin: center;
  transition: transform 0.6s ease;
}

/* Body row with title & extract on left, actions on right */
.poi-body-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.poi-text-col {
  flex: 1;
  min-width: 0;
}

.poi-title {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.poi-extract {
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--md-sys-color-on-surface-variant);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
}

.poi-actions-col {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Sunk integrated playback row inside the card */
.poi-dock-playback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
  margin-top: 2px;
}

/* =========================================================
   2. UI OVERLAYS & AUTO-HIDE THEATER MODE
   ========================================================= */
.ui-overlay {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 24px 20px 24px;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.interactive {
  pointer-events: auto;
}

/* Persistent Info Card & Sunk Console Dock (Never auto fades) */
.bottom-dock,
.poi-card {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

body.theater-mode .bottom-dock,
body.theater-mode .poi-card {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Subtle dimming only applies to top nav bar when idle */
body.theater-mode header.top-bar.ui-fade {
  opacity: 0.25;
  transition: opacity 1.2s ease;
}

body.theater-mode header.top-bar.ui-fade:hover,
body.theater-mode header.top-bar.ui-fade:active {
  opacity: 1;
}

/* =========================================================
   3. TOP AUTOMOTIVE APP BAR (MATERIAL 3)
   ========================================================= */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  padding: 8px 16px;
  border-radius: var(--md-sys-shape-corner-full);
  box-shadow: var(--md-sys-elevation-level1);
  border: 1px solid var(--md-sys-color-outline-variant);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand-logo-pill .tesla-icon {
  color: #e82127; /* Tesla Red Accent */
  font-size: 20px;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m3-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--md-sys-shape-corner-full);
  background: rgba(29, 32, 36, 0.75);
  color: var(--md-sys-color-on-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.2s ease;
  cursor: pointer;
}

.m3-pill:active {
  transform: scale(0.97);
}

.m3-pill.highlight {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clock-display {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  background: rgba(29, 32, 36, 0.6);
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   4. MATERIAL 3 BUTTONS & ICON BUTTONS
   ========================================================= */
.m3-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  cursor: pointer;
  transition: all 0.2s var(--md-sys-motion-easing-standard);
  backdrop-filter: blur(12px);
  outline: none;
}

.m3-icon-btn:hover {
  background: var(--md-sys-color-surface-container-high);
  transform: translateY(-1px);
}

.m3-icon-btn:active {
  transform: scale(0.94);
  background: var(--md-sys-color-surface-container-highest);
}

.m3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--md-sys-shape-corner-full);
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--md-sys-motion-easing-standard);
  outline: none;
}

.m3-btn-filled {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-level2);
}

.m3-btn-filled:hover {
  box-shadow: var(--md-sys-elevation-level3);
  filter: brightness(1.05);
}

.m3-btn-filled:active {
  transform: scale(0.97);
}

.m3-btn-tonal {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.m3-btn-tonal:hover {
  filter: brightness(1.08);
}

.m3-btn-tonal:active {
  transform: scale(0.97);
}

.m3-btn-outlined {
  background: transparent;
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline);
}

/* "I'm Feeling Lucky" Sparkle Button */
.m3-lucky-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--md-sys-shape-corner-full);
  background: linear-gradient(135deg, #a8c7fa 0%, #d3e3fd 50%, #7fcfff 100%);
  color: #041e49;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(168, 199, 250, 0.35);
  transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.m3-lucky-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(168, 199, 250, 0.45);
}

.m3-lucky-btn:active {
  transform: scale(0.96);
}

.m3-lucky-btn .material-symbols-outlined {
  font-size: 22px;
  animation: pulseRotate 4s linear infinite;
}

@keyframes pulseRotate {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

/* =========================================================
   5. M3 CATEGORY FILTER CHIPS BAR
   ========================================================= */
.category-filter-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none; /* Hide scrollbar for clean automotive UI */
  -ms-overflow-style: none;
}

.category-filter-row::-webkit-scrollbar {
  display: none;
}

.m3-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-corner-small);
  border-radius: 12px;
  background: rgba(29, 32, 36, 0.85);
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s var(--md-sys-motion-easing-standard);
  backdrop-filter: blur(12px);
}

.m3-chip .chip-icon {
  font-size: 18px;
}

.m3-chip .chip-check {
  font-size: 18px;
  display: none;
}

.m3-chip:hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.m3-chip.selected {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
  font-weight: 600;
}

.m3-chip.selected .chip-check {
  display: inline-block;
}

.m3-chip.selected .chip-icon {
  display: none;
}

/* Settings Category Selection Grid */
.settings-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.settings-chips-grid .m3-chip {
  height: 44px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-corner-medium);
}

/* Playback Control Deck */
.playback-deck {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(29, 32, 36, 0.85);
  padding: 8px 16px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
}

.circular-timer-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circular-timer-svg {
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}

.circular-timer-bg {
  stroke: rgba(255, 255, 255, 0.15);
  fill: none;
  stroke-width: 3.5;
}

.circular-timer-bar {
  stroke: var(--md-sys-color-primary);
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear;
}

.circular-timer-seconds {
  position: absolute;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

/* Quick Interval Switcher */
.interval-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(29, 32, 36, 0.85);
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
}

.interval-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--md-sys-color-outline);
  margin-right: 4px;
}

.interval-chip {
  padding: 5px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  border: none;
  transition: all 0.2s ease;
}

.interval-chip:hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.interval-chip.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

/* Queue Counter / Index */
.deck-counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--md-sys-color-outline);
  padding: 6px 12px;
  background: rgba(29, 32, 36, 0.7);
  border-radius: var(--md-sys-shape-corner-full);
}

/* =========================================================
   8. MATERIAL 3 MODAL DIALOGS (SETTINGS & SIMULATOR)
   ========================================================= */
.m3-dialog-scrim {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.m3-dialog-scrim.visible {
  opacity: 1;
  pointer-events: auto;
}

.m3-dialog {
  width: 90%;
  max-width: 620px;
  max-height: 85vh;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: var(--md-sys-elevation-level4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.m3-dialog-scrim.visible .m3-dialog {
  transform: scale(1);
}

.m3-dialog-header {
  padding: 24px 28px 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m3-dialog-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 700;
}

.m3-dialog-body {
  padding: 0 28px 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.setting-desc {
  font-size: 0.82rem;
  color: var(--md-sys-color-outline);
}

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

/* M3 Switch / Toggle */
.m3-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 32px;
}

.m3-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.m3-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--md-sys-color-surface-variant);
  border: 2px solid var(--md-sys-color-outline);
  border-radius: 34px;
  transition: .3s;
}

.m3-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 5px;
  bottom: 5px;
  background-color: var(--md-sys-color-outline);
  border-radius: 50%;
  transition: .3s;
}

.m3-switch input:checked + .m3-slider {
  background-color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}

.m3-switch input:checked + .m3-slider:before {
  transform: translateX(20px);
  background-color: var(--md-sys-color-on-primary);
  width: 22px;
  height: 22px;
  bottom: 3px;
  left: 4px;
}

/* Preset Location Grid */
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.city-pill {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.city-pill:hover {
  background: var(--md-sys-color-surface-container-highest);
}

.city-pill.active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: transparent;
  font-weight: 600;
}

/* M3 Range Slider */
.m3-range-input {
  width: 100%;
  accent-color: var(--md-sys-color-primary);
  height: 6px;
  border-radius: 4px;
  cursor: pointer;
}

.m3-dialog-actions {
  padding: 16px 28px 24px 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Toast Notifications */
.m3-snackbar {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  padding: 12px 24px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--md-sys-elevation-level3);
  z-index: 2000;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0, 0, 0.2, 1), opacity 0.3s ease;
  pointer-events: none;
}

.m3-snackbar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Responsive adjustments for vertical/smaller screens */
@media (max-width: 1024px) {
  .poi-card {
    max-width: 100%;
    padding: 18px 20px;
  }
  .poi-title {
    font-size: 1.6rem;
  }
  .demo-trip-bar {
    max-width: 100%;
  }
}
