/* ==========================================================================
   METEOPORTAL MATERIAL — DESIGN SYSTEM (MATERIAL DESIGN 3 / MATERIAL YOU)
   ========================================================================== */

:root {
  /* Color Tokens - Light Theme (Material Design 3 Baseline) */
  --md-sys-color-primary: #006495;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #cbe6ff;
  --md-sys-color-on-primary-container: #001e30;

  --md-sys-color-secondary: #50606e;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #d3e5f5;
  --md-sys-color-on-secondary-container: #0c1d29;

  --md-sys-color-tertiary: #65587b;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #ecdcff;
  --md-sys-color-on-tertiary-container: #211634;

  --md-sys-color-surface: #f7f9fd;
  --md-sys-color-on-surface: #181c20;
  --md-sys-color-surface-variant: #dde3ea;
  --md-sys-color-on-surface-variant: #41474d;

  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f1f4f8;
  --md-sys-color-surface-container: #ebf0f4;
  --md-sys-color-surface-container-high: #e5eaf0;
  --md-sys-color-surface-container-highest: #dfe4ea;

  --md-sys-color-outline: #71787e;
  --md-sys-color-outline-variant: #c1c7ce;
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;

  --md-sys-color-card-bg: rgba(255, 255, 255, 0.85);
  --md-sys-color-card-border: rgba(113, 120, 126, 0.15);

  /* Weather Atmosphere Accents */
  --weather-accent-gradient: linear-gradient(135deg, #006495 0%, #1976d2 100%);
  --weather-card-glow: rgba(0, 100, 149, 0.12);

  /* Elevation Shadows (Material 3) */
  --md-elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.08), 0px 1px 2px 0px rgba(0, 0, 0, 0.06);
  --md-elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.08), 0px 1px 2px 0px rgba(0, 0, 0, 0.06);
  --md-elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.10), 0px 1px 3px 0px rgba(0, 0, 0, 0.08);
  --md-elevation-4: 0px 6px 10px 4px rgba(0, 0, 0, 0.10), 0px 2px 3px 0px rgba(0, 0, 0, 0.08);
  --md-elevation-5: 0px 8px 12px 6px rgba(0, 0, 0, 0.12), 0px 4px 4px 0px rgba(0, 0, 0, 0.10);

  /* Typography */
  --font-family-brand: 'Outfit', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Shapes */
  --shape-xs: 4px;
  --shape-sm: 8px;
  --shape-md: 12px;
  --shape-lg: 16px;
  --shape-xl: 24px;
  --shape-xxl: 28px;
  --shape-full: 9999px;

  /* Transitions */
  --transition-standard: cubic-bezier(0.2, 0.0, 0.0, 1.0);
  --duration-short: 150ms;
  --duration-medium: 250ms;
  --duration-long: 400ms;
}

/* ==========================================================================
   DARK THEME PALETTE
   ========================================================================== */
[data-theme="dark"] {
  --md-sys-color-primary: #8ecdff;
  --md-sys-color-on-primary: #00344f;
  --md-sys-color-primary-container: #004b71;
  --md-sys-color-on-primary-container: #cbe6ff;

  --md-sys-color-secondary: #b7c9d9;
  --md-sys-color-on-secondary: #22323f;
  --md-sys-color-secondary-container: #394956;
  --md-sys-color-on-secondary-container: #d3e5f5;

  --md-sys-color-tertiary: #d0c0e8;
  --md-sys-color-on-tertiary: #362b4b;
  --md-sys-color-tertiary-container: #4d4162;
  --md-sys-color-on-tertiary-container: #ecdcff;

  --md-sys-color-surface: #101418;
  --md-sys-color-on-surface: #dfe3e8;
  --md-sys-color-surface-variant: #41474d;
  --md-sys-color-on-surface-variant: #c1c7ce;

  --md-sys-color-surface-container-lowest: #0b0f12;
  --md-sys-color-surface-container-low: #181c20;
  --md-sys-color-surface-container: #1c2024;
  --md-sys-color-surface-container-high: #272a2f;
  --md-sys-color-surface-container-highest: #31353a;

  --md-sys-color-outline: #8b9298;
  --md-sys-color-outline-variant: #41474d;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;

  --md-sys-color-card-bg: rgba(28, 32, 36, 0.75);
  --md-sys-color-card-border: rgba(255, 255, 255, 0.08);

  --weather-accent-gradient: linear-gradient(135deg, #103b5b 0%, #1e4976 100%);
  --weather-card-glow: rgba(142, 205, 255, 0.12);

  --md-elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.35);
  --md-elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.40);
  --md-elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.45);
  --md-elevation-4: 0px 6px 12px 4px rgba(0, 0, 0, 0.50);
  --md-elevation-5: 0px 8px 16px 6px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   DYNAMIC WEATHER PALETTES (Material You Condition Theming)
   ========================================================================== */
