/* ============================================================
   MeuPernambuco.com — Design System
   Paleta inspirada na bandeira de Pernambuco
   Dark-first, mobile-first, zero dependências
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent-gold); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-gold-light); }
button { cursor: pointer; font-family: inherit; }
ul, ol { list-style: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ===========================
   2. DESIGN TOKENS
   =========================== */
:root {
  /* === Colors — Light Theme (Default) === */
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #E2E8F0;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --bg-input: #FFFFFF;

  /* Cores oficiais da Bandeira de PE */
  --accent-blue: #002B7F;
  --accent-blue-glow: rgba(0, 43, 127, 0.08);
  --accent-red: #E30613;
  --accent-red-glow: rgba(227, 6, 19, 0.08);
  --accent-gold: #D97706; /* Amarelo/Dourado legível no claro */
  --accent-gold-light: #F59E0B;
  --accent-gold-dark: #B45309;
  --accent-gold-glow: rgba(245, 158, 11, 0.08);
  --accent-green: #009639;
  --accent-green-glow: rgba(0, 150, 57, 0.08);
  --pe-yellow-raw: #FFF200; /* Cor crua para uso visual (arco-íris/sol) */

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;

  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-hover: rgba(0, 0, 0, 0.15);

  /* === Spacing === */
  --space-2xs: 0.125rem;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* === Typography === */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Outfit', var(--font-sans);

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  --leading-tight: 1.2;
  --leading-normal: 1.6;
  --leading-relaxed: 1.8;

  /* === Border Radius === */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* === Shadows === */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-glow-gold: 0 0 20px rgba(245, 158, 11, 0.15);
  --shadow-glow-blue: 0 0 20px rgba(0, 43, 127, 0.15);

  /* === Transitions === */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* === Layout === */
  --container-max: 1140px;
  --nav-height: 76px;
}

/* ===========================
   2b. DARK THEME
   =========================== */
[data-theme="dark"] {
  --bg-primary: #000F2E; /* Azul escuro inspirado no céu da bandeira */
  --bg-secondary: #001742;
  --bg-tertiary: #00225E;
  --bg-card: rgba(0, 23, 66, 0.7);
  --bg-card-hover: rgba(0, 34, 94, 0.9);
  --bg-input: rgba(0, 15, 46, 0.9);

  --accent-gold: #FFF200;
  --accent-gold-light: #FFFA66;
  --accent-gold-dark: #CCA200;
  --accent-gold-glow: rgba(255, 242, 0, 0.1);
  --accent-red: #E30613;
  --accent-red-glow: rgba(227, 6, 19, 0.12);
  --accent-blue: #3B82F6;
  --accent-blue-glow: rgba(59, 130, 246, 0.15);
  --accent-green: #009639;
  --accent-green-glow: rgba(0, 150, 57, 0.12);

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-inverse: #000F2E;

  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.16);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
}

/* ===========================
   3. TYPOGRAPHY
   =========================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

.section-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-sm);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light));
  border-radius: var(--radius-full);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 600px;
}

.text-gold { color: var(--accent-gold); }
.text-red { color: var(--accent-red); }
.text-blue { color: var(--accent-blue); }
.text-green { color: var(--accent-green); }
.text-muted { color: var(--text-muted); }

/* ===========================
   4. LAYOUT
   =========================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
  position: relative;
}

.section:nth-child(even) {
  background-color: var(--bg-secondary);
}

.section-header {
  margin-bottom: var(--space-2xl);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  .container { padding: 0 var(--space-md); }
  .section { padding: var(--space-2xl) 0; }
  .section-title { font-size: var(--text-2xl); }
}

/* ===========================
   5. NAVIGATION
   =========================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: var(--accent-blue);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.12);
  transition: all var(--transition-base);
}

.nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--accent-green), var(--pe-yellow-raw), var(--accent-red));
  z-index: 2;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #FFFFFF;
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.nav-logo:hover {
  transform: scale(1.02);
}

.nav-logo-icon {
  width: 42px;
  height: 42px;
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  color: var(--accent-blue);
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-link {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-base);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
}

.nav-link.active {
  color: var(--pe-yellow-raw);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 242, 0, 0.3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Theme Toggle */
