/* =====================================================
   section_hero.css
   ===================================================== */

/* ===== WRAPPER ===== */
.dashboard-wrapper {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 14px;
    padding: 16px 12px 12px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    margin-top: -14px;
    align-items: stretch;
}

/* ===== LEFT COLUMN ===== */
.dash-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

/* ===== RIGHT COLUMN ===== */
.dash-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== HERO CARD ===== */
.hero-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 18px 20px;
    box-shadow:
        0 8px 24px rgba(15,23,42,0.10),
        0 2px 8px rgba(15,23,42,0.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: background 0.4s ease, border-color 0.4s ease;
}

/* AQHI States */
.hero-card.hero-low       { background: #eff6ff; border-color: #93c5fd; }
.hero-card.hero-moderate  { background: #fefce8; border-color: #fde047; }
.hero-card.hero-high      { background: #fef2f2; border-color: #f87171; }
.hero-card.hero-very-high { background: #450a0a; border-color: #7f1d1d; }

/* White text on very-high */
.hero-card.hero-very-high .hero-top-label,
.hero-card.hero-very-high .hero-top-left i,
.hero-card.hero-very-high .hero-aqi-label,
.hero-card.hero-very-high .hero-temp,
.hero-card.hero-very-high .hero-climate-label,
.hero-card.hero-very-high .hero-climate-val,
.hero-card.hero-very-high .hero-poll-label,
.hero-card.hero-very-high .hero-poll-unit,
.hero-card.hero-very-high .hero-poll-val,
.hero-card.hero-very-high .hero-scale-title,
.hero-card.hero-very-high .hero-scale-badge,
.hero-card.hero-very-high .hero-scale-nums { color: #ffffff !important; }

.hero-card.hero-very-high .hero-status-box   { background: rgba(255,255,255,0.08); }
.hero-card.hero-very-high .hero-status-title { color: #fca5a5 !important; }
.hero-card.hero-very-high .hero-status-text  { color: #ffffff !important; }
.hero-card.hero-very-high .hero-climate-item { background: rgba(255,255,255,0.08); }
.hero-card.hero-very-high .hero-poll-card    { background: rgba(255,255,255,0.08); }

/* Top row */
.hero-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hero-top-left {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
}
.hero-top-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    color: #64748b;
}
.hero-status {
    background: #f59e0b;
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: inline-block;
}

/* Main row */
.hero-main-row {
    display: flex;
    align-items: stretch;
    gap: 14px;
}
.hero-aqi-left { flex-shrink: 0; }
.hero-aqi-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin: 0 0 2px;
}
.hero-temp {
    font-size: 56px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1;
}
.hero-status-box {
    flex: 1;
    background: rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.hero-status-title {
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.06em;
    margin: 0 0 4px;
}
.hero-status-text {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
}

/* Climate row */
.hero-climate-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.hero-climate-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.05);
    padding: 10px 12px;
    border-radius: 12px;
}
.hero-climate-item i { font-size: 18px; color: #f59e0b; }
.hero-climate-label {
    font-size: 9px;
    letter-spacing: 0.08em;
    color: #64748b;
    margin: 0 0 2px;
    font-weight: 600;
}
.hero-climate-val {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

/* Pollutant cards */
.hero-pollutant-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.hero-poll-card {
    background: rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.hero-poll-label {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.hero-poll-unit {
    font-size: 9px;
    color: #94a3b8;
    margin: 0;
    letter-spacing: 0.04em;
}
.hero-poll-val {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 4px 0 6px;
    line-height: 1;
}
.hero-poll-bar {
    height: 3px;
    border-radius: 3px;
    background: #22c55e;
    width: 20%;
    transition: width 0.5s ease, background 0.4s ease;
}

/* Scale section */
.hero-scale-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hero-scale-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hero-scale-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #64748b;
}
.hero-scale-badge {
    font-size: 10px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.03em;
}
.hero-scale-bar {
    position: relative;
    display: flex;
    height: 8px;
    border-radius: 6px;
    overflow: visible;
}
.hs-seg { height: 100%; }

/* Low: 1-3 (rentang 2)      -> proporsi 2/11 */
.hs-low      { flex: 3;  background: #3b82f6; }
/* Moderate: 3-6 (rentang 3) -> proporsi 3/11 */
.hs-moderate { flex: 3;  background: #eab308; }
/* High: 6-10 (rentang 4)    -> proporsi 4/11 */
.hs-high     { flex: 3;  background: #ef4444; }
/* Very High: 10-11+ (rentang 2 representatif) -> proporsi 2/11 */
.hs-veryhigh { flex: 2;  background: #7f1d1d; }
.hs-seg:first-child { border-radius: 10px 0 0 10px; }
.hs-seg:last-child  { border-radius: 0 10px 10px 0; }
.hero-scale-needle {
    position: absolute;
    top: -4px;
    width: 18px; height: 18px;
    background: #fff;
    border: 3px solid #0f172a;
    border-radius: 50%;
    transform: translateX(-50%);
    transition: left 0.5s ease;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.hero-scale-wrap {
    position: relative;
    margin-top: 0;
}

.hero-scale-nums {
    position: relative;
    height: 16px;
    margin-top: 4px;
}

.hero-scale-nums span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

.hero-scale-nums span:first-child { transform: translateX(0); }
.hero-scale-nums span:last-child  { transform: translateX(-100%); }

/* ===== ASTHMA RISK CARD ===== */
.asthma-risk-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 5px;
    border-radius: 14px;
    box-shadow:
        0 4px 12px rgba(15,23,42,0.05),
        0 1px 3px rgba(15,23,42,0.08);
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    transition: box-shadow 0.2s, background 0.4s, border-color 0.4s;
}
.asthma-risk-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.11); }
.asthma-risk-indicator {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    border-radius: 14px 0 0 14px;
    transition: background 0.4s;
}
.asthma-risk-icon-wrap {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 8px;
    font-size: 17px;
    transition: background 0.4s;
}
.asthma-risk-content { flex: 1; min-width: 0; }
.asthma-risk-title {
    font-weight: 700;
    font-size: 13px;
    margin: 0;
    transition: color 0.4s;
}
.asthma-risk-desc { display: none; }
.asthma-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    color: #fff;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* ===== HEALTH CARD ===== */
.health-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 18px 20px;
    box-shadow:
        0 4px 12px rgba(15,23,42,0.05),
        0 1px 3px rgba(15,23,42,0.08);
}
.health-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.health-header h3 {
    margin: 0;
    font-size: 16px;
    color: #0f172a;
    font-weight: 600;
}
.health-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.health-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #334155;
    line-height: 1.4;
}
.health-item i { color: #22c55e; flex-shrink: 0; font-size: 15px; margin-top: 2px; }

/* ===== GAUGE ROW ===== */
.gauge-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.gauge-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow:
        0 4px 12px rgba(15,23,42,0.05),
        0 1px 3px rgba(15,23,42,0.08);
    padding: 16px 10px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.gauge-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 10px 24px rgba(15,23,42,0.10),
        0 4px 8px rgba(15,23,42,0.08);
}
.gauge-card:active { transform: scale(0.97); }
.gauge-wrapper {
    position: relative;
    width: 90px; height: 90px;
    margin: 0 auto 8px;
}
.gauge-wrapper canvas { width: 100% !important; height: 100% !important; }
.gauge-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    pointer-events: none;
}
.gauge-value { font-weight: 700; font-size: 15px; color: #0f172a; white-space: nowrap; }
.gauge-unit  { font-size: 9px; color: #64748b; }
.gauge-label {
    font-size: 12px;
    margin: 0;
    color: #475569;
    font-weight: 500;
}

/* factor */

/* =====================================================
   section_risk_factor.css
   Card "Faktor Risiko Terdeteksi" — elemen full-width
   berdiri sendiri (di luar grid kiri/kanan dashboard),
   diletakkan tepat di bawah dashboard-wrapper dan sebelum
   "AQHI Forecast". Mengikuti style visual card full-width
   lain (.timeline-card / .history-card-box di
   section_history.css) agar konsisten: border, shadow,
   radius, dan max-width yang sama.
   ===================================================== */

.risk-factor-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px 28px 22px;
    box-shadow: 0 4px 12px rgba(1, 21, 63, 0.16);
    /* Card ini berdiri langsung tanpa parent wrapper (tidak seperti
       .dashboard-wrapper/.history-wrapper yang punya padding 0 12px
       sendiri), jadi jarak ke tepi viewport disamakan secara manual
       lewat margin kiri-kanan 12px + max-width yang menyesuaikan. */
    width: calc(100% - 24px);
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.risk-factor-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.risk-factor-header i {
    color: #f97316;
    font-size: 16px;
}
.risk-factor-header h3 {
    margin: 0;
    font-size: 16px;
    color: #0f172a;
    font-weight: 600;
}

/* ---- Skor Kontribusi per parameter (grid 4 kolom, full-width) ---- */
.risk-factor-score-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.risk-factor-score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.03);
    border-radius: 10px;
}
.risk-factor-score-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #0f172a;
}
.risk-factor-score-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.risk-factor-score-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    color: #fff;
    white-space: nowrap;
}

/* ---- Responsive ----
   Tablet: 2 kolom. Mobile: 1 kolom supaya badge tidak terpotong. */
@media (max-width: 900px) {
    .risk-factor-score-list {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .risk-factor-card {
        padding: 18px 16px;
    }
    .risk-factor-score-list {
        grid-template-columns: 1fr;
    }
}