/* ============================================
   CLIMA PANAMÁ — Design System
   https://clima.jlsoftware.net
   ============================================ */

:root {
  /* Colors */
  --sky-50: #f0f7ff;
  --sky-100: #e0efff;
  --sky-200: #b9dfff;
  --sky-300: #7cc8ff;
  --sky-400: #36adff;
  --sky-500: #0c93f1;
  --sky-600: #0074ce;
  --sky-700: #005ca7;
  --sky-800: #024e8a;
  --sky-900: #084172;
  --sky-950: #06294b;

  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --white: #ffffff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Semantic */
  --bg-primary: var(--sky-50);
  --bg-card: var(--white);
  --bg-header: var(--white);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-400);
  --accent: var(--sky-500);
  --accent-hover: var(--sky-600);
  --border: var(--gray-200);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);

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

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

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

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

.section { padding: var(--space-2xl) 0; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  max-width: 1200px;
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--sky-700);
}

.site-logo svg { width: 32px; height: 32px; }

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

.main-nav a {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.main-nav a:hover, .main-nav a.active {
  color: var(--accent);
  background: var(--sky-100);
}

/* City dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  background: none;
  border: none;
  transition: all var(--transition);
}

.nav-dropdown-btn:hover { color: var(--accent); background: var(--sky-100); }

.nav-dropdown-btn svg { width: 16px; height: 16px; transition: transform var(--transition); }

.nav-dropdown:hover .nav-dropdown-btn svg { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: var(--space-xs);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition);
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.nav-dropdown-menu a:hover { background: var(--sky-50); color: var(--accent); }

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-xs);
  color: var(--text-primary);
}

.menu-toggle svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
  }
  .main-nav.open { display: flex; }
  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding-left: var(--space-md);
  }
}

/* ============================================
   HERO — Current Weather
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--sky-500) 0%, var(--sky-400) 50%, var(--sky-300) 100%);
  color: var(--white);
  padding: var(--space-2xl) 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  position: relative;
  z-index: 1;
}

.hero-left { flex: 1; }
.hero-right { flex: 0 0 auto; text-align: center; }

.hero-city {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.85;
  margin-bottom: var(--space-xs);
}

.hero-temp {
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.hero-temp sup {
  font-size: 2rem;
  font-weight: 600;
  vertical-align: super;
}

.hero-condition {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: var(--space-md);
}

.hero-details {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.hero-detail {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  opacity: 0.85;
}

.hero-detail svg { width: 18px; height: 18px; }

.hero-icon svg {
  width: 140px;
  height: 140px;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.15));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-minmax {
  margin-top: var(--space-sm);
  font-size: 1rem;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .hero-content { flex-direction: column; text-align: center; }
  .hero-temp { font-size: 4rem; }
  .hero-details { justify-content: center; }
  .hero-icon svg { width: 100px; height: 100px; }
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs {
  padding: var(--space-sm) 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs span { margin: 0 var(--space-xs); }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  padding: var(--space-lg);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ============================================
   SECTION TITLES
   ============================================ */
.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-title svg { width: 24px; height: 24px; color: var(--accent); }

/* ============================================
   HOURLY FORECAST
   ============================================ */
.hourly-scroll {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.hourly-scroll::-webkit-scrollbar { height: 6px; }
.hourly-scroll::-webkit-scrollbar-track { background: var(--gray-100); border-radius: 3px; }
.hourly-scroll::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

.hourly-item {
  flex: 0 0 auto;
  width: 80px;
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  border: 1px solid transparent;
  scroll-snap-align: start;
  transition: all var(--transition);
}

.hourly-item:hover {
  border-color: var(--sky-200);
  background: var(--sky-50);
}

.hourly-item.now {
  background: var(--sky-100);
  border-color: var(--sky-300);
}

.hourly-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.hourly-icon svg { width: 36px; height: 36px; margin: 0 auto var(--space-xs); }

.hourly-temp {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hourly-rain {
  font-size: 0.6875rem;
  color: var(--sky-500);
  margin-top: 2px;
}

/* ============================================
   DAILY FORECAST
   ============================================ */
.daily-list { display: flex; flex-direction: column; gap: var(--space-xs); }

.daily-item {
  display: grid;
  grid-template-columns: 120px 40px 1fr 60px;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  transition: background var(--transition);
}

.daily-item:hover { background: var(--gray-50); }

.daily-day {
  font-weight: 600;
  font-size: 0.9375rem;
}

.daily-day small {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.daily-icon svg { width: 36px; height: 36px; }

.daily-bar-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.daily-temp-min {
  font-size: 0.875rem;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

.daily-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--gray-200);
  position: relative;
  overflow: hidden;
}

.daily-bar-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--sky-400), var(--amber-400));
}