.theme-toggle {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  color: #FFFFFF;
  font-size: var(--text-xl);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

/* Mobile Menu Button */
.nav-burger {
  display: none;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  color: #FFFFFF;
  font-size: var(--text-2xl);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-burger:hover {
  border-color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 900px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--accent-blue);
    padding: var(--space-xl) var(--space-lg);
    gap: var(--space-md);
    transform: translateY(-120%);
    opacity: 0;
    transition: transform var(--transition-spring), opacity var(--transition-base);
    border-bottom: 5px solid var(--accent-red);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-link {
    width: 100%;
    padding: var(--space-md);
    text-align: center;
    font-size: var(--text-lg);
    border-radius: var(--radius-md);
  }

  .nav-burger { display: flex; }
}

/* ===========================
   6. HERO
   =========================== */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + var(--space-2xl)) var(--space-lg) var(--space-2xl);
  position: relative;
  overflow: hidden;
  color: #FFFFFF;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #001A4E, #002B7F, #0A3C9A);
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(to right, #009639, #FFF200, #E30613);
  z-index: 2;
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
}

.hero-glow--gold {
  background: var(--pe-yellow-raw);
  top: 10%;
  right: -10%;
}

.hero-glow--red {
  background: #E30613;
  bottom: -15%;
  left: -10%;
}

.hero-glow--blue {
  background: #002B7F;
  top: 50%;
  left: 40%;
  width: 400px;
  height: 400px;
  opacity: 0.08;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pe-yellow-raw);
  background: rgba(255, 242, 0, 0.1);
  border: 1px solid rgba(255, 242, 0, 0.2);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-xl);
  animation: fadeInDown 0.6s ease-out;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 800;
  line-height: 1.1;
  color: #FFFFFF;
  margin-bottom: var(--space-lg);
  animation: fadeInUp 0.7s ease-out;
}

.hero-title-highlight {
  background: linear-gradient(135deg, var(--pe-yellow-raw), #FFF200);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: var(--text-lg);
  color: #E2E8F0;
  max-width: 580px;
  margin: 0 auto var(--space-2xl);
  animation: fadeInUp 0.8s ease-out;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.9s ease-out;
}

.hero-stats {
  display: flex;
  gap: var(--space-2xl);
  justify-content: center;
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeInUp 1s ease-out;
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: #FFFFFF;
}

.hero-stat-label {
  font-size: var(--text-sm);
  color: #CBD5E1;
  margin-top: var(--space-2xs);
}

@media (max-width: 640px) {
  .hero-title { font-size: var(--text-4xl); }
  .hero-description { font-size: var(--text-base); }
  .hero-stats { gap: var(--space-lg); flex-wrap: wrap; }
  .hero-stat-value { font-size: var(--text-2xl); }
}

/* ===========================
   7. BUTTONS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm), 0 0 0 0 var(--accent-gold-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow-gold);
  color: var(--text-inverse);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  color: var(--text-primary);
}

.btn-sm {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

/* ===========================
   8. CARDS (Glassmorphism)
   =========================== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  pointer-events: none;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-lg);
}

.card-icon--gold { background: var(--accent-gold-glow); }
.card-icon--red { background: var(--accent-red-glow); }
.card-icon--blue { background: var(--accent-blue-glow); }
.card-icon--green { background: var(--accent-green-glow); }

.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.card-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* Stat Card */
.stat-card {
  text-align: center;
  padding: var(--space-xl);
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-xs);
}

.stat-card .stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-card .stat-detail {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ===========================
   9. FORM CONTROLS
   =========================== */
.search-box {
  position: relative;
  max-width: 480px;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  padding-left: 48px;
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  outline: none;
  transition: all var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--text-lg);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.search-input:focus ~ .search-icon,
.search-box:focus-within .search-icon {
  color: var(--accent-gold);
}

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  z-index: 100;
  display: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.dropdown.open { display: block; }

.dropdown-item {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-bottom: 1px solid var(--glass-border);
}

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

.dropdown-item:hover,
.dropdown-item.highlighted {
  background: var(--accent-gold-glow);
  color: var(--text-primary);
}

.dropdown-item .dropdown-item-region {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.dropdown-empty {
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Custom scrollbar for dropdown */
.dropdown::-webkit-scrollbar { width: 6px; }
.dropdown::-webkit-scrollbar-track { background: transparent; }
.dropdown::-webkit-scrollbar-thumb {
  background: var(--glass-border-hover);
  border-radius: var(--radius-full);
}

/* ===========================
   10. MUNICIPALITY INFO
   =========================== */
.municipio-result {
  display: none;
  margin-top: var(--space-2xl);
  animation: fadeInUp 0.5s ease-out;
}

.municipio-result.visible {
  display: block;
}

.municipio-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.municipio-name {
  font-size: var(--text-3xl);
  font-weight: 700;
}

.municipio-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent-blue);
  background: var(--accent-blue-glow);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-full);
}