body[data-condition="clear"] {
  --weather-accent-gradient: linear-gradient(135deg, #e65100 0%, #f57c00 50%, #ffa726 100%);
  --weather-card-glow: rgba(255, 152, 0, 0.2);
}
[data-theme="dark"] body[data-condition="clear"] {
  --weather-accent-gradient: linear-gradient(135deg, #422006 0%, #713f12 50%, #9a3412 100%);
  --weather-card-glow: rgba(249, 115, 22, 0.2);
}

body[data-condition="rain"] {
  --weather-accent-gradient: linear-gradient(135deg, #0288d1 0%, #0097a7 50%, #00acc1 100%);
  --weather-card-glow: rgba(2, 136, 209, 0.2);
}
[data-theme="dark"] body[data-condition="rain"] {
  --weather-accent-gradient: linear-gradient(135deg, #082f49 0%, #0c4a6e 50%, #075985 100%);
  --weather-card-glow: rgba(56, 189, 248, 0.2);
}

body[data-condition="thunderstorm"] {
  --weather-accent-gradient: linear-gradient(135deg, #4a148c 0%, #6a1b9a 50%, #7b1fa2 100%);
  --weather-card-glow: rgba(123, 31, 162, 0.25);
}
[data-theme="dark"] body[data-condition="thunderstorm"] {
  --weather-accent-gradient: linear-gradient(135deg, #2e1065 0%, #3b0764 50%, #581c87 100%);
  --weather-card-glow: rgba(168, 85, 247, 0.25);
}

body[data-condition="snow"] {
  --weather-accent-gradient: linear-gradient(135deg, #00838f 0%, #0097a7 50%, #26c6da 100%);
  --weather-card-glow: rgba(0, 188, 212, 0.25);
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family-body);
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color var(--duration-long) var(--transition-standard),
              color var(--duration-long) var(--transition-standard);
  position: relative;
  overflow-x: hidden;
}

/* Background Atmospheric Gradient Mesh */
.atmospheric-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
  background: radial-gradient(circle at 10% 20%, var(--weather-card-glow) 0%, transparent 45%),
              radial-gradient(circle at 90% 80%, var(--weather-card-glow) 0%, transparent 45%);
  transition: background var(--duration-long) var(--transition-standard), opacity var(--duration-long);
}

/* Material Symbols configuration */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
  user-select: none;
}

/* Typography Classes */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-brand);
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

/* ==========================================================================
   APP BAR (TOP BAR - MATERIAL 3)
   ========================================================================== */
.top-app-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--md-sys-color-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  transition: all var(--duration-medium) var(--transition-standard);
}

.top-app-bar-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--shape-lg);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--md-elevation-1);
  transition: transform var(--duration-short) var(--transition-standard);
}
.brand-icon-wrapper:hover {
  transform: scale(1.05);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 500;
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  padding: 0.1rem 0.5rem;
  border-radius: var(--shape-full);
  display: inline-block;
  margin-top: 0.1rem;
}

.app-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Material 3 Icon Buttons & Action Chips */
.m3-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--shape-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--duration-short) var(--transition-standard);
}

.m3-icon-btn:hover {
  background: var(--md-sys-color-surface-container-high);
  box-shadow: var(--md-elevation-1);
}

.m3-icon-btn:active {
  transform: scale(0.95);
}

.unit-toggle-btn {
  padding: 0.4rem 0.85rem;
  border-radius: var(--shape-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  font-family: var(--font-family-brand);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--duration-short) var(--transition-standard);
}
.unit-toggle-btn:hover {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-primary);
}

/* Active status indicator */
.m3-icon-btn.active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--md-sys-color-primary);
}

/* ==========================================================================
   MAIN LAYOUT CONTAINER
   ========================================================================== */
.main-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ==========================================================================
   SEARCH & LOCATION SELECTION SECTION
   ========================================================================== */
.location-search-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Material 3 Docked Search Bar */
.m3-search-bar-wrapper {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.m3-search-bar {
  display: flex;
  align-items: center;
  background: var(--md-sys-color-surface-container-high);
  border-radius: var(--shape-full);
  padding: 0.35rem 0.75rem 0.35rem 1.25rem;
  box-shadow: var(--md-elevation-1);
  border: 1px solid transparent;
  transition: all var(--duration-medium) var(--transition-standard);
  position: relative;
}

.m3-search-bar:focus-within {
  background: var(--md-sys-color-surface-container-lowest);
  border-color: var(--md-sys-color-primary);
  box-shadow: var(--md-elevation-3);
  border-radius: var(--shape-xl) var(--shape-xl) 0 0;
}

.m3-search-bar .search-icon {
  color: var(--md-sys-color-on-surface-variant);
  margin-right: 0.75rem;
  pointer-events: none;
}

.m3-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-family-body);
  font-size: 1rem;
  color: var(--md-sys-color-on-surface);
  padding: 0.5rem 0;
}

.m3-search-bar input::placeholder {
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.8;
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.search-actions button {
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  width: 38px;
  height: 38px;
  border-radius: var(--shape-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-short) var(--transition-standard);
}

.search-actions button:hover {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
}

/* Autocomplete Dropdown List */
.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-top: none;
  border-radius: 0 0 var(--shape-xl) var(--shape-xl);
  box-shadow: var(--md-elevation-4);
  max-height: 340px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-results-dropdown.visible {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: background var(--duration-short) var(--transition-standard);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item.highlighted {
  background: var(--md-sys-color-surface-container-high);
}

.search-result-item .item-icon {
  color: var(--md-sys-color-primary);
  font-size: 22px;
}

.search-result-info {
  display: flex;
  flex-direction: column;
}

.search-result-name {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--md-sys-color-on-surface);
}

.search-result-detail {
  font-size: 0.8rem;
  color: var(--md-sys-color-on-surface-variant);
}

.search-loading-state,
.search-empty-state {
  padding: 1.5rem;
  text-align: center;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.9rem;
}

/* Location Chips Row */
.location-chips-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0.5rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.location-chips-wrapper::-webkit-scrollbar {
  display: none;
}

.chip-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  margin-right: 0.25rem;
}

.m3-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 34px;
  padding: 0 0.85rem;
  border-radius: var(--shape-sm);
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
  font-family: var(--font-family-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-short) var(--transition-standard);
  position: relative;
  overflow: hidden;
}

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

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

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

/* ==========================================================================
   INTERACTIVE MAP COLLAPSIBLE CARD
   ========================================================================== */
.map-card-wrapper {
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-xl);
  overflow: hidden;
  box-shadow: var(--md-elevation-1);
  transition: all var(--duration-medium) var(--transition-standard);
  display: none;
}

.map-card-wrapper.open {
  display: block;
  animation: fadeInDown 0.3s var(--transition-standard);
}

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

.map-header {
  padding: 0.85rem 1.25rem;
  background: var(--md-sys-color-surface-container);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.map-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.map-header-title .material-symbols-outlined {
  color: var(--md-sys-color-primary);
}

.map-instructions {
  font-size: 0.8rem;
  color: var(--md-sys-color-on-surface-variant);
}

#map-container {
  height: 320px;
  width: 100%;
  background: var(--md-sys-color-surface-container-highest);
  z-index: 10;
}

