/* Meteorology News & Weather Dispatch Styling */

html {
  background-color: #f8fafc;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #2c3e50;
  background-color: transparent;
  min-height: 100vh;
}

/* Meteorological Wind & Cloud Canvas Layer */
#weather-bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  display: block;
}

/* Hide default Quarto title block in favor of custom encased masthead */
#title-block-header {
  display: none !important;
}

/* News Masthead Banner */
.news-header {
  background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
  color: #ffffff;
  padding: 2.5rem 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.news-badge {
  display: inline-block;
  background-color: #e63946;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.news-station-tag {
  color: #90caf9;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  font-family: monospace;
}

/* 10-Year Record Stat Cards */
.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem 0;
}

.record-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.record-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.record-icon {
  font-size: 1.75rem;
  margin-bottom: 0.4rem;
}

.record-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
}

.record-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-top: 0.25rem;
}

.record-event {
  font-size: 0.75rem;
  color: #d32f2f;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* News Article Card Container for Graphs */
.news-chart-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.75rem;
  margin: 2rem 0 3rem 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.news-section-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #0288d1;
  margin-bottom: 0.35rem;
}

.news-lede {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 1.25rem;
}

/* Metric Key Stats Callout Row */
.stat-highlight-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1rem 0 1.25rem 0;
  padding: 0.9rem 1.25rem;
  background-color: #f1f5f9;
  border-left: 4px solid #0288d1;
  border-radius: 8px;
}

.stat-badge-item {
  flex: 1 1 200px;
}

.stat-badge-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.stat-badge-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}


/* Title-Triggered Auto-Draw Graph Animation */
.scroll-graph {
  position: relative;
  width: 100%;
  overflow: hidden;
  clip-path: inset(0 100% 0 0);
  -webkit-clip-path: inset(0 100% 0 0);
  transition: clip-path 3.25s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: clip-path;
}

.scroll-graph.drawn {
  clip-path: inset(0 0% 0 0);
  -webkit-clip-path: inset(0 0% 0 0);
}

/* Disaster Dossier Table Styling */
.disaster-table-container {
  overflow-x: auto;
  margin-top: 1.5rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.disaster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: #ffffff;
}

.disaster-table th {
  background: #1e293b;
  color: #ffffff;
  padding: 0.9rem 1rem;
  text-align: left;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.disaster-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.disaster-table tr:hover {
  background-color: #f8fafc;
}

.disaster-badge-cyclone {
  background-color: #fee2e2;
  color: #991b1b;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  display: inline-block;
}

.disaster-badge-freeze {
  background-color: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  display: inline-block;
}

.telemetry-val {
  font-weight: 700;
  color: #0f172a;
}

/* Live Telemetry Panel */
.live-telemetry-box {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  color: #f8fafc;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  border: 1px solid #334155;
}

.live-telemetry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background-color: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
}

.live-pulse-dot {
  width: 9px;
  height: 9px;
  background-color: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulse-red 1.8s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

.live-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1.15rem 0.85rem;
  text-align: center;
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: scale(0.35) translateY(40px);
  will-change: transform, opacity, box-shadow;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.live-card.popped {
  animation: liveCardBubbleUp 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.live-card.popped:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 10px 24px rgba(56, 189, 248, 0.3);
  border-color: rgba(56, 189, 248, 0.5);
}

@keyframes liveCardBubbleUp {
  0% {
    opacity: 0;
    transform: scale(0.35) translateY(40px);
    box-shadow: 0 0 0 rgba(56, 189, 248, 0);
  }
  60% {
    opacity: 1;
    transform: scale(1.09) translateY(-6px);
    box-shadow: 0 12px 28px rgba(56, 189, 248, 0.35);
  }
  80% {
    transform: scale(0.97) translateY(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-card {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

.live-card-icon {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.live-card-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.2rem;
}

.live-card-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.live-card-sub {
  font-size: 0.72rem;
  color: #cbd5e1;
  margin-top: 0.4rem;
  line-height: 1.35;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

.live-refresh-btn {
  background: #334155;
  color: #f1f5f9;
  border: 1px solid #475569;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.live-refresh-btn:hover {
  background: #475569;
  border-color: #64748b;
}

/* ==========================================================================
   Interactive Graph Scroll & Pop-in Animations
   ========================================================================== */

/* Hardware acceleration for SVG chart layers */
.plotly .scatterlayer path.js-line {
  will-change: stroke-dashoffset;
}

.plotly .scatterlayer path.point,
.plotly .infolayer .annotation {
  will-change: transform, opacity;
}

/* Pending initial scroll-in */
.plotly-scroll-pending .scatterlayer .lines path.js-line {
  opacity: 0;
}

.plotly-scroll-pending .scatterlayer .points path.point,
.plotly-scroll-pending .infolayer .annotation,
.plotly-scroll-pending .shapelayer path {
  opacity: 0;
}

/* ==========================================================================
   Leaflet Map Styling & Hover Tooltip Clarity
   ========================================================================== */
.leaflet-container {
  font-family: inherit;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  border: 1px solid #cbd5e1;
}

.leaflet-tile {
  filter: none !important;
}

.leaflet-tooltip {
  font-size: 13px !important;
  color: #1e293b !important;
  background-color: #ffffff !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18) !important;
  border: 1px solid #cbd5e1 !important;
  padding: 10px 14px !important;
  line-height: 1.45 !important;
}

/* ==========================================================================
   Meteorology Radar Navbar Styling
   ========================================================================== */
.navbar {
  position: relative !important;
  background: #030d17 !important;
  overflow: visible !important;
  border-bottom: 2px solid rgba(34, 197, 94, 0.4) !important;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(16, 185, 129, 0.2) !important;
}

.navbar .dropdown-menu {
  background-color: #0b192c !important;
  border: 1px solid rgba(34, 197, 94, 0.3) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
  z-index: 1050 !important;
  padding: 0.5rem 0 !important;
}

.navbar .dropdown-item {
  color: #e2e8f0 !important;
  padding: 0.5rem 1.25rem !important;
  font-size: 0.9rem !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  background-color: rgba(34, 197, 94, 0.2) !important;
  color: #38bdf8 !important;
}

#navbar-radar-canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

.navbar .container-fluid,
.navbar .navbar-container {
  position: relative !important;
  z-index: 5 !important;
}

.navbar .navbar-brand {
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.5) !important;
}

.navbar .nav-link {
  color: #f1f5f9 !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  border-radius: 6px !important;
  padding: 0.35rem 0.75rem !important;
  margin: 0 2px !important;
}

.navbar .nav-link:hover {
  color: #86efac !important;
  background: rgba(34, 197, 94, 0.18) !important;
  text-shadow: 0 0 10px rgba(134, 239, 172, 0.8) !important;
}

.navbar .nav-link.active {
  color: #ffffff !important;
  background: rgba(34, 197, 94, 0.28) !important;
  border-bottom: 2px solid #22c55e !important;
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.9) !important;
}

.navbar-toggler {
  border-color: rgba(34, 197, 94, 0.5) !important;
  color: #86efac !important;
}