.municipio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

.municipio-info-card {
  padding: var(--space-lg);
}

.municipio-info-card .info-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
}

.municipio-info-card .info-value {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
}

/* ===========================
   11. WEATHER
   =========================== */
.weather-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.weather-current {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  padding: var(--space-2xl);
}

.weather-icon-large {
  font-size: 72px;
  line-height: 1;
  flex-shrink: 0;
}

.weather-temp {
  font-family: var(--font-display);
  font-size: var(--text-6xl);
  font-weight: 800;
  line-height: 1;
}

.weather-temp-unit {
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--text-muted);
  vertical-align: super;
}

.weather-condition {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

.weather-details {
  display: flex;
  gap: var(--space-xl);
  margin-top: var(--space-md);
}

.weather-detail {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.weather-detail-icon {
  font-size: var(--text-lg);
  color: var(--accent-blue);
}

/* 7-day forecast */
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-sm);
}

.forecast-day {
  text-align: center;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-fast);
}

.forecast-day:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.forecast-day-name {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.forecast-day-icon {
  font-size: var(--text-2xl);
  margin: var(--space-sm) 0;
}

.forecast-day-temps {
  font-size: var(--text-sm);
  font-weight: 600;
}

.forecast-day-temps .temp-max { color: var(--text-primary); }
.forecast-day-temps .temp-min { color: var(--text-muted); margin-left: var(--space-xs); }

@media (max-width: 768px) {
  .forecast-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .weather-current {
    flex-direction: column;
    text-align: center;
  }
  .weather-details { justify-content: center; flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .forecast-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===========================
   12. RANKING / BAR CHART
   =========================== */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.ranking-item:hover {
  border-color: var(--glass-border-hover);
  background: var(--bg-card-hover);
}

.ranking-position {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-muted);
  min-width: 28px;
  text-align: center;
}

.ranking-item:nth-child(1) .ranking-position { color: var(--accent-gold); }
.ranking-item:nth-child(2) .ranking-position { color: #C0C0C0; }
.ranking-item:nth-child(3) .ranking-position { color: #CD7F32; }

.ranking-info {
  flex: 1;
  min-width: 0;
}

.ranking-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-bar-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  margin-top: var(--space-xs);
  overflow: hidden;
}

[data-theme="light"] .ranking-bar-container {
  background: rgba(0, 0, 0, 0.06);
}

.ranking-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light));
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
}

.ranking-value {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

/* ===========================
   13. ABOUT PE (rich text)
   =========================== */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.about-text {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.about-text p {
  margin-bottom: var(--space-md);
}

.about-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.about-highlight-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.about-highlight-card .highlight-icon {
  font-size: var(--text-2xl);
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gold-glow);
  border-radius: var(--radius-sm);
}

.about-highlight-card .highlight-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2xs);
}

.about-highlight-card .highlight-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.about-links {
  margin-top: var(--space-xl);
}

