/* ==========================================================
   DASHBOARD CINEMATIC — sector flag bar, inline weather widget,
   AI co-pilot. Activates only on body.dashboard-page.
   Driver-card system is never targeted.
   ========================================================== */

/* ── Sector flag bar (top hairline strip) ─────────────── */
body.dashboard-page #dc-sector-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  z-index: 99996;
  pointer-events: none;
  background: rgba(0,0,0,0.4);
}
body.dashboard-page #dc-sector-bar .dc-sec {
  position: relative;
  background: rgba(255,255,255,0.04);
  transition: background .35s ease, box-shadow .35s ease;
}
body.dashboard-page #dc-sector-bar .dc-sec.green {
  background: linear-gradient(90deg, rgba(0,230,160,0.7), rgba(0,230,160,0.4));
  box-shadow: 0 0 14px rgba(0,230,160,0.55);
}
body.dashboard-page #dc-sector-bar .dc-sec.purple {
  background: linear-gradient(90deg, rgba(217,0,255,0.85), rgba(255,80,200,0.5));
  box-shadow: 0 0 18px rgba(217,0,255,0.65);
}
body.dashboard-page #dc-sector-bar .dc-sec.yellow {
  background: linear-gradient(90deg, rgba(255,216,74,0.85), rgba(255,180,0,0.5));
  box-shadow: 0 0 14px rgba(255,216,74,0.55);
}

/* ── Inline weather widget — sits in the chart column ──
   Designed to read at a glance: bright values, color-coded
   condition pill, no flex collapse. */
body.dashboard-page .dc-weather-inline {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0 !important;
  min-height: 78px;
  margin: 4px 0 10px !important;
  padding: 10px 14px !important;
  background:
    linear-gradient(180deg, rgba(28,30,40,0.78), rgba(14,16,22,0.86)) !important;
  border: 1px solid rgba(0,230,240,0.18) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 14px 30px -22px rgba(0,0,0,0.6),
    0 0 0 1px rgba(0,230,240,0.04) !important;
  position: relative;
  overflow: visible !important;
}
body.dashboard-page .dc-weather-inline::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,230,240,0.55), transparent);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
body.dashboard-page .dc-weather-inline .dc-w-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
}
body.dashboard-page .dc-weather-inline .dc-w-lbl {
  font-family: 'JetBrains Mono', 'Geist Mono', monospace;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--rd-accent, #00f2ff);
  flex: 1;
  display: inline-flex; align-items: center; gap: 8px;
}
body.dashboard-page .dc-weather-inline .dc-w-lbl::before {
  content: "\eb95"; /* boxicons cloud-rain */
  font-family: 'boxicons';
  font-size: 14px;
  color: var(--rd-accent, #00f2ff);
  letter-spacing: 0;
  opacity: .9;
}
body.dashboard-page .dc-weather-inline .dc-w-pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: #00e6a0;
  box-shadow: 0 0 0 0 rgba(0,230,160,0.6);
  animation: mu-pulse-ring 2s ease-out infinite;
}
body.dashboard-page .dc-weather-inline .dc-w-status {
  font-family: 'JetBrains Mono', 'Geist Mono', monospace;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,230,160,0.14);
  color: #00e6a0;
  border: 1px solid rgba(0,230,160,0.35);
}
body.dashboard-page .dc-weather-inline .dc-w-status.damp {
  background: rgba(255,216,74,0.14);
  color: #ffd84a;
  border-color: rgba(255,216,74,0.35);
}
body.dashboard-page .dc-weather-inline .dc-w-status.wet {
  background: rgba(0,180,255,0.16);
  color: #00b4ff;
  border-color: rgba(0,180,255,0.4);
}
body.dashboard-page .dc-weather-inline .dc-w-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px;
  flex-shrink: 0;
}
body.dashboard-page .dc-weather-inline .dc-w-cell {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  padding: 8px 10px;
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 44px;
}
body.dashboard-page .dc-weather-inline .dc-w-k {
  font-family: 'JetBrains Mono', 'Geist Mono', monospace;
  font-size: 8px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: #9ea2ad;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
body.dashboard-page .dc-weather-inline .dc-w-k i {
  font-size: 12px; color: var(--rd-accent, #00f2ff);
  flex-shrink: 0;
}
body.dashboard-page .dc-weather-inline .dc-w-v {
  font-family: 'JetBrains Mono', 'Geist Mono', monospace;
  font-size: 15px; font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-shadow: 0 0 16px rgba(0,230,240,0.18);
}

@media (max-width: 720px) {
  body.dashboard-page .dc-weather-inline .dc-w-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ── AI Co-pilot floating button ──────────────────────── */
body.dashboard-page #dc-copilot-btn {
  position: fixed;
  bottom: 24px; left: 24px;
  z-index: 99993;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,230,240,0.25), rgba(180,90,255,0.18));
  border: 1px solid rgba(0,230,240,0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 22px;
  color: #fff;
  box-shadow:
    0 0 0 0 rgba(0,230,240,0.5),
    0 18px 40px -16px rgba(0,230,240,0.5);
  transition: transform .25s ease, box-shadow .25s ease;
  animation: dc-copilot-pulse 3.4s ease-in-out infinite;
}
body.dashboard-page #dc-copilot-btn.active { display: flex; }
body.dashboard-page #dc-copilot-btn:hover {
  transform: scale(1.06);
  box-shadow:
    0 0 0 6px rgba(0,230,240,0.1),
    0 22px 50px -16px rgba(0,230,240,0.6);
}
@keyframes dc-copilot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,230,240,0.4), 0 18px 40px -16px rgba(0,230,240,0.5); }
  50%      { box-shadow: 0 0 0 12px rgba(0,230,240,0.0), 0 22px 50px -16px rgba(0,230,240,0.6); }
}