.map-footer {
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  background: var(--md-sys-color-surface-container-lowest);
}

.map-coords-display {
  font-family: monospace;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
}

/* ==========================================================================
   HERO ROW: TEMPERATURA A LA IZQUIERDA Y CICLO SOLAR A LA DERECHA
   ========================================================================== */
.hero-solar-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: stretch;
}

@media (min-width: 1024px) {
  .hero-solar-row {
    grid-template-columns: 1.5fr 0.8fr;
  }
}

.hero-solar-row .hero-weather-card {
  margin-bottom: 0;
  height: 100%;
  justify-content: space-between;
  grid-column: 1;
}

.hero-solar-card {
  position: relative;
  background: var(--md-sys-color-card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--md-sys-color-card-border);
  border-radius: var(--shape-xxl);
  padding: 1.1rem 1.35rem;
  box-shadow: var(--md-elevation-2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  overflow: hidden;
  transition: all var(--duration-medium) var(--transition-standard);
  grid-column: auto;
}

@media (min-width: 1024px) {
  .hero-solar-card {
    grid-column: 2;
  }
}

.hero-solar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #f59e0b, #facc15, #ea580c);
}

.hero-aqi-card::before {
  background: linear-gradient(90deg, #10b981 0%, #0284c7 50%, #84cc16 100%);
}

.solar-metric-card .solar-arc-wrapper {
  width: 100%;
  max-width: 320px;
  margin: auto;
  display: flex;
  justify-content: center;
  padding: 0.25rem 0;
}

.solar-metric-card .solar-arc-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ==========================================================================
   WEATHER HERO CARD (MATERIAL 3 ELEVATED CARD)
   ========================================================================== */
.hero-weather-card {
  position: relative;
  background: var(--md-sys-color-card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--md-sys-color-card-border);
  border-radius: var(--shape-xxl);
  padding: 1.35rem 1.75rem;
  box-shadow: var(--md-elevation-2);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  overflow: hidden;
  transition: all var(--duration-medium) var(--transition-standard);
}

.hero-weather-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--weather-accent-gradient);
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.location-title-box {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.location-city {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.location-subtext {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.95rem;
  font-weight: 400;
}

.location-coord-badge {
  background: var(--md-sys-color-surface-container-high);
  padding: 0.15rem 0.5rem;
  border-radius: var(--shape-sm);
  font-family: monospace;
  font-size: 0.8rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon-tonal {
  background: var(--md-sys-color-surface-container-high);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--shape-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  transition: all var(--duration-short) var(--transition-standard);
}

.btn-icon-tonal:hover {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-primary);
}

.btn-icon-tonal.favorite-active {
  color: #f59e0b;
}

/* Main Temperature & Visuals */
.hero-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.hero-temp-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.temp-value-row {
  display: flex;
  align-items: flex-start;
  line-height: 1;
}

.hero-present-weather-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.temp-large {
  font-family: var(--font-family-brand);
  font-size: 3.85rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--md-sys-color-on-surface);
}

.temp-unit-mark {
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  margin-left: 0.1rem;
  margin-top: 0.2rem;
}

.temp-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 0;
}

.condition-label {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.feels-like {
  font-size: 0.88rem;
  color: var(--md-sys-color-on-surface-variant);
}

.high-low-range {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  margin-top: 0.1rem;
}

.high-temp {
  color: #ef4444;
  display: flex;
  align-items: center;
}

.low-temp {
  color: #3b82f6;
  display: flex;
  align-items: center;
}

/* Weather Hero Icon with Aura (positioned directly below current temperature) */
.hero-weather-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--shape-xl);
  border: 1px solid var(--md-sys-color-card-border);
  box-shadow: var(--md-elevation-1);
}

.weather-aura {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: var(--shape-full);
  background: var(--weather-card-glow);
  filter: blur(14px);
  z-index: 0;
  animation: pulseAura 4s infinite alternate;
}

@keyframes pulseAura {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 0.9; }
}

.hero-weather-icon-box .material-symbols-outlined {
  font-size: 36px;
  position: relative;
  z-index: 1;
  color: var(--md-sys-color-primary);
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.15));
  line-height: 1;
  transition: transform var(--duration-short) ease, color var(--duration-short) ease;
}

.hero-weather-icon-box:hover .material-symbols-outlined {
  transform: scale(1.08);
}

/* Dynamic Condition Accents for Present Weather Icon */
body[data-condition="clear"] #hero-weather-symbol {
  color: #f59e0b;
}
body[data-condition="rain"] #hero-weather-symbol {
  color: #3b82f6;
}
body[data-condition="snow"] #hero-weather-symbol {
  color: #38bdf8;
}
body[data-condition="thunderstorm"] #hero-weather-symbol {
  color: #8b5cf6;
}
body[data-condition="fog"] #hero-weather-symbol {
  color: #94a3b8;
}
body[data-condition="cloudy"] #hero-weather-symbol {
  color: #64748b;
}


/* Graduated Precision Thermometer (-10 to +50°C) */
.hero-thermometer-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-card-border);
  border-radius: var(--shape-lg);
  padding: 0.4rem 0.65rem 0.35rem 0.65rem;
  box-shadow: var(--md-elevation-1);
  min-width: 110px;
  transition: all var(--duration-short) var(--transition-standard);
  user-select: none;
}

.hero-thermometer-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--md-elevation-2);
  border-color: var(--md-sys-color-primary);
}

.thermometer-header-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
  text-align: center;
}

.thermometer-svg {
  width: 82px;
  height: 124px; /* Reducido un 20% en altura (156px * 0.80 = 124.8px) */
  overflow: visible;
}

.thermometer-svg text {
  font-family: var(--font-family-brand), 'Outfit', sans-serif;
  letter-spacing: -0.01em;
}

/* Hero Footer Badges */
.hero-footer-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

.info-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  padding: 0.25rem 0.65rem;
  border-radius: var(--shape-full);
  font-size: 0.76rem;
  font-weight: 500;
}

.info-badge .material-symbols-outlined {
  font-size: 16px;
  color: var(--md-sys-color-primary);
}

