/* 
 * Live Wind Dashboard - Premium Light Theme Stylesheet
 * Fonts: Outfit (headings/metrics), Inter (body/UI)
 */

:root {
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  
  /* Text Colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  /* Wind Speed Accent (Sky Blue) */
  --color-speed: #0284c7;
  --color-speed-light: #e0f2fe;
  --color-speed-dark: #0369a1;
  
  /* Wind Gust Accent (Amber/Orange Warning) */
  --color-gust: #f97316;
  --color-gust-light: #ffedd5;
  --color-gust-dark: #c2410c;
  
  /* UI Helpers */
  --color-success: #10b981;
  --color-success-bg: #d1fae5;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.04), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-premium: 0 20px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-round: 50%;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  overflow-y: scroll;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 40px;
}

/* ==========================================================================
   Header Section
   ========================================================================== */
.app-header {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Navigation Menu in Header */
.header-nav {
  display: flex;
  gap: 8px;
  background-color: #f1f5f9;
  padding: 4px;
  border-radius: 99px;
  border: 1px solid var(--border-color);
}

.nav-link {
  text-decoration: none;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 99px;
  transition: var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  background-color: #ffffff;
  color: var(--color-speed-dark);
  box-shadow: var(--shadow-sm);
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--color-speed-light);
  color: var(--color-speed);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px 0 rgba(2, 132, 199, 0.06);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.25px;
}

.brand-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-text .sub-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #f8fafc;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid var(--border-color);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: var(--radius-round);
  position: relative;
  will-change: transform;
  animation: pulse 2s infinite;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-round);
  background-color: inherit;
  animation: pulse-ring 2s cubic-bezier(0.25, 0, 0, 1) infinite;
  will-change: transform, opacity;
}

.status-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-refresh {
  width: 38px;
  height: 38px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-round);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.btn-refresh:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  transform: rotate(30deg);
}

.btn-refresh svg {
  width: 18px;
  height: 18px;
}

.unit-selector {
  display: flex;
  background-color: #f1f5f9;
  padding: 4px;
  border-radius: 99px;
  border: 1px solid var(--border-color);
}

.unit-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 99px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.unit-btn:hover {
  color: var(--text-primary);
}

.unit-btn.active {
  background-color: #ffffff;
  color: var(--color-speed-dark);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Dashboard Main Layout
   ========================================================================== */
.dashboard-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-grid {
  display: grid;
  gap: 24px;
}

.top-row {
  grid-template-columns: 420px 1fr;
}

.bottom-row {
  grid-template-columns: 1fr 420px;
}

/* Card Foundations */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.card:hover {
  box-shadow: var(--shadow-premium);
  transform: translateY(-2px);
}

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

.card-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-tag {
  font-size: 11px;
  font-weight: 700;
  background-color: var(--color-speed-light);
  color: var(--color-speed-dark);
  padding: 4px 10px;
  border-radius: 99px;
  text-transform: uppercase;
}

.card-tag-blue {
  background-color: #e0f2fe;
  color: #0369a1;
}

/* ==========================================================================
   Compass Card (Windrose)
   ========================================================================== */
.compass-card {
  align-items: stretch;
}

.compass-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  gap: 20px;
  padding: 10px 0;
}

.compass-container {
  position: relative;
  width: 250px;
  height: 250px;
}

.compass-svg {
  width: 100%;
  height: 100%;
}

.compass-ring-outer {
  fill: #f8fafc;
  stroke: var(--border-color);
  stroke-width: 1px;
}

.compass-ring-inner {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 1px;
}

.compass-ticks line {
  stroke: #cbd5e1;
  stroke-width: 1.5px;
}

.cardinal-label {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 14px;
  fill: var(--text-secondary);
  text-anchor: middle;
  dominant-baseline: central;
}

.cardinal-label.text-n {
  fill: var(--color-speed-dark);
  font-weight: 900;
}

.ordinal-label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 9px;
  fill: var(--text-muted);
  text-anchor: middle;
  dominant-baseline: central;
}

.compass-center-bg {
  fill: #ffffff;
  stroke: var(--border-color);
  stroke-width: 1px;
  filter: drop-shadow(0 4px 6px rgba(15, 23, 42, 0.04));
}

