/* ========================================
   Udara Jakarta - Homepage Styles
   Khusus untuk index.html
   ======================================== */

/* ----------------------------------------
   Hero Section - AQI Style
   ---------------------------------------- */

/* Dynamic gradient backgrounds based on ISPU level */
.hero-aqi-gradient {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    transition: background 0.8s ease;
}

/* ISPU Level Gradients */
.hero-aqi-gradient.ispu-baik {
    background: linear-gradient(180deg, #1a3c2e 0%, #0d2818 50%, #0f3d28 100%);
}

.hero-aqi-gradient.ispu-sedang {
    background: linear-gradient(180deg, #1c6cab 0%, #134d80 55%, #0a2f52 100%);
}

.hero-aqi-gradient.ispu-tidak-sehat {
    background: linear-gradient(180deg, #ebc026 0%, #deae02 50%, #7e6200 100%);
}

.hero-aqi-gradient.ispu-sangat-tidak-sehat {
    background: linear-gradient(180deg, #fc0000 0%, #940000 50%, #610000 100%);
}

.hero-aqi-gradient.ispu-berbahaya {
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 50%, #2a2a2a 100%);
}

/* Glass card - Dark variant */
.hero-glass-dark {
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Glass card - Light variant */
.hero-glass-light {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Text colors */
.hero-text-light {
    color: rgba(255, 255, 255, 0.95);
}

.hero-text-muted {
    color: rgba(255, 255, 255, 0.6);
}

/* ISPU number styling - dynamic color */
.hero-ispu-number {
    color: #c9a227; /* Default amber/gold color */
    transition: color 0.5s ease;
    font-variant-numeric: tabular-nums;
}

.hero-ispu-number.ispu-baik {
    color: #45c474;
}

.hero-ispu-number.ispu-sedang {
    color: #ffffff;
}

.hero-ispu-number.ispu-tidak-sehat {
    color: #ffffff;
}

.hero-ispu-number.ispu-sangat-tidak-sehat {
    color: #ffffff;
}

.hero-ispu-number.ispu-berbahaya {
    color: #999999;
}

/* Status badge */
.hero-status-badge {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.5s ease;
}

.hero-status-badge.ispu-baik {
    background: rgba(69, 196, 116, 0.2);
    border-color: rgba(69, 196, 116, 0.4);
    color: #6ee89a;
}

.hero-status-badge.ispu-sedang {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.hero-status-badge.ispu-tidak-sehat {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.hero-status-badge.ispu-sangat-tidak-sehat {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.hero-status-badge.ispu-berbahaya {
    background: rgba(108, 108, 108, 0.3);
    border-color: rgba(108, 108, 108, 0.5);
    color: #d1d5db;
}

/* Live badge */
.hero-live-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* Locate me button hover */
#locate-me-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ISPU Scale marker animation */
#hero-scale-marker {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Legacy gradient text - keep for compatibility */
.hero-gradient-text {
    background: linear-gradient(
        180deg,
        #ffffff 85%,
        rgba(255, 255, 255, 0) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero Section Responsive */
@media (max-width: 640px) {
    .hero-aqi-gradient {
        padding-top: 5rem;
    }

    #hero-ispu-value {
        font-size: 80px !important;
    }

    .hero-glass-dark,
    .hero-glass-light {
        border-radius: 16px;
    }
}

@media (max-width: 1024px) {
    .hero-glass-dark {
        padding: 1.25rem;
    }
}

/* Hero mascot subtle animation */
#hero-mascot {
    animation: float 3s ease-in-out infinite;
}

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

/* Hero Glassmorphism Cards - Dark variant */
.hero-glass-card {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
}

.hero-glass-card:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.08) 100%
    );
}

/* Hero Glassmorphism Cards - Light/Solid variant */
.hero-glass-card-solid {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Hero text animation */
.hero-text-animate {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: heroFadeIn 1.2s ease-out forwards;
    animation-delay: 0.3s;
}

@keyframes heroFadeIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ----------------------------------------
   Map Styles
   ---------------------------------------- */
#jakarta-map {
    border-radius: 24px;
}

#jakarta-map .leaflet-control-zoom {
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

#jakarta-map .leaflet-control-zoom a {
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 18px;
    color: #333;
    border: none;
}

#jakarta-map .leaflet-control-zoom a:first-child {
    border-bottom: 1px solid #ccc;
}

#jakarta-map .leaflet-control-zoom a:hover {
    background-color: #f4f4f4;
}

#jakarta-map .leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 0;
}

#jakarta-map .leaflet-control-attribution a {
    color: #0078a8;
}

#jakarta-map .leaflet-bottom.leaflet-right {
    border-bottom-right-radius: 24px;
    overflow: hidden;
}

/* ----------------------------------------
   SPKU Map Markers
   ---------------------------------------- */