/* ==========================================================================
   METEOROLOGICAL METRICS GRID (M3 CARDS)
   ========================================================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title .material-symbols-outlined {
  color: var(--md-sys-color-primary);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.metric-card {
  background: var(--md-sys-color-card-bg);
  border: 1px solid var(--md-sys-color-card-border);
  border-radius: var(--shape-xl);
  padding: 1.25rem;
  box-shadow: var(--md-elevation-1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
  position: relative;
  overflow: hidden;
  transition: transform var(--duration-short) var(--transition-standard),
              box-shadow var(--duration-short) var(--transition-standard);
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--md-elevation-2);
}

.metric-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 0.75rem;
}

.metric-card-header .metric-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-card-header .material-symbols-outlined {
  font-size: 20px;
  color: var(--md-sys-color-primary);
}

.metric-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-value-box {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.metric-value {
  font-family: var(--font-family-brand);
  font-size: 2rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  line-height: 1.1;
}

.metric-unit {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
}

.metric-description {
  font-size: 0.85rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 0.25rem;
}

/* Custom Visuals inside Metrics */
/* ==========================================================================
   ÍNDICE UV: BARRA HORIZONTAL CON RELLENO DE COLORES (ESCALA OMS)
   ========================================================================== */
.uv-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.uv-risk-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--shape-full);
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.uv-risk-badge.uv-low {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.35);
}
.uv-risk-badge.uv-mod {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.35);
}
.uv-risk-badge.uv-high {
  background: rgba(234, 88, 12, 0.15);
  color: #ea580c;
  border-color: rgba(234, 88, 12, 0.35);
}
.uv-risk-badge.uv-veryhigh {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.35);
}
.uv-risk-badge.uv-extreme {
  background: rgba(124, 58, 237, 0.15);
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.35);
}

.uv-labels-row {
  display: flex;
  width: 100%;
  justify-content: space-between;
  margin-top: 0.35rem;
  margin-bottom: -0.25rem;
}

.uv-seg-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--md-sys-color-on-surface-variant);
}

.uv-track {
  background: var(--md-sys-color-surface-container-highest);
}

/* 5 Tramos de color OMS: Verde, Amarillo, Naranja, Rojo, Púrpura */
.uv-seg-low {
  background: #10b981;
  border-radius: var(--shape-full) 0 0 var(--shape-full);
}
.uv-seg-mod {
  background: #f59e0b;
}
.uv-seg-high {
  background: #ea580c;
}
.uv-seg-veryhigh {
  background: #dc2626;
}
.uv-seg-extreme {
  background: linear-gradient(90deg, #7c3aed 0%, #4c1d95 100%);
  border-radius: 0 var(--shape-full) var(--shape-full) 0;
}

.uv-cursor-dot {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
}

.uv-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  font-size: 0.82rem;
}

.uv-advice-text {
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.uv-max-info {
  font-size: 0.78rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* Wind Compass */
.wind-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.compass-dial {
  width: 36px;
  height: 36px;
  border-radius: var(--shape-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.compass-arrow {
  color: var(--md-sys-color-primary);
  font-size: 20px;
  transition: transform 0.6s var(--transition-standard);
}

/* ==========================================================================
   BARRAS HORIZONTALES GRADUADAS (HUMEDAD Y BARÓMETRO)
   ========================================================================== */
.hbar-metric-card .metric-card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
}

.hbar-container {
  width: 100%;
  position: relative;
  margin: 0.75rem 0 0.5rem 0;
}

.hbar-track {
  width: 100%;
  height: 18px;
  border-radius: var(--shape-full);
  display: flex;
  position: relative;
  overflow: visible;
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.hbar-segment {
  height: 100%;
  position: relative;
  transition: opacity 0.2s ease;
}

/* Humedad Segments */
.zone-dry {
  background: linear-gradient(90deg, #ea580c 0%, #f59e0b 100%);
  border-radius: var(--shape-full) 0 0 var(--shape-full);
}

.zone-green {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.zone-humid {
  background: linear-gradient(90deg, #0284c7 0%, #3b82f6 100%);
  border-radius: 0 var(--shape-full) var(--shape-full) 0;
}

.hbar-zone-tag {
  font-size: 0.65rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

/* Barómetro Segments */
.baro-storm {
  background: #7c3aed;
  border-radius: var(--shape-full) 0 0 var(--shape-full);
}
.baro-rain {
  background: #0284c7;
}
.baro-variable {
  background: #0d9488;
}
.baro-fair {
  background: #f59e0b;
}
.baro-dry {
  background: #ea580c;
  border-radius: 0 var(--shape-full) var(--shape-full) 0;
}

.barometer-symbols-row {
  display: flex;
  width: 100%;
  justify-content: space-between;
  margin-top: 0.25rem;
  margin-bottom: -0.25rem;
}

.baro-symbol {
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--md-sys-color-on-surface-variant);
}

/* Indicador de Referencia 1013.25 Std */
.hbar-ref-line {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: #dc2626;
  z-index: 4;
}

.hbar-ref-tag {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 800;
  color: #dc2626;
  white-space: nowrap;
}

/* Cursor dinámico que se desliza */
.hbar-cursor {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hbar-cursor-dot {
  width: 20px;
  height: 20px;
  border-radius: var(--shape-full);
  background: #ffffff;
  border: 3.5px solid var(--md-sys-color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.hbar-scale {
  position: relative;
  width: 100%;
  height: 18px;
  margin-top: 0.35rem;
}

.hbar-scale span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  top: 0;
}

.hbar-scale span.green-mark {
  color: #10b981;
  font-weight: 800;
}

.hbar-scale span.red-mark {
  color: #dc2626;
  font-weight: 800;
}

.dial-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  font-size: 0.82rem;
}

.comfort-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--shape-full);
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.comfort-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.comfort-badge.humid {
  background: rgba(2, 132, 199, 0.15);
  color: #0284c7;
}

.dew-point-info {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.8rem;
}

/* Barometer & Altitude Correction Styles */
.metric-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pressure-badge-qnh {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--shape-full);
  background: rgba(2, 132, 199, 0.12);
  color: var(--md-sys-color-primary);
  border: 1px solid rgba(2, 132, 199, 0.25);
  letter-spacing: 0.02em;
  transition: all var(--duration-short) ease;
}

.pressure-badge-qnh.mode-surface {
  background: rgba(100, 116, 139, 0.15);
  color: var(--md-sys-color-on-surface-variant);
  border-color: rgba(100, 116, 139, 0.3);
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-icon-tiny {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--md-sys-color-outline);
  padding: 0.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-short) ease;
}

.btn-icon-tiny:hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-primary);
}

.pressure-val-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pressure-primary-display {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.pressure-meta-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.pressure-detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container);
  padding: 0.15rem 0.5rem;
  border-radius: var(--shape-sm);
  border: 1px solid var(--md-sys-color-card-border);
}

.barometer-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.35rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.barometer-correction-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: var(--shape-full);
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: inline-flex;
  align-items: center;
}

.barometer-status-pill {
  padding: 0.2rem 0.75rem;
  border-radius: var(--shape-full);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid transparent;
  transition: all var(--duration-short) ease;
}

.barometer-status-pill.baro-pill-storm {
  background: rgba(124, 58, 237, 0.15);
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.3);
}