.daily-temp-max {
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 36px;
}

.daily-condition {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: right;
}

@media (max-width: 600px) {
  .daily-item {
    grid-template-columns: 80px 32px 1fr 50px;
    gap: var(--space-sm);
    padding: var(--space-sm);
  }
}

/* ============================================
   CITY GRID (Homepage)
   ============================================ */
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}

.city-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  text-decoration: none;
  color: inherit;
}

.city-card:hover { color: inherit; }

.city-card-icon svg { width: 48px; height: 48px; }

.city-card-info { flex: 1; }

.city-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.city-card-condition {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.city-card-temp {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* ============================================
   WEATHER DETAILS GRID
   ============================================ */
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.detail-card {
  text-align: center;
  padding: var(--space-lg);
}

.detail-card svg { width: 28px; height: 28px; color: var(--accent); margin: 0 auto var(--space-sm); }

.detail-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.detail-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.detail-unit {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ============================================
   SEO CONTENT SECTIONS
   ============================================ */
.seo-content {
  max-width: 800px;
  margin: 0 auto;
}

.seo-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.seo-content h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: var(--space-lg) 0 var(--space-sm);
  color: var(--sky-800);
}

.seo-content p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  line-height: 1.8;
}

.seo-content ul {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.seo-content ul li {
  list-style: disc;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ============================================
   FAQ SECTION
   ============================================ */
.faq-list { max-width: 800px; margin: 0 auto; }

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: var(--space-md) 0;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color var(--transition);
}

.faq-question:hover { color: var(--accent); }

.faq-question svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.faq-item.open .faq-question svg { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer { max-height: 500px; }

.faq-answer p {
  padding-bottom: var(--space-md);
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-md);
}

.footer-col a {
  display: block;
  color: var(--gray-400);
  font-size: 0.875rem;
  padding: 3px 0;
  transition: color var(--transition);
}

.footer-col a:hover { color: var(--white); }

.footer-col p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--gray-400);
}

.footer-bottom {
  border-top: 1px solid var(--gray-700);
  padding-top: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.8125rem;
  color: var(--gray-500);
}

/* ============================================
   LEGAL PAGES
   ============================================ */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md);
}

.legal-content h1 {
  font-size: 2rem;
  margin-bottom: var(--space-lg);
}

.legal-content h2 {
  font-size: 1.25rem;
  margin: var(--space-xl) 0 var(--space-sm);
  color: var(--sky-800);
}

.legal-content p, .legal-content li {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.legal-content ul { padding-left: var(--space-lg); }
.legal-content ul li { list-style: disc; }

/* ============================================
   CONTACT PAGE
   ============================================ */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color var(--transition);
  background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(12,147,241,0.1);
}

.form-group textarea { min-height: 150px; resize: vertical; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-xl);
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all var(--transition);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   LOADING SKELETON
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton-text { height: 16px; margin-bottom: 8px; }
.skeleton-title { height: 32px; width: 60%; margin-bottom: 12px; }
.skeleton-icon { width: 64px; height: 64px; border-radius: var(--radius-md); }

/* ============================================
   INTERNAL LINKS SECTION
   ============================================ */
.internal-links {
  background: var(--sky-50);
  border: 1px solid var(--sky-200);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.internal-links h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--sky-800);
}

.internal-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-sm);
}

.internal-links-grid a {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--sky-700);
  transition: all var(--transition);
}

.internal-links-grid a:hover {
  background: var(--sky-100);
}

.internal-links-grid a::before {
  content: '→';
  font-size: 0.75rem;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-xl); }
.mt-3 { margin-top: var(--space-2xl); }
.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-xl); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
