/* === RESET & BASE — ASSET V2 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { background: #f3f4f6; scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #1f2937;
    min-height: 100vh;
}

/* === HEADER === */
header {
    background: #fff;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 #e5e7eb, 0 4px 16px rgba(0,0,0,0.06);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 60px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.brand-text strong {
    font-size: 18px;
    color: #166534;
    display: block;
    line-height: 1.1;
}

.brand-text span {
    font-size: 12px;
    color: #16a34a;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    align-items: center;
    flex: 1;
}

.main-nav a {
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 11px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.main-nav a:hover {
    background: #f0fdf4;
    color: #16a34a;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    font-size: 17px;
    transition: background 0.15s;
}

.icon-link:hover { background: #f0fdf4; }

.btn-cta {
    display: inline-block;
    background: #16a34a;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 9px 18px;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(22,163,74,0.3);
    transition: background 0.15s, transform 0.15s;
}

.btn-cta:hover { background: #15803d; transform: translateY(-1px); }

/* === HERO === */
.hero {
    background: linear-gradient(135deg, #166534 0%, #16a34a 50%, #4ade80 100%);
    padding: 56px 24px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(0,0,0,0.1) 0%, transparent 40%);
}

.hero-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 5px 14px;
    border-radius: 999px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: #facc15;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-left h1 {
    max-width: 850px;
    font-size: clamp(20px, 2.5vw, 30px);
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.hero-school {
    color: rgba(255,255,255,0.88);
    font-size: clamp(16px, 1.5vw, 21px);
    font-weight: 500;
    margin-bottom: 12px;
}

.hero-station-details {
    display: grid;
    gap: 5px;
    margin-bottom: 10px;
}

.hero-coordinates {
    color: rgba(255,255,255,0.95);
    font-size: clamp(14px, 1.2vw, 17px);
    font-weight: 500;
    letter-spacing: 0.4px;
}

.hero-coordinates strong {
    color: #fff;
    font-weight: 700;
}

.hero-date {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin-bottom: 16px;
}

.hero-update {
    display: inline-block;
    background: rgba(0,0,0,0.2);
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
}

.hero-right { flex-shrink: 0; }

.hero-temp-card {
    padding: 32px 48px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.hero-temp {
    font-size: 80px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    letter-spacing: -2px;
}

.hero-temp-label {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* === DASHBOARD === */
.dashboard {
    max-width: 1400px;
    margin: 32px auto;
    padding: 0 24px 40px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Temperatura ocupa 1 col, altura 2 linhas */
.card-temp { grid-row: span 2; }

/* === CARD BASE === */
.card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
    border: 1px solid #f3f4f6;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    font-size: 20px;
}

.card-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-body.center {
    align-items: center;
    justify-content: center;
}

/* === TEMPERATURA CARD === */
.thermo-wrap {
    display: flex;
    align-items: stretch;
    gap: 16px;
    justify-content: center;
    flex: 1;
    padding: 8px 0;
}

.thermo-tube {
    width: 48px;
    background: #f3f4f6;
    border-radius: 999px;
    border: 2px solid #e5e7eb;
    position: relative;
    min-height: 200px;
    flex-shrink: 0;
}

.thermo-fill {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    background: linear-gradient(180deg, #facc15 0%, #16a34a 60%, #166534 100%);
    border-radius: 999px;
    transition: height 0.6s cubic-bezier(0.34,1.56,0.64,1);
    height: 50%;
}

.thermo-scale {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 600;
    padding: 4px 0;
}

.temp-badges {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.temp-badge {
    flex: 1;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.temp-badge.current {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.badge-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
}

.badge-value {
    font-size: 26px;
    font-weight: 800;
    color: #166534;
}

/* === HUMIDADE RING === */
.ring-gauge {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ring-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: #f3f4f6;
    stroke-width: 10;
}

.ring-fill {
    fill: none;
    stroke: url(#humGrad);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 314.15;
    stroke-dashoffset: 314.15;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.34,1.56,0.64,1);
}

.ring-svg defs { display: none; }

/* inject gradient via inline */
.ring-fill { stroke: #16a34a; }

.ring-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.ring-value {
    font-size: 30px;
    font-weight: 800;
    color: #166534;
    line-height: 1;
}

.ring-label {
    font-size: 10px;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* === VENTO === */

.speedo-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.speedometer {
    position: relative;
    width: 160px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.speedo-needle-wrap {
    position: absolute;
    /* Este valor (bottom) alinha o "prego" da agulha com a base do arco */
    bottom: 10px; 
    left: 50%;
    width: 4px;
    height: 60px; /* Comprimento total da agulha */
    transform: translateX(-50%);
    /* FIXA O PONTO DE ROTAÇÃO NA BASE EXATA */
    transform-origin: bottom center; 
    z-index: 10;
}

.speedo-needle {
    position: absolute;
    width: 4px;
    height: 54px;         /* Comprimento da agulha */
    background: #166534;
    border-radius: 4px;
    left: 50%;
    margin-left: -2px;    /* Centra a agulha */
    bottom: 10px;         /* Alinha com a base do arco */
    
    /* FIXA O EIXO NA BASE DA AGULHA */
    transform-origin: bottom center; 
    
    /* Transição suave para o movimento ser automático e fluído */
    transition: transform 0.8s cubic-bezier(0.17, 0.67, 0.83, 0.67);
    z-index: 10;
}

.speedo-value {
    position: relative;
    z-index: 2;
    font-size: 18px;
    font-weight: 800;
    color: #166534;
    padding-top: 8px;
    text-align: center;
    width: 100%;
}

.compass-wrap { margin-top: 8px; }

.wind-compass {
    position: relative;
    width: 100px;
    height: 100px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    background: #f9fafb;
}

.cp {
    position: absolute;
    font-size: 10px;
    font-weight: 800;
    color: #6b7280;
}

.cp-n { top: 4px; left: 50%; transform: translateX(-50%); }
.cp-s { bottom: 4px; left: 50%; transform: translateX(-50%); }
.cp-e { right: 4px; top: 50%; transform: translateY(-50%); }
.cp-w { left: 4px; top: 50%; transform: translateY(-50%); }

.compass-needle {
    position: absolute;
    left: 50%; 
    top: 50%;
    width: 3px;
    height: 30px;
    background: #ef4444; /* Cor vermelha para destacar a direção */
    border-radius: 3px;
    /* IMPORTANTE: */
    transform-origin: bottom center; 
    transform: translate(-50%, -100%) rotate(0deg); 
    transition: transform 0.5s ease-out;
    z-index: 5;
}

.compass-needle::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid #16a34a;
}

.compass-dot {
    position: absolute;
    left: 50%; top: 50%;
    width: 8px; height: 8px;
    background: #166534;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* === CHUVA === */
.rain-value-big {
    font-size: 36px;
    font-weight: 800;
    color: #166534;
    text-align: center;
}

.rain-bar-wrap { width: 100%; }

.rain-bar-track {
    height: 16px;
    background: #f3f4f6;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    position: relative;
}

.rain-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    border-radius: 999px;
    width: 0%;
    transition: width 0.5s ease;
}

.rain-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
    font-weight: 600;
}

.rain-drops {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
    font-size: 20px;
}

.rain-drops span {
    transition: opacity 0.4s;
    color: #3b82f6;
}

/* === PRESSÃO === */
.baro-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.baro {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.baro-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.baro-needle {
    position: absolute;
    left: 50%; top: 50%;
    width: 4px;
    height: 64px;
    background: linear-gradient(180deg, #16a34a, #166534);
    border-radius: 4px;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    transition: transform 0.5s ease;
    box-shadow: 0 0 8px rgba(22,163,74,0.4);
    z-index: 3;
}

.baro-center {
    position: absolute;
    left: 50%; top: 50%;
    width: 14px; height: 14px;
    background: #fff;
    border: 3px solid #166534;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
}

.baro-labels {
    position: absolute;
    inset: 0;
}

.baro-labels span {
    position: absolute;
    top: 50%; left: 50%;
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    transform: rotate(var(--a)) translateY(-80px) rotate(calc(-1 * var(--a)));
    transform-origin: center;
    width: 40px;
    text-align: center;
    margin-left: -20px;
    margin-top: -8px;
}

.baro-value {
    font-size: 28px;
    font-weight: 800;
    color: #166534;
    text-align: center;
}

.baro-status {
    display: inline-block;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 999px;
}

/* === QUALIDADE DO AR === */
.card-air .card-body {
    gap: 8px;
}

.aqi-circle {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    width: 130px;
    height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.aqi-circle .wi {
    font-size: 28px;
    color: #22c55e;
}

.aqi-number {
    font-size: 36px;
    font-weight: 900;
    color: #166534;
    line-height: 1;
}

.aqi-sub {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
}

.aqi-status {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    text-align: center;
    line-height: 1.2;
}

.aqi-meta {
    display: grid;
    gap: 1px;
    width: 100%;
    max-width: 220px;
    font-size: clamp(8px, 0.62vw, 10px);
    line-height: 1.25;
    color: #6b7280;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.aqi-source {
    width: 100%;
    font-size: clamp(8px, 0.56vw, 9px);
    line-height: 1.2;
    color: #9ca3af;
    text-align: center;
}

.aqi-source a,
.aqi-source a:visited {
    color: #166534;
    font-weight: 600;
    text-decoration: none;
}

.aqi-source a:hover,
.aqi-source a:focus-visible {
    text-decoration: underline;
}

/* === ÍNDICE UV === */
.uv-big {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.uv-number {
    font-size: 64px;
    font-weight: 900;
    color: #166534;
    line-height: 1;
}

.uv-status-badge {
    display: inline-block;
    background: #fefce8;
    border: 1px solid #fde68a;
    color: #854d0e;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 999px;
}

.uv-track {
    width: 100%;
    max-width: 220px;
    position: relative;
    margin-top: 8px;
}

.uv-bar {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        #22c55e 0%,
        #facc15 30%,
        #f97316 55%,
        #ef4444 75%,
        #a855f7 100%
    );
}

.uv-thumb {
    position: absolute;
    top: -5px;
    left: 0%;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 3px solid #374151;
    border-radius: 50%;
    transform: translateX(-50%);
    transition: left 0.8s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.uv-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #9ca3af;
    font-weight: 600;
    margin-top: 6px;
}

/* === FOOTER === */
.footer {
    background: #fff;
    padding: 32px 24px;
    border-top: 1px solid #e5e7eb;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.footer-text strong {
    display: block;
    font-size: 20px;
    color: #166534;
    line-height: 1.1;
}

.footer-text span {
    display: block;
    font-size: 13px;
    color: #16a34a;
    font-weight: 600;
}

.footer-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.footer-contact {
    text-align: right;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

.footer-contact p { margin: 0; }

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.footer-link {
    color: #16a34a;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.15s;
}

.footer-link:hover { color: #166534; text-decoration: underline; }

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .dashboard {
        grid-template-columns: repeat(3, 1fr);
    }
    .card-temp { grid-row: span 2; }
}

@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
    .card-temp { grid-row: span 1; }
    .hero-temp { font-size: 60px; }
}

@media (max-width: 640px) {
    .dashboard {
        grid-template-columns: 1fr;
        padding: 0 16px 32px;
    }
    .card-pressure { grid-column: 1; }
    .hero-inner { flex-direction: column; text-align: center; }
    .hero { padding: 36px 20px; }
    .header-inner { flex-wrap: wrap; }
    .main-nav { width: 100%; }
    .footer-inner { flex-direction: column; }
    .footer-info { align-items: flex-start; }
    .footer-contact { text-align: left; }
    .footer-links { align-items: flex-start; }
}