.barometer-status-pill.baro-pill-rain {
  background: rgba(2, 132, 199, 0.15);
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.3);
}

.barometer-status-pill.baro-pill-variable {
  background: rgba(13, 148, 136, 0.15);
  color: #0d9488;
  border-color: rgba(13, 148, 136, 0.3);
}

.barometer-status-pill.baro-pill-fair {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.3);
}

.barometer-status-pill.baro-pill-dry {
  background: rgba(234, 88, 12, 0.15);
  color: #ea580c;
  border-color: rgba(234, 88, 12, 0.3);
}

.location-elevation-badge {
  font-size: 0.85rem;
  color: var(--md-sys-color-primary);
  font-weight: 500;
}

/* ==========================================================================
   VIENTO: BARRA HORIZONTAL CON ESCALA BEAUFORT
   ========================================================================== */
.wind-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.beaufort-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--shape-full);
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.beaufort-badge.beaufort-calm {
  background: rgba(56, 189, 248, 0.15);
  color: #0284c7;
  border-color: rgba(56, 189, 248, 0.35);
}
.beaufort-badge.beaufort-breeze {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.35);
}
.beaufort-badge.beaufort-fresh {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.35);
}
.beaufort-badge.beaufort-gale {
  background: rgba(234, 88, 12, 0.15);
  color: #ea580c;
  border-color: rgba(234, 88, 12, 0.35);
}
.beaufort-badge.beaufort-storm {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.35);
}

.beaufort-labels-row {
  display: flex;
  width: 100%;
  justify-content: space-between;
  margin-top: 0.35rem;
  margin-bottom: -0.25rem;
}

.beaufort-seg-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--md-sys-color-on-surface-variant);
}

.wind-track {
  background: var(--md-sys-color-surface-container-highest);
}

.beaufort-seg-calm {
  background: #38bdf8;
  border-radius: var(--shape-full) 0 0 var(--shape-full);
}
.beaufort-seg-breeze {
  background: #10b981;
}
.beaufort-seg-fresh {
  background: #f59e0b;
}
.beaufort-seg-gale {
  background: #ea580c;
}
.beaufort-seg-storm {
  background: linear-gradient(90deg, #dc2626 0%, #7c3aed 100%);
  border-radius: 0 var(--shape-full) var(--shape-full) 0;
}

.wind-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  font-size: 0.82rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* ==========================================================================
   PRECIPITACIÓN: BARRA HORIZONTAL 0-100% BLANCO A ROJO
   ========================================================================== */
.precip-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.precip-accum-badge {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--shape-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);
}

.precip-gradient-track {
  background: linear-gradient(90deg, #ffffff 0%, #fecaca 25%, #f87171 50%, #ef4444 75%, #991b1b 100%) !important;
  border: 1px solid rgba(0, 0, 0, 0.22) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.precip-cursor-dot {
  border-color: #dc2626 !important;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.55), 0 2px 6px rgba(0, 0, 0, 0.35);
}

.precip-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  font-size: 0.82rem;
}

.precip-status-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--shape-full);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.precip-status-tag.rain-warn {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.precip-subtext {
  font-size: 0.78rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* ==========================================================================
   COBERTURA NUBOSA EN TARJETA DE VISIBILIDAD Y TARJETA DE INDICACIÓN DE MAREA
   ========================================================================== */
.vis-cloud-section {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.vis-cloud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.vis-cloud-title {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.vis-cloud-title .material-symbols-outlined {
  color: var(--md-sys-color-primary);
}

.vis-sky-viewport {
  margin: 0.1rem 0 0;
}

.vis-sky-viewport .sky-viewport-svg {
  max-width: 100%;
  border-radius: 8px;
}

.cloud-coverage-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--shape-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);
  white-space: nowrap;
}

.sky-viewport-container {
  width: 100%;
  margin: 0.5rem 0 0.25rem 0;
  display: flex;
  justify-content: center;
}

.sky-viewport-svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid var(--md-sys-color-outline-variant);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.cloud-puff-circle {
  fill: url(#whitePuffGrad);
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.14));
}

[data-theme="dark"] .cloud-puff-circle {
  fill: url(#whitePuffGrad);
}

.sky-sun-group {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* TARJETA 6: INDICACIÓN DE MAREA (PLEAMAR / BAJAMAR) */
.tide-metric-card .metric-card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.tide-top-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  width: 100%;
}

.tide-station-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.22rem 0.55rem;
  margin-top: 0.2rem;
  border-radius: var(--shape-sm);
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  font-size: 0.7rem;
}

.tide-station-name {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tide-station-link:hover {
  color: #0284c7;
  text-decoration: underline;
}

.tide-station-name .material-symbols-outlined {
  color: #0284c7;
  flex-shrink: 0;
}

.tide-station-dist {
  font-weight: 700;
  color: #0284c7;
  white-space: nowrap;
  flex-shrink: 0;
}

.tide-status-badge {
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--shape-full);
  background: rgba(2, 132, 199, 0.14);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.32);
  white-space: nowrap;
}