.compass-needle {
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.direction-details {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.direction-degrees {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.direction-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-speed-dark);
  background-color: var(--color-speed-light);
  padding: 4px 12px;
  border-radius: 99px;
  margin-top: 4px;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Metrics Stats Grid
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.metric-card {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metric-value-container {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 4px 0;
}

.metric-number {
  font-family: 'Outfit', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.metric-unit {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-subtext {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Special Warning State for Gust Card */
.gust-card {
  background: linear-gradient(135deg, #ffffff 0%, #fffcf9 100%);
  border-left: 4px solid var(--color-gust);
}

.gust-color-text {
  color: var(--color-gust-dark) !important;
}

/* Gauges Previews in Cards */
.gauge-preview {
  width: 64px;
  height: 64px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: #f1f5f9;
  stroke-width: 3.5px;
}

.gauge-fill {
  fill: none;
  stroke-width: 3.5px;
  stroke-linecap: round;
  transition: stroke-dasharray 0.8s ease-in-out;
}

.gauge-fill.speed-color {
  stroke: var(--color-speed);
}

.gauge-fill.gust-color {
  stroke: var(--color-gust);
}

.gauge-fill.max-color {
  stroke: #7c3aed; /* Purple for max value */
}

.gauge-fill.avg-color {
  stroke: #0d9488; /* Teal for average value */
}

.gauge-icon {
  position: absolute;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-icon svg {
  width: 100%;
  height: 100%;
}

.speed-icon { color: var(--color-speed); }
.gust-icon { color: var(--color-gust); }
.max-icon { color: #7c3aed; }
.avg-icon { color: #0d9488; }

/* ==========================================================================
   Trend Chart Card
   ========================================================================== */
.chart-card {
  flex-grow: 1;
}

.legend-indicators {
  display: flex;
  gap: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  align-self: center;
}

.speed-bg { background-color: var(--color-speed); }
.gust-bg { background-color: var(--color-gust); }

.chart-container {
  position: relative;
  height: 320px;
  width: 100%;
}

/* ==========================================================================
   Messwert-Verlauf / History Table
   ========================================================================== */
.history-card {
  align-self: stretch;
}

.table-wrapper {
  overflow-y: auto;
  max-height: 320px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #f8fafc;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.history-table th {
  background-color: #ffffff;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.history-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-primary);
  font-weight: 500;
}

.history-table tr:hover td {
  background-color: #f1f5f9;
}

.table-placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px !important;
}

.table-direction-badge {
  display: inline-block;
  padding: 2px 8px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-footer a {
  color: var(--color-speed-dark);
  text-decoration: none;
  font-weight: 500;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Windalarm Side-Drawer Menu
   ========================================================================== */
.btn-alarm {
  position: relative;
  transition: var(--transition-fast);
}

.btn-alarm svg {
  color: var(--text-secondary);
}

.btn-alarm.alarm-active-state svg {
  color: #ef4444; /* Alert Red */
  animation: wiggle 0.5s ease-in-out infinite alternate;
}

@keyframes wiggle {
  0% { transform: rotate(-8deg); }
  100% { transform: rotate(8deg); }
}

.alarm-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 9px;
  height: 9px;
  background-color: #ef4444;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  display: none; /* Controlled by active status in JS */
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
}

.alarm-badge.active {
  display: block;
  animation: pulse-red 2s infinite;
}

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

/* Drawer Container */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  visibility: hidden;
  transition: visibility 0.3s;
}

.drawer.open {
  visibility: visible;
}

.drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drawer.open .drawer-overlay {
  opacity: 1;
}

.drawer-content {
  position: absolute;
  top: 0;
  right: -420px;
  width: 420px;
  height: 100%;
  background-color: #ffffff;
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer.open .drawer-content {
  right: 0;
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8fafc;
}

.drawer-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-close:hover {
  background-color: #f1f5f9;
  color: var(--text-primary);
}

.btn-close svg {
  width: 20px;
  height: 20px;
}

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.drawer-divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 20px 0;
}

/* Form Styling inside Drawer */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group.toggle-group {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 75%;
}

.form-label-bold {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-label-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.section-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.form-section h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Time Range Grid */
.time-range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background-color: #f8fafc;
  transition: var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-speed);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.08);
}

/* Custom Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

input:checked + .slider {
  background-color: var(--color-success);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Slider header with limit value */
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.slider-value-badge {
  font-size: 12px;
  font-weight: 700;
  background-color: var(--color-speed-light);
  color: var(--color-speed-dark);
  padding: 2px 10px;
  border-radius: 99px;
  font-family: 'Outfit', sans-serif;
}

.slider-value-badge.gust-badge-color {
  background-color: var(--color-gust-light);
  color: var(--color-gust-dark);
}

/* Custom Range Sliders */
.range-container {
  padding: 8px 4px;
}

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: #e2e8f0;
  outline: none;
  margin-bottom: 6px;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-speed);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-slider-gust::-webkit-slider-thumb {
  background: var(--color-gust);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Buttons inside Drawer */
.drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
}

.btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  text-align: center;
}

.btn-primary {
  background-color: var(--color-speed-dark);
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(3, 105, 161, 0.15);
}

.btn-primary:hover {
  background-color: #025a8b;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
  color: var(--text-primary);
}

/* ==========================================================================
   Premium Alert Floating Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none; /* Pass-through clicks */
  width: 90%;
  max-width: 460px;
}

.toast {
  pointer-events: auto; /* Re-enable clicks for close buttons */
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 5px solid #ef4444; /* High warning red border */
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: slide-down 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s, transform 0.3s;
}

.toast.fade-out {
  opacity: 0;
  transform: translateY(-20px) translateX(-50%);
}

.toast-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-round);
  background-color: #fee2e2;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: pulse-ring-red 2s infinite;
}

.toast-icon svg {
  width: 20px;
  height: 20px;
}

.toast-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.toast-message {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.toast-close:hover {
  background-color: #fee2e2;
  color: #ef4444;
}

.toast-close svg {
  width: 16px;
  height: 16px;
}

@keyframes slide-down {
  0% {
    transform: translateY(-20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse-ring-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes pulse-card-red {
  0% { border-color: var(--border-color); }
  50% { border-color: #ef4444; box-shadow: 0 0 15px rgba(239, 68, 68, 0.15); }
  100% { border-color: var(--border-color); }
}

.metric-card.alarm-trigger-animation {
  animation: pulse-card-red 2s infinite;
}

/* Mobile responsive fixes for Drawer */
@media (max-width: 480px) {
  .drawer-content {
    width: 100%;
    right: -100%;
  }
}

/* ==========================================================================
   Keyframes & Animations
   ========================================================================== */
@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.75;
  }
  70% {
    transform: scale(2.8);
    opacity: 0;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.85);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(0.85);
  }
}

/* ==========================================================================
   Forecast Page Grids & Elements
   ========================================================================== */
.top-row-forecast {
  grid-template-columns: 1fr 340px;
}

.bottom-row-forecast {
  grid-template-columns: 1fr 420px;
}

.map-iframe-container {
  width: 100%;
  height: 460px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.map-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* DMI Card */
.dmi-card {
  display: flex;
  flex-direction: column;
}

.dmi-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: space-between;
  height: 100%;
}

.dmi-map-graphic {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dmi-radar-svg {
  width: 100%;
  max-width: 240px;
  box-shadow: var(--shadow-md);
  border-radius: 12px;
}

.dmi-info h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.dmi-info p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.btn-dmi-redirect {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  background-color: var(--color-speed-dark);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 6px -1px rgba(3, 105, 161, 0.15);
  transition: var(--transition-fast);
}

.btn-dmi-redirect:hover {
  background-color: #025a8b;
  transform: translateY(-1px);
}

.btn-dmi-redirect svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Spot Comparison Page Layout
   ========================================================================== */
.spots-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.spot-card-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.spot-title-group h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.spot-title-group .spot-coord {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.spot-dashboard-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 12px;
  flex-grow: 1;
}

.spot-compass-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.spot-compass-section .compass-container {
  width: 180px;
  height: 180px;
}

.spot-metrics-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.spot-metric-row {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.spot-metric-row:hover {
  background-color: #ffffff;
  box-shadow: var(--shadow-md);
  border-color: var(--text-muted);
}

.spot-metric-row.warning-row {
  border-left: 4px solid var(--color-gust);
  background: linear-gradient(135deg, #f8fafc 0%, #fffcf9 100%);
}

.spot-metric-row.warning-row:hover {
  background-color: #ffffff;
}

.spot-footer-actions {
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.btn-spot-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
}

.btn-spot-link svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1180px) {
  .top-row, .top-row-forecast {
    grid-template-columns: 1fr;
  }
  .bottom-row, .bottom-row-forecast {
    grid-template-columns: 1fr;
  }
  .spots-comparison-grid {
    grid-template-columns: 1fr;
  }
  .compass-card {
    height: auto;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .header-controls {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-container {
    padding: 16px;
    gap: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .metric-card {
    padding: 18px;
  }

  .metric-number {
    font-size: 32px;
  }

  .chart-container {
    height: 260px;
  }

  .spot-dashboard-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 16px;
  }

  .spot-metrics-section {
    width: 100%;
  }
}

/* Map Selector Switcher */
.map-selector {
  display: flex;
  background-color: #f1f5f9;
  padding: 4px;
  border-radius: 99px;
  border: 1px solid var(--border-color);
  margin-left: auto;
}

.map-selector-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 99px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.map-selector-btn:hover {
  color: var(--text-primary);
}

.map-selector-btn.active {
  background-color: #ffffff;
  color: var(--color-speed-dark);
  box-shadow: var(--shadow-sm);
}

/* DMI Full Page Card */
.dmi-card-full {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.dmi-preview-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  max-width: 800px;
  width: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dmi-preview-container:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.dmi-overlay-btn-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(1px);
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.dmi-preview-container:hover .dmi-overlay-btn-container {
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(0px);
}

.btn-dmi-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  background-color: var(--color-speed-dark);
  color: #ffffff;
  border: none;
  box-shadow: var(--shadow-lg);
  transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-dmi-large:hover {
  background-color: #025a8b;
  transform: scale(1.03);
  box-shadow: 0 10px 15px -3px rgba(3, 105, 161, 0.3);
}

.btn-dmi-large svg {
  width: 20px;
  height: 20px;
}