.spku-marker {
    width: 28px;
    height: 28px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 700;
    font-size: 9px;
    box-shadow: 0px 1.6px 5.5px 0px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.spku-marker:hover {
    transform: scale(1.15);
}

/* Marker Variants */
.spku-marker--baik {
    background-color: #e6ffe3;
    color: #009e02;
}

.spku-marker--sedang {
    background-color: #eaf9ff;
    color: #3dabdd;
}

.spku-marker--tidak-sehat {
    background-color: #fff6d3;
    color: #f5c800;
}

.spku-marker--sangat-tidak-sehat {
    background-color: #ffafbc;
    color: #ff3d40;
}

.spku-marker--berbahaya {
    background-color: #5c5c5c;
    color: white;
}

/* ----------------------------------------
   SPKU Tooltip
   ---------------------------------------- */
.spku-tooltip {
    background-color: #4ac25c;
    border-radius: 20px;
    padding: 12px 24px;
    min-width: 134px;
    position: relative;
    overflow: hidden;
}

.spku-tooltip::before {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #4ac25c;
}

.spku-tooltip__name {
    font-size: 10px;
    font-weight: 600;
    color: white;
    letter-spacing: -0.15px;
    margin-bottom: 6px;
}

.spku-tooltip__status {
    font-size: 10px;
    font-weight: 400;
    color: white;
    letter-spacing: -0.15px;
    margin-bottom: 6px;
}

.spku-tooltip__value {
    font-size: 12px;
    font-weight: 600;
    color: white;
    letter-spacing: -0.18px;
}

/* Tooltip Variants */
.spku-tooltip--baik {
    background-color: #4ac25c;
}
.spku-tooltip--baik::before {
    border-top-color: #4ac25c;
}

.spku-tooltip--sedang {
    background-color: #62a6ff;
}
.spku-tooltip--sedang::before {
    border-top-color: #62a6ff;
}

.spku-tooltip--tidak-sehat {
    background-color: #fcc600;
}
.spku-tooltip--tidak-sehat::before {
    border-top-color: #fcc600;
}

.spku-tooltip--sangat-tidak-sehat {
    background-color: #c72c41;
}
.spku-tooltip--sangat-tidak-sehat::before {
    border-top-color: #c72c41;
}

.spku-tooltip--berbahaya {
    background-color: #6a6a6a;
}
.spku-tooltip--berbahaya::before {
    border-top-color: #6a6a6a;
}

/* Leaflet tooltip override */
.leaflet-tooltip.spku-leaflet-tooltip {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.leaflet-tooltip.spku-leaflet-tooltip::before {
    display: none;
}

/* Leaflet marker container override */
.spku-marker-container {
    background: transparent !important;
    border: none !important;
}

/* Active marker state */
.spku-marker.active {
    transform: scale(1.2);
    box-shadow: 0px 3px 10px 0px rgba(0, 0, 0, 0.3);
}

/* Map popup card animation */
#map-popup-card {
    transition: transform 0.2s ease;
}

#map-popup-card.updating {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Map popup ISPU status - handle long text */
.map-popup-ispu-status {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* For very long status like "Sangat Tidak Sehat" */
.map-popup-ispu-status.long-text {
    font-size: 11px;
    white-space: normal;
    line-height: 1.2;
}

/* ----------------------------------------
   Recommendation Slider
   ---------------------------------------- */
.recommendation-slider {
    touch-action: pan-x;
    user-select: none;
    -webkit-user-select: none;
}

.recommendation-track {
    will-change: transform;
    transition: transform 0.3s ease;
}

.recommendation-track.dragging {
    transition: none;
}

.recommendation-slide {
    flex-shrink: 0;
    width: 100%;
}

.recommendation-dot {
    cursor: pointer;
    border: none;
    padding: 0;
}

.recommendation-dot:hover {
    opacity: 0.8;
}

/* ----------------------------------------
   Air Quality Card Colors
   ---------------------------------------- */
.bg-green-air {
    background-color: #45c474;
}

.text-green-air {
    color: #45c474;
}

.bg-gray-air {
    background-color: #6c6c6c;
}

.text-gray-air {
    color: #6c6c6c;
}

/* ----------------------------------------
   Meteorologi Chip Variants
   ---------------------------------------- */

/* Baik (Good) - ISPU 0-50 */
.meteo-chip-baik .meteo-chip-bottom {
    background-color: #f0fdf4;
}
.meteo-chip-baik .meteo-chip-text {
    color: #45c474;
}
.meteo-chip-baik .meteo-chip-icon-box {
    background-color: #45c474;
}

/* Sedang (Moderate) - ISPU 51-100 */
.meteo-chip-sedang .meteo-chip-bottom {
    background-color: #f0f7fd;
}
.meteo-chip-sedang .meteo-chip-text {
    color: #4591c4;
}
.meteo-chip-sedang .meteo-chip-icon-box {
    background-color: #4591c4;
}

/* Tidak Sehat (Unhealthy) - ISPU 101-200 */
.meteo-chip-tidak-sehat .meteo-chip-bottom {
    background-color: #fdd64b;
}
.meteo-chip-tidak-sehat .meteo-chip-text {
    color: #8c6c1d;
}
.meteo-chip-tidak-sehat .meteo-chip-icon-box {
    background-color: #facf39;
}

/* Sangat Tidak Sehat (Very Unhealthy) - ISPU 201-300 */
.meteo-chip-sangat-tidak-sehat .meteo-chip-bottom {
    background-color: #fdf0f0;
}
.meteo-chip-sangat-tidak-sehat .meteo-chip-text {
    color: #e05456;
}
.meteo-chip-sangat-tidak-sehat .meteo-chip-icon-box {
    background-color: #e05456;
}

/* Berbahaya (Hazardous) - ISPU 301+ */
.meteo-chip-berbahaya .meteo-chip-bottom {
    background-color: #e6e6e6;
}
.meteo-chip-berbahaya .meteo-chip-text {
    color: #6c6c6c;
}
.meteo-chip-berbahaya .meteo-chip-icon-box {
    background-color: #6c6c6c;
}

/* ----------------------------------------
   Health Recommendations Section
   ---------------------------------------- */
.health-tab {
    position: relative;
    overflow: hidden;
}

.health-tab::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(79, 156, 249, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

.health-tab:hover::before {
    left: 100%;
}

.health-tab.active {
    box-shadow: 0 4px 15px rgba(79, 156, 249, 0.25);
}

.health-tab:not(.active):hover {
    background-color: #f8fafc !important;
}

/* Illustration card gradient animation */
#health-illustration svg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* Risk badge pulse animation */
#health-risk-badge {
    animation: subtlePulse 2s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%,
    100% {
        box-shadow:
            0 4px 6px -1px rgba(0, 0, 0, 0.1),
            0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow:
            0 4px 6px -1px rgba(0, 0, 0, 0.1),
            0 0 0 8px rgba(245, 158, 11, 0);
    }
}

/* Health content transition */
#health-condition-title,
#health-symptoms,
#health-dos li,
#health-donts li {
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

/* Light card effect for info boxes */
.health-info-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Health section responsive adjustments */
@media (max-width: 768px) {
    .health-tab span:not(.health-tab svg) {
        display: none;
    }

    .health-tab {
        padding: 0.75rem;
        min-width: 48px;
        justify-content: center;
    }

    .health-tab svg {
        margin: 0;
    }
}

@media (min-width: 769px) {
    .health-tab span {
        display: inline;
    }
}

/* Smooth icon transitions */
#health-dos i,
#health-donts i {
    transition: transform 0.2s ease;
}

#health-dos li:hover i,
#health-donts li:hover i {
    transform: scale(1.1);
}