.tide-status-badge.tide-spring {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.35);
}

.tide-status-badge.tide-neap {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .tide-status-badge.tide-neap {
  color: #fbbf24;
}

.tide-viewport-container {
  width: 100%;
  margin: 0.45rem 0 0.25rem 0;
  display: flex;
  justify-content: center;
}

.tide-viewport-svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid var(--md-sys-color-outline-variant);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}

.tide-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.78rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 0.2rem;
}

.tide-table-wrapper {
  width: 100%;
  margin-top: 0.25rem;
  border-radius: var(--shape-sm);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
  overflow: hidden;
}

.tide-hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
  line-height: 1.15;
}

.tide-hours-table thead th {
  text-align: left;
  padding: 0.22rem 0.45rem;
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container-high);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.tide-hours-table thead th:nth-child(2),
.tide-hours-table thead th:nth-child(3),
.tide-hours-table thead th:nth-child(4) {
  text-align: right;
}

.tide-hours-table tbody tr {
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.tide-hours-table tbody tr:last-child {
  border-bottom: none;
}

.tide-hours-table tbody td {
  padding: 0.22rem 0.45rem;
  vertical-align: middle;
}

.tide-hours-table tbody td:nth-child(2),
.tide-hours-table tbody td:nth-child(3),
.tide-hours-table tbody td:nth-child(4) {
  text-align: right;
}

.tide-next-type {
  font-weight: 700;
  white-space: nowrap;
}

.tide-next-type.high {
  color: #0284c7;
}

.tide-next-type.low {
  color: #0369a1;
}

[data-theme="dark"] .tide-next-type.low {
  color: #38bdf8;
}

.tide-next-time {
  font-weight: 800;
  color: var(--md-sys-color-on-surface);
  font-variant-numeric: tabular-nums;
}

.tide-next-level {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tide-next-eta {
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ==========================================================================
   VISIBILIDAD HORIZONTAL: SÍMBOLO DE RADAR CON RAYAS PROPORCIONALES (0-10 KM)
   ========================================================================== */
.radar-metric-card .metric-card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.radar-visual-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.4rem 0 0.25rem 0;
}

.radar-svg {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}

.radar-bezel {
  fill: var(--md-sys-color-surface-container-highest);
  stroke: var(--md-sys-color-outline-variant);
  stroke-width: 2px;
}

.radar-screen {
  fill: #061019;
  stroke: rgba(16, 185, 129, 0.4);
  stroke-width: 1.5px;
}

.radar-grid-axis {
  stroke: rgba(16, 185, 129, 0.25);
  stroke-width: 1px;
  stroke-dasharray: 2, 2;
}

.radar-grid-diag {
  stroke: rgba(16, 185, 129, 0.12);
  stroke-width: 0.8px;
}

.radar-ring {
  fill: none;
  stroke: rgba(71, 85, 105, 0.45);
  stroke-width: 1px;
  stroke-dasharray: 2, 3;
  transition: stroke 0.4s ease, stroke-width 0.4s ease, filter 0.4s ease;
}

.radar-ring.active-ring {
  stroke: #10b981;
  stroke-width: 1.5px;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 3px rgba(16, 185, 129, 0.65));
}

.radar-range-text {
  fill: rgba(148, 163, 184, 0.85);
  font-size: 8px;
  font-family: var(--font-family-plain);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.radar-scanner {
  transform-origin: 85px 85px;
  animation: radarScanRotation 3.5s linear infinite;
  pointer-events: none;
}

@keyframes radarScanRotation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.radar-scanner-line {
  stroke: #34d399;
  stroke-width: 1.5px;
  filter: drop-shadow(0 0 4px #10b981);
}

.radar-center-blip {
  fill: #10b981;
  filter: drop-shadow(0 0 4px #10b981);
}

.radar-data-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.radar-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: var(--shape-full);
  border: 1px solid rgba(16, 185, 129, 0.3);
  text-align: right;
  white-space: nowrap;
}

.radar-status-badge.warning {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

.radar-status-badge.danger {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Ciclo Solar sobre Semiarco Ovalado */
.solar-metric-card {
  grid-column: auto;
}

.solar-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.solar-arc-wrapper {
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.solar-arc-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.solar-info-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.solar-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--md-sys-color-on-surface-variant);
}

.solar-status-badge {
  padding: 0.18rem 0.55rem;
  border-radius: var(--shape-full);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
  font-size: 0.72rem;
}

/* Bloque de Ciclo Lunar dentro de la Tarjeta de Ciclo Solar y Lunar */
.lunar-cycle-box {
  width: 100%;
  margin-top: 0.45rem;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-card-border);
  border-radius: var(--shape-md);
  padding: 0.45rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lunar-disc-wrapper {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lunar-disc-svg {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 2px 5px rgba(15, 23, 42, 0.25));
}

.lunar-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  overflow: hidden;
}

.lunar-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.lunar-phase-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lunar-illum-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--shape-full);
  background: rgba(250, 204, 21, 0.16);
  color: #b45309;
  border: 1px solid rgba(250, 204, 21, 0.38);
  white-space: nowrap;
}

[data-theme="dark"] .lunar-illum-badge {
  color: #fde047;
}

.lunar-sub-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
}

/* ==========================================================================
   HOURLY FORECAST (CAROUSEL & CANVAS CHART)
   ========================================================================== */
.hourly-section {
  background: var(--md-sys-color-card-bg);
  border: 1px solid var(--md-sys-color-card-border);
  border-radius: var(--shape-xxl);
  padding: 1.5rem;
  box-shadow: var(--md-elevation-1);
}

.hourly-tabs {
  display: flex;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--shape-full);
  padding: 0.2rem;
  border: 1px solid var(--md-sys-color-outline-variant);
}