.about-links-title {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.about-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.about-link:hover {
  color: var(--accent-gold);
  border-color: rgba(240, 180, 41, 0.3);
  background: var(--accent-gold-glow);
}

@media (max-width: 768px) {
  .about-content { grid-template-columns: 1fr; }
}

/* ===========================
   14. FOOTER
   =========================== */
.footer {
  padding: var(--space-3xl) 0 var(--space-xl);
  background: var(--bg-secondary);
  border-top: 1px solid var(--glass-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand-description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
  margin-top: var(--space-md);
  max-width: 320px;
}

.footer-col-title {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.footer-link {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast);
}

.footer-link:hover { color: var(--accent-gold); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--glass-border);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.footer-apis {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.footer-api-badge {
  padding: var(--space-2xs) var(--space-sm);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
  .footer-bottom { flex-direction: column; gap: var(--space-md); text-align: center; }
}

/* ===========================
   15. LOADING SKELETON
   =========================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    rgba(255, 255, 255, 0.04) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

[data-theme="light"] .skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    rgba(255, 255, 255, 0.6) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
}

.skeleton-text {
  height: 16px;
  margin-bottom: var(--space-sm);
}

.skeleton-text:last-child { width: 70%; }

.skeleton-title {
  height: 28px;
  width: 40%;
  margin-bottom: var(--space-md);
}

.skeleton-card {
  height: 120px;
}

/* ===========================
   16. SCROLL REVEAL
   =========================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
   17. ANIMATIONS
   =========================== */
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 50% 0%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 100%; }
}

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

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

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===========================
   18. SCROLLBAR
   =========================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===========================
   19. UTILITIES
   =========================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ===========================
   20. AD SPACES (hidden by default)
   =========================== */
.ad-space {
  display: none; /* Enable when AdSense is approved */
  max-width: 728px;
  margin: var(--space-xl) auto;
  min-height: 90px;
  background: var(--bg-card);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  text-align: center;
  padding: var(--space-md);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ===========================
   21. EMPTY / ERROR STATES
   =========================== */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}

.error-banner {
  padding: var(--space-md) var(--space-lg);
  background: var(--accent-red-glow);
  border: 1px solid rgba(226, 61, 40, 0.25);
  border-radius: var(--radius-md);
  color: var(--accent-red);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ===========================
   22. MEDICAMENTOS MODULE
   =========================== */
.med-loading {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
}

.med-loading .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--glass-border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-md);
}

.med-results-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  max-width: 850px;
  margin: 0 auto;
}

.med-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  border-left: 4px solid var(--accent-blue);
  background: var(--bg-card);
}

[data-theme="dark"] .med-card {
  border-left-color: var(--accent-gold);
}

.med-card-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.med-card-badge-container {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.med-status-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.status-green {
  background: var(--accent-green-glow);
  color: var(--accent-green);
  border: 1px solid rgba(0, 150, 57, 0.2);
}

.status-red {
  background: var(--accent-red-glow);
  color: var(--accent-red);
  border: 1px solid rgba(227, 6, 19, 0.2);
}

.med-class-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.med-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.med-card-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}

.med-summary-item {
  display: flex;
  flex-direction: column;
}

.med-summary-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.med-summary-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.med-toggle-btn {
  align-self: flex-start;
  margin-top: var(--space-xs);
}

.med-details {
  border-top: 1px solid var(--glass-border);
  padding-top: var(--space-md);
  margin-top: var(--space-xs);
}

.med-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.med-table th,
.med-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.med-table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
}

.med-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .med-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.font-bold {
  font-weight: 700;
}

.notice-banner {
  padding: var(--space-md);
  background: var(--accent-gold-glow);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: var(--radius-md);
  color: var(--accent-gold);
  font-size: var(--text-sm);
  text-align: center;
}

.med-unidade-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.med-unidade-address {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

.med-unidade-phone {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.med-unidade-map-link {
  display: inline-block;
  font-size: var(--text-xs);
  color: var(--accent-blue);
  font-weight: 600;
  margin-top: 4px;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.med-unidade-map-link:hover {
  text-decoration: underline;
}

[data-theme="dark"] .med-unidade-map-link {
  color: var(--accent-gold);
}

[data-theme="dark"] .med-unidade-map-link:hover {
  color: var(--accent-gold-light);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Explanation box for Medications */
.med-info-box {
  max-width: 600px;
  margin: var(--space-lg) auto 0;
  background: var(--bg-card);
  border-left: 4px solid var(--accent-gold);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  text-align: left;
}

[data-theme="dark"] .med-info-box {
  border-left-color: var(--accent-gold);
}

.med-info-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: 2px;
}

.med-info-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-xs);
}

.med-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.med-info-item {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}

.med-info-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--accent-gold-glow);
  color: var(--accent-gold);
  border: 1px solid rgba(217, 119, 6, 0.25);
  font-weight: bold;
  font-size: var(--text-xs);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
}

.med-info-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

.med-info-text strong {
  color: var(--text-secondary);
}