/* ── Co-pilot side panel ──────────────────────────────── */
body.dashboard-page #dc-copilot-panel {
  position: fixed;
  bottom: 90px; left: 24px;
  width: min(360px, calc(100vw - 48px));
  max-height: 60vh;
  background: linear-gradient(180deg, rgba(14,16,22,0.95), rgba(8,10,14,0.95));
  border: 1px solid rgba(0,230,240,0.2);
  border-radius: 18px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99992;
  display: none;
  flex-direction: column;
  font-family: 'Geist', sans-serif;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 30px 70px -22px rgba(0,0,0,0.85),
    0 0 0 1px rgba(0,230,240,0.06);
  overflow: hidden;
}
body.dashboard-page #dc-copilot-panel.open {
  display: flex;
  animation: rd-modal-in .26s cubic-bezier(.2,.8,.2,1) both;
}
body.dashboard-page #dc-copilot-panel .dc-cp-head {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 10px;
}
body.dashboard-page #dc-copilot-panel .dc-cp-head h3 {
  font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  margin: 0;
}
body.dashboard-page #dc-copilot-panel .dc-cp-head .pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #00e6a0; box-shadow: 0 0 0 0 rgba(0,230,160,0.6);
  animation: mu-pulse-ring 2s ease-out infinite;
}
body.dashboard-page #dc-copilot-panel .dc-cp-body {
  flex: 1; overflow-y: auto; padding: 18px;
  font-size: 12px; line-height: 1.55;
  color: var(--rd-text-dim, #8a8d96);
}
body.dashboard-page #dc-copilot-panel .dc-cp-msg {
  background: rgba(0,230,240,0.06);
  border: 1px solid rgba(0,230,240,0.15);
  padding: 10px 12px; border-radius: 12px;
  margin-bottom: 10px;
  color: #fff;
  font-size: 12px; line-height: 1.5;
}
body.dashboard-page #dc-copilot-panel .dc-cp-foot {
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-family: 'Geist Mono', monospace;
  font-size: 9px;
  color: var(--rd-text-mute, #5a5d66);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  body.dashboard-page #dc-copilot-btn { animation: none !important; }
}

@media (max-width: 768px) {
  body.dashboard-page #dc-copilot-btn { width: 48px; height: 48px; bottom: 80px; left: 12px; font-size: 18px; }
  body.dashboard-page #dc-copilot-panel { left: 12px; bottom: 138px; }
}