.hourly-tab-btn {
  background: transparent;
  border: none;
  padding: 0.35rem 0.85rem;
  border-radius: var(--shape-full);
  font-family: var(--font-family-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: all var(--duration-short) var(--transition-standard);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.hourly-tab-btn.active {
  background: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
  box-shadow: var(--md-elevation-1);
}

/* Hourly Carousel */
.hourly-carousel {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding: 1rem 0.25rem 0.5rem 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--md-sys-color-outline-variant) transparent;
}

.hourly-carousel::-webkit-scrollbar {
  height: 6px;
}
.hourly-carousel::-webkit-scrollbar-thumb {
  background: var(--md-sys-color-outline-variant);
  border-radius: var(--shape-full);
}

.hourly-card {
  flex: 0 0 95px;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-lg);
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-align: center;
  transition: all var(--duration-short) var(--transition-standard);
}

.hourly-card:hover {
  background: var(--md-sys-color-surface-container-high);
  transform: translateY(-2px);
  border-color: var(--md-sys-color-primary);
}

.hourly-card.now {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--md-sys-color-primary);
}

.hourly-time {
  font-size: 0.85rem;
  font-weight: 500;
}

.hourly-card .material-symbols-outlined {
  font-size: 32px;
  color: var(--md-sys-color-primary);
}

.hourly-card.now .material-symbols-outlined {
  color: var(--md-sys-color-on-primary-container);
}

.hourly-temp {
  font-family: var(--font-family-brand);
  font-size: 1.15rem;
  font-weight: 700;
}

.hourly-rain {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0284c7;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

/* Hourly Chart View */
.hourly-chart-wrapper {
  margin-top: 1rem;
  width: 100%;
  height: 220px;
  position: relative;
  display: none;
}

.hourly-chart-wrapper.visible {
  display: block;
}

#tempChartCanvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ==========================================================================
/* ==========================================================================
   7-DAY EXTENDED FORECAST SECTION (CAJAS SELECCIONABLES)
   ========================================================================== */
.daily-forecast-section {
  background: var(--md-sys-color-card-bg);
  border: 1px solid var(--md-sys-color-card-border);
  border-radius: var(--shape-xxl);
  padding: 1.5rem;
  box-shadow: var(--md-elevation-1);
}

.daily-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* Cuadrícula de 7 Cajas Seleccionables */
.daily-boxes-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

@media (max-width: 960px) {
  .daily-boxes-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
}

@media (max-width: 640px) {
  .daily-boxes-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.65rem;
    padding-bottom: 0.65rem;
    scrollbar-width: thin;
  }
}

/* Caja Diaria Seleccionable (Material 3 Card) */
.daily-box-card {
  background: var(--md-sys-color-surface-container-low);
  border: 1.5px solid var(--md-sys-color-card-border);
  border-radius: var(--shape-xl);
  padding: 1rem 0.65rem 0.85rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all var(--duration-short) var(--transition-standard);
  user-select: none;
  min-width: 105px;
  flex-shrink: 0;
  outline: none;
  color: inherit;
  font-family: inherit;
}

.daily-box-card:hover {
  background: var(--md-sys-color-surface-container-high);
  transform: translateY(-3px);
  border-color: var(--md-sys-color-outline);
  box-shadow: var(--md-elevation-2);
}

.daily-box-card.today {
  background: var(--md-sys-color-surface-container);
  border-color: rgba(0, 100, 149, 0.4);
}

.daily-box-card.selected {
  background: var(--md-sys-color-surface-container-highest);
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary), var(--md-elevation-3);
  transform: translateY(-4px);
}

.daily-box-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.daily-box-day-name {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--md-sys-color-on-surface);
}

.daily-box-card.today .daily-box-day-name {
  color: var(--md-sys-color-primary);
}

.daily-box-date {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
}

.daily-box-icon {
  font-size: 38px;
  color: var(--md-sys-color-primary);
  margin: 0.15rem 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
  transition: transform var(--duration-short) ease;
}

.daily-box-card:hover .daily-box-icon {
  transform: scale(1.1);
}

.daily-box-condition {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.daily-box-temps {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.2rem;
}

.daily-box-temp-max {
  font-family: var(--font-family-brand);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ef4444;
}

.daily-box-temp-min {
  font-family: var(--font-family-brand);
  font-size: 0.95rem;
  font-weight: 600;
  color: #3b82f6;
}

.daily-box-rain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0284c7;
  padding: 0.2rem 0.5rem;
  border-radius: var(--shape-full);
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.2);
  width: 100%;
}

.daily-box-rain.rain-high {
  background: rgba(2, 132, 199, 0.22);
  color: #0369a1;
  border-color: rgba(2, 132, 199, 0.45);
}

.daily-box-selected-tag {
  position: absolute;
  top: -9px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.45rem;
  border-radius: var(--shape-full);
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Panel de Detalle Expandido del Día Seleccionado */
.daily-selected-detail {
  margin-top: 1.25rem;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-card-border);
  border-radius: var(--shape-xl);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeInDetail 0.3s ease;
}

@keyframes fadeInDetail {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.daily-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  padding-bottom: 0.75rem;
}

.daily-detail-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.daily-detail-icon {
  font-size: 34px;
  color: var(--md-sys-color-primary);
}

.daily-detail-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.daily-detail-subtitle {
  font-size: 0.85rem;
  color: var(--md-sys-color-on-surface-variant);
}

.daily-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.daily-detail-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--shape-md);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.daily-detail-item .material-symbols-outlined {
  font-size: 24px;
  color: var(--md-sys-color-primary);
}

.daily-detail-item-texts {
  display: flex;
  flex-direction: column;
}

.daily-detail-item-label {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
}

.daily-detail-item-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

/* ==========================================================================
   FAVORITES / SAVED LOCATIONS ROW
   ========================================================================== */
.favorites-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.favorites-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-full);
  font-size: 0.85rem;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  transition: all var(--duration-short) var(--transition-standard);
}

.fav-pill:hover {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-primary);
}

.fav-pill .fav-remove {
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
  border-radius: var(--shape-full);
}
.fav-pill .fav-remove:hover {
  color: var(--md-sys-color-error);
}

