/* ══════════════════════════════════════════════
   Brisas do Pinhal — "Light Breeze" Premium Theme
   Estética Limpa, Suave, Orgânica e Inovadora
   ══════════════════════════════════════════════ */

:root {
  /* Cores Base » tons orgânicos e neutros claros */
  --bg-color: #f7fbfa;        /* Fundo super suave, leve esverdeado/azulado */
  --card-bg: #ffffff;         /* Cards brancos para contraste limpo */
  
  /* Textos */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  
  /* Acentos de Cor Pastel */
  --accent-blue: #3b82f6;
  --accent-teal: #14b8a6;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-orange: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-yellow: #eab308;
  
  /* Variáveis esperadas pelo app.js (para gráficos) */
  --accent: var(--accent-blue);
  --accent-2: var(--accent-teal);

  /* Utils / Layout */
  --shadow-soft: 0 12px 40px -8px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 20px 48px -12px rgba(15, 23, 42, 0.08);
  --radius-sm: 16px;
  --radius-md: 20px;
  --radius-lg: 28px;
  
  --gap: 20px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ── AMBIENT GRADIENTS (Light effect) ── */
.ambient-gradient {
  position: fixed;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.4;
  border-radius: 50%;
  animation: gentleFloat 15s infinite alternate ease-in-out;
  pointer-events: none;
}
.primary-grad {
  top: -10%; left: -5%;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.15) 0%, transparent 60%);
}
.secondary-grad {
  bottom: 0; right: 0;
  width: 60vw; height: 40vw;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
  animation-delay: -5s;
}
@keyframes gentleFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(30px) scale(1.05); }
}

[hidden] { display: none !important; }

/* ─────────────────────────────────────────────────────────────
   LAYOUT ARCHITECTURE
   ───────────────────────────────────────────────────────────── */
.layout-container {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
@media (max-width: 992px) {
  .layout-container {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }
}

/* ── HEADER / SIDEBAR ── */
.app-header {
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0,0,0,0.03);
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(to right, rgba(255,255,255,0.8), rgba(255,255,255,0.4));
  backdrop-filter: blur(12px);
  z-index: 50;
}
@media (max-width: 992px) {
  .app-header {
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    padding: 24px 20px;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}
@media (max-width: 992px) {
  .brand { margin-bottom: 24px; }
}

.brand-icon-wrapper {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.25);
}
.brand-leaf { width: 24px; height: 24px; }

.bounce-soft { animation: bounce-s 3s infinite alternate ease-in-out; }
@keyframes bounce-s {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.header-date {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Nav */
.main-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (max-width: 992px) {
  .main-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .main-nav::-webkit-scrollbar { display: none; }
}

.main-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
}
@media (max-width: 992px) {
  .main-nav a { white-space: nowrap; padding: 10px 16px; }
}

.main-nav a svg { width: 20px; height: 20px; opacity: 0.7; }

.main-nav a:hover {
  background: rgba(0,0,0,0.03);
  color: var(--text-primary);
}

.main-nav a.active {
  background: white;
  color: var(--accent-blue);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.main-nav a.active svg { opacity: 1; }

.mt-auto { margin-top: auto; }
.hidden-mobile { display: block; }
@media (max-width: 992px) {
  .hidden-mobile { display: none; }
}

/* Status Footer (Sidebar) */
.footer-status {
  background: white;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,0,0,0.04);
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.ping-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
  animation: ping-pulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes ping-pulse {
  75%, 100% { transform: scale(2.5); opacity: 0; }
}

.foot-refresh {
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-light);
}
#age, #age-mobile { color: var(--text-secondary); font-weight: 600; }

.mobile-footer {
  display: none;
  background: white;
  padding: 12px 20px;
  border-top: 1px solid rgba(0,0,0,0.04);
  position: sticky;
  bottom: 0;
  z-index: 50;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}
@media (max-width: 992px) {
  .visible-mobile { display: flex; }
}


/* ─────────────────────────────────────────────────────────────
   MAIN CONTENT & COMPONENTS
   ───────────────────────────────────────────────────────────── */
.main-content {
  padding: clamp(24px, 4vw, 40px);
  width: 100%;
}

.soft-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255,255,255,0.7); /* Efeito clean crisp edge */
}