/* Card illustration hover effect */
#health-illustration {
    transition: transform 0.3s ease;
}

#health-illustration:hover {
    transform: scale(1.05);
}

/* ----------------------------------------
   Air Quality Card Tooltips (1.5s delay)
   ---------------------------------------- */
.air-quality-card {
    position: relative;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.air-quality-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.air-quality-card::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background-color: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0s 0.3s;
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.air-quality-card::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0s 0.3s;
    z-index: 50;
}

.air-quality-card:hover::after,
.air-quality-card:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition:
        opacity 0.3s ease 1.5s,
        transform 0.3s ease 1.5s,
        visibility 0s 1.5s;
}

.air-quality-card:hover::before {
    transform: translateX(-50%);
}

/* ----------------------------------------
   Hero EWS / Prakiraan sliding cards
---------------------------------------- */
.ews-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(8px);
    transition:
        opacity 0.4s ease,
        transform 0.4s ease;
}
.ews-slide.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

/* ----------------------------------------
   Quick Choice accordion (Pilihan Cepat)
   ---------------------------------------- */
.qc-reveal {
    animation: qcReveal 0.35s ease both;
}

@keyframes qcReveal {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.quick-card.qc-active {
    border-color: #4f9cf9;
    background: rgba(79, 156, 249, 0.06);
    box-shadow: 0px 4px 20px 0px rgba(79, 156, 249, 0.12);
}

.quick-card.qc-active .arrow-icon,
.quick-card.qc-active [data-lucide="arrow-right"] {
    transform: translateX(4px);
}

/* ----------------------------------------
   EWS "Peringatan Dini" alert button — soft breathing glow
   ---------------------------------------- */
@keyframes ews-breathing {
    0%, 100% {
        box-shadow: 0 0 6px 0 rgba(255, 255, 255, 0.12);
    }
    50% {
        box-shadow: 0 0 16px 2px rgba(255, 255, 255, 0.28);
    }
}

.ews-alert-breathing {
    animation: ews-breathing 3s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .ews-alert-breathing { animation: none; }
}