/* ==========================================================================
   SNACKBAR / TOAST NOTIFICATIONS (MATERIAL 3)
   ========================================================================== */
.m3-snackbar {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
  padding: 0.75rem 1.25rem;
  border-radius: var(--shape-sm);
  box-shadow: var(--md-elevation-3);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration-medium) var(--transition-standard);
  max-width: 90vw;
}

.m3-snackbar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.m3-snackbar .material-symbols-outlined {
  color: var(--md-sys-color-primary);
}

/* ==========================================================================
   SKELETON LOADING SHIMMER
   ========================================================================== */
.skeleton {
  background: linear-gradient(90deg, 
    var(--md-sys-color-surface-container-low) 25%, 
    var(--md-sys-color-surface-container-highest) 50%, 
    var(--md-sys-color-surface-container-low) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--shape-md);
  color: transparent !important;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   MATERIAL RIPPLE EFFECT
   ========================================================================== */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleAnimation 0.5s linear;
  background-color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

[data-theme="light"] .ripple {
  background-color: rgba(0, 0, 0, 0.15);
}

@keyframes rippleAnimation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ==========================================================================
   TARJETA 8: CALIDAD DEL AIRE (POLUCIÓN Y POLEN)
   ========================================================================== */
.hero-aqi-card .metric-card-header {
  margin-bottom: 0.4rem;
}

.aqi-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.aqi-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.aqi-top-row .metric-value {
  font-size: 1.65rem;
}

.aqi-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--shape-full);
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.aqi-status-badge.aqi-good {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.35);
}
.aqi-status-badge.aqi-fair {
  background: rgba(132, 204, 22, 0.16);
  color: #65a30d;
  border-color: rgba(132, 204, 22, 0.4);
}
[data-theme="dark"] .aqi-status-badge.aqi-fair {
  color: #a3e635;
}
.aqi-status-badge.aqi-mod {
  background: rgba(245, 158, 11, 0.16);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.4);
}
[data-theme="dark"] .aqi-status-badge.aqi-mod {
  color: #fbbf24;
}
.aqi-status-badge.aqi-poor {
  background: rgba(234, 88, 12, 0.16);
  color: #ea580c;
  border-color: rgba(234, 88, 12, 0.4);
}
.aqi-status-badge.aqi-verypoor {
  background: rgba(220, 38, 38, 0.16);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.4);
}
.aqi-status-badge.aqi-severe {
  background: rgba(124, 58, 237, 0.16);
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.4);
}

/* Segmentos de la barra ICA / EAQI */
.aqi-seg-good { background: #10b981; }
.aqi-seg-fair { background: #84cc16; }
.aqi-seg-mod { background: #eab308; }
.aqi-seg-poor { background: #f97316; }
.aqi-seg-verypoor { background: linear-gradient(90deg, #ef4444 0%, #9333ea 100%); }

/* Sub-bloques de Polución y Polen */
.aqi-subsection {
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-card-border);
  border-radius: var(--shape-md);
  padding: 0.35rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.aqi-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
}

.aqi-sub-title {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.aqi-sub-title .material-symbols-outlined {
  color: var(--md-sys-color-primary);
}

.aqi-sub-meta {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
}

/* Rejilla de Polución (PM2.5, PM10, NO2, O3) */
.pollution-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.pollution-pill {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-sm);
  padding: 0.25rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.pollution-pill .p-label {
  font-size: 0.63rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
}

.pollution-pill .p-val {
  font-family: var(--font-family-brand);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

/* Rejilla de Polen (Gramíneas, Olivo, Árboles, Maleza) */
.pollen-risk-pill {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--shape-full);
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.pollen-risk-pill.pollen-low {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}
.pollen-risk-pill.pollen-mod {
  background: rgba(245, 158, 11, 0.16);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.35);
}
[data-theme="dark"] .pollen-risk-pill.pollen-mod {
  color: #fbbf24;
}
.pollen-risk-pill.pollen-high {
  background: rgba(220, 38, 38, 0.16);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.35);
}

.pollen-header-badges {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pollen-expanded-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
}

.pollen-detail-item {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--shape-sm);
  padding: 0.25rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pollen-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}

.pollen-detail-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pollen-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}

.pollen-detail-val {
  font-family: var(--font-family-brand);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--md-sys-color-primary);
}

.pollen-mini-bar {
  width: 100%;
  height: 4px;
  background: var(--md-sys-color-surface-container-highest);
  border-radius: 999px;
  overflow: hidden;
}

.pollen-mini-fill {
  height: 100%;
  background: #10b981;
  border-radius: 999px;
  transition: width 0.5s ease, background-color 0.3s ease;
}

.pollen-detail-level {
  font-size: 0.63rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
}

.aqi-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 0.1rem;
}

.aqi-advice-text {
  font-weight: 500;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.app-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  text-align: center;
  font-size: 0.85rem;
  color: var(--md-sys-color-on-surface-variant);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 900px) {
  .hero-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  .hero-thermometer-box {
    align-self: center;
    margin: 0 auto;
  }
  .temp-large {
    font-size: 3.8rem;
  }
  .daily-row-card {
    grid-template-columns: 110px 1fr 100px;
  }
  .daily-condition {
    display: none;
  }
}

@media (max-width: 600px) {
  .top-app-bar-content {
    padding: 0.6rem 0.85rem;
  }
  .brand-text h1 {
    font-size: 1.05rem;
  }
  .main-container {
    padding: 1rem 0.75rem 3rem 0.75rem;
    gap: 1rem;
  }
  .hero-weather-card {
    padding: 1.25rem;
    border-radius: var(--shape-xl);
  }
  .location-city {
    font-size: 1.6rem;
  }
  .temp-large {
    font-size: 3.2rem;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .daily-row-card {
    grid-template-columns: 90px 1fr auto;
    padding: 0.75rem 0.85rem;
    gap: 0.5rem;
  }
  .daily-range-wrapper {
    gap: 0.4rem;
  }
  .daily-temp-low, .daily-temp-high {
    min-width: 25px;
    font-size: 0.8rem;
  }
}