/* Secções visuais */
.view-section {
  animation: blurIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes blurIn {
  0% { opacity: 0; transform: translateY(15px) scale(0.98); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ── HERO DASHBOARD ── */
.hero-dashboard {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
@media (max-width: 800px) {
  .hero-dashboard { grid-template-columns: 1fr; }
}

.hero-primary {
  padding: 32px;
  background: linear-gradient(135deg, #ffffff, #fdfdfc);
}
.hero-header {
  margin-bottom: 24px;
}
.tag {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-body {
  display: flex;
  align-items: center;
  gap: 40px;
}
@media (max-width: 500px) {
  .hero-body { flex-direction: column; align-items: flex-start; gap: 24px; }
}

.weather-icon-container {
  width: 140px; height: 140px;
}
.now-icon-img {
  width: 100%; height: 100%;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.1));
}

.temp-display {
  display: flex;
  flex-direction: column;
}
.temp-huge {
  font-size: clamp(60px, 8vw, 90px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1;
}
.temp-huge .unit {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  color: var(--text-light);
  margin-left: 2px;
}

.temp-extremes {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.ext-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}
.max-pill { background: rgba(244, 63, 94, 0.08); color: var(--accent-rose); }
.min-pill { background: rgba(59, 130, 246, 0.08); color: var(--accent-blue); }

.feels-like {
  margin-top: 16px;
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.feels-like strong { color: var(--text-primary); font-weight: 800; }

.hero-side {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.sun-card {
  padding: 24px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}
.card-icon {
  width: 48px; height: 48px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}
.card-icon svg { width: 24px; height: 24px; stroke-width: 2.5; }
.sunrise-bg { background: rgba(245, 158, 11, 0.1); color: var(--accent-orange); }
.sunset-bg { background: rgba(99, 102, 241, 0.1); color: var(--accent-indigo); }

.sun-info { display: flex; flex-direction: column; gap: 4px; }
.lbl { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-light); letter-spacing: 0.05em; }
.val { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); }


/* ── METRICS GRID ── */
.metrics-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.metric-box {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.metric-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.wide-card { grid-column: span 2; }
@media (max-width: 580px) { .wide-card { grid-column: span 1; } }

.mb-top { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.m-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.m-icon svg { width: 20px; height: 20px; }
.icon-blue { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.icon-teal { background: rgba(20, 184, 166, 0.1); color: var(--accent-teal); }
.icon-gray { background: rgba(100, 116, 139, 0.1); color: var(--text-secondary); }
.icon-purple { background: rgba(139, 92, 246, 0.1); color: var(--accent-purple); }
.icon-orange { background: rgba(245, 158, 11, 0.1); color: var(--accent-orange); }
.icon-rain { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.icon-yellow { background: rgba(234, 179, 8, 0.1); color: var(--accent-yellow); }

.m-label { font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); }
.m-badge { margin-left: auto; background: var(--bg-color); padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 800; }

.mb-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex; align-items: baseline; gap: 4px;
}
.m-unit { font-size: 1rem; font-weight: 600; color: var(--text-light); }

/* Double value layout */
.mb-split { display: flex; gap: 24px; align-items: stretch; }
.val-group { display: flex; flex-direction: column; gap: 4px; }
.val-divider { width: 1px; background: rgba(0,0,0,0.06); }
.val-label { font-size: 0.75rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; }

.highlight-card {
  position: relative; overflow: hidden;
}
.highlight-card::before {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 4px;
  background: var(--accent-blue); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}


/* ── CHARTS & FORECASTS ── */
.details-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--gap);
}
@media (max-width: 992px) {
  .details-grid { grid-template-columns: 1fr; }
}

.chart-container, .forecast-container { padding: 28px; }

.card-header-clean {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}
.card-header-clean h2 { font-size: 1rem; font-weight: 700; color: var(--text-primary); }

.chart-legend-clean { display: flex; gap: 16px; }
.l-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.tint-blue { background: var(--accent-blue); }
.tint-teal { background: var(--accent-teal); }

.chart-canvas { height: clamp(260px, 30vh, 360px); width: 100%; }

.forecast-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.forecast-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg-color); border-radius: var(--radius-md);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.forecast-list .d { font-weight: 700; color: var(--text-secondary); width: 60px; text-transform: capitalize; }
.forecast-list .ic img { width: 36px; height: 36px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05)); }
.forecast-list .t { font-weight: 800; display: flex; gap: 12px; }
.forecast-list .hi { color: var(--accent-rose); }
.forecast-list .lo { color: var(--accent-blue); }

/* ── EMPTY STATES & CLIMA TABLE ── */
.empty-state-card {
  padding: 80px 20px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.empty-icon-wrap {
  width: 80px; height: 80px; border-radius: 50%; background: var(--bg-color);
  display: flex; align-items: center; justify-content: center; color: var(--text-light); margin-bottom: 12px;
}
.empty-icon-wrap svg { width: 40px; height: 40px; }

.mb-gap { margin-bottom: var(--gap); padding: 28px; }
.table-card { padding: 4px; overflow: hidden; }

.custom-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.custom-scroll::-webkit-scrollbar { height: 6px; }
.custom-scroll::-webkit-scrollbar-track { background: var(--bg-color); }
.custom-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

.clean-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.clean-table th, .clean-table td { padding: 16px; text-align: center; border-bottom: 1px solid rgba(0,0,0,0.04); font-size: 0.9rem; }
.clean-table thead th { font-weight: 700; color: var(--text-secondary); background: var(--bg-color); }
.clean-table th:first-child { text-align: left; position: sticky; left: 0; background: white; z-index: 2; border-right: 1px solid rgba(0,0,0,0.04); }
.clean-table tbody tr:hover td, .clean-table tbody tr:hover th { background: rgba(0,0,0,0.015); }

.is-hot { color: var(--accent-rose); font-weight: 800; }
.is-cold { color: var(--accent-blue); font-weight: 800; }

.climate-chart { height: 320px; }

/* Pulse Update Animation */
.pulse { animation: highlight-val 0.6s ease-out; }
@keyframes highlight-val {
  0% { transform: scale(1); color: inherit; }
  30% { transform: scale(1.05); color: var(--accent-blue); }
  100% { transform: scale(1); color: inherit; }
}

/* Compasso Visão de Vento */
.wind-split { align-items: center; }
.compass-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  flex: 1;
}

.compass {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 4px solid var(--glass-border);
  background: var(--bg-color);
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.06), inset 0 0 0 2px rgba(255,255,255,1), 0 4px 12px rgba(0,0,0,0.04);
}

.c-marker {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  border: 2px dashed rgba(0,0,0,0.06);
  margin: 6px;
}

.c-dir {
  position: absolute;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-light);
  font-family: inherit;
}
.c-dir.n { top: 6px; left: 50%; transform: translateX(-50%); color: var(--accent-rose); font-size: 0.75rem; }
.c-dir.s { bottom: 6px; left: 50%; transform: translateX(-50%); }
.c-dir.e { right: 8px; top: 50%; transform: translateY(-50%); }
.c-dir.w { left: 8px; top: 50%; transform: translateY(-50%); }

.c-dir.ne { top: 16px; right: 16px; font-size: 0.5rem; opacity: 0.6; }
.c-dir.nw { top: 16px; left: 16px; font-size: 0.5rem; opacity: 0.6;}
.c-dir.se { bottom: 16px; right: 16px; font-size: 0.5rem; opacity: 0.6; }
.c-dir.sw { bottom: 16px; left: 16px; font-size: 0.5rem; opacity: 0.6; }

.c-arrow-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.c-arrow {
  width: 8px;
  height: 80px;
  position: relative;
}

.c-arrow::before {
  content: '';
  position: absolute;
  bottom: 50%; left: 0; right: 0; top: 0;
  background: linear-gradient(to top, #f43f5e, #e11d48);
  clip-path: polygon(50% 0%, 100% 100%, 50% 90%, 0% 100%);
}

.c-arrow::after {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, #cbd5e1, #94a3b8);
  clip-path: polygon(50% 100%, 100% 0%, 50% 10%, 0% 0%);
}

.c-pivot {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  background: white;
  border: 2px solid #334155;
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
