/* ==========================================================================
   JAKARTA SIAGA 112 - OFFICIAL MODERN PORTAL STYLESHEET
   Provinsi DKI Jakarta - BPBD (Pergub No. 188 Tahun 2017)
   Modern, Simple, Authoritative & Fully Responsive BPBD Jakarta Theme
   ========================================================================== */

:root {
    --primary-red: #dc2626;
    --dark-red: #991b1b;
    --brand-crimson: #b91c1c;
    --emergency-glow: rgba(220, 38, 38, 0.45);
    --navy-dark: #0f172a;
    --navy-slate: #1e293b;
    --navy-deep: #090d16;
    --accent-amber: #f59e0b;
    --accent-yellow: #fbbf24;
    --accent-blue: #0288d1;
    --light-bg: #f8fafc;
    --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --card-shadow-hover: 0 20px 40px rgba(15, 23, 42, 0.15);
    --hover-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-bg);
    color: #334155;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================================================
   1. TOP EMERGENCY ANNOUNCEMENT BAR
   ========================================================================== */
.top-announcement-bar {
    background: linear-gradient(90deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%);
    color: #f8fafc;
    font-size: 0.85rem;
    padding: 9px 0;
    border-bottom: 2px solid var(--primary-red);
}

.top-announcement-bar a {
    color: var(--accent-yellow);
    text-decoration: none;
    font-weight: 600;
}

.top-announcement-bar a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ==========================================================================
   2. MAIN NAVIGATION BAR
   ========================================================================== */
.navbar-siaga {
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 25px rgba(15, 23, 42, 0.06);
    padding: 14px 0;
    transition: var(--hover-transition);
}

.navbar-brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img-112 {
    height: 44px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(220, 38, 38, 0.35));
    transition: var(--hover-transition);
}

.logo-img-112:hover {
    transform: scale(1.05);
}

.logo-badge-112 {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    color: #ffffff;
    font-weight: 900;
    font-size: 1.35rem;
    padding: 6px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 14px var(--emergency-glow);
    letter-spacing: -0.5px;
}

.nav-link-custom {
    font-weight: 600;
    color: #334155;
    padding: 8px 16px !important;
    border-radius: 20px;
    transition: var(--hover-transition);
}

.nav-link-custom:hover, 
.nav-link-custom.active {
    color: var(--primary-red) !important;
    background-color: rgba(220, 38, 38, 0.06);
}

/* ==========================================================================
   3. HERO EMERGENCY SECTION (BPBD JAKARTA STYLE)
   ========================================================================== */
.hero-emergency-section {
    background: linear-gradient(135deg, #090d16 0%, #0f172a 45%, #1e1b4b 80%, #311212 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
    padding: 80px 0 100px;
}

.hero-emergency-section::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, var(--emergency-glow) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: pulseGlow 4.5s infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); opacity: 0.4; }
    100% { transform: scale(1.15); opacity: 0.85; }
}

.btn-call-112-hero {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #991b1b 100%);
    color: #ffffff;
    font-size: 1.65rem;
    font-weight: 900;
    padding: 18px 36px;
    border-radius: 60px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 12px 35px rgba(220, 38, 38, 0.6);
    display: inline-flex;
    align-items: center;
    gap: 14px;
    transition: var(--hover-transition);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-call-112-hero:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 18px 45px rgba(220, 38, 38, 0.85);
    color: #ffffff;
}

.btn-call-112-hero i {
    animation: phoneShake 1.5s infinite;
}

@keyframes phoneShake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
    20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

/* ==========================================================================
   4. FLOATING ACTION BUTTON (FAB)
   ========================================================================== */
.fab-emergency-112 {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.6);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    border: 2px solid rgba(255, 255, 255, 0.4);
    animation: fabPulse 2s infinite;
    transition: var(--hover-transition);
}

.fab-emergency-112:hover {
    color: #ffffff;
    transform: scale(1.08);
}

@keyframes fabPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 18px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ==========================================================================
   5. FEATURE & SERVICE CARDS (BPBD STYLE)
   ========================================================================== */
.service-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: var(--hover-transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
    border-color: #cbd5e1;
}

.service-icon-box {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    margin-bottom: 18px;
}

/* ==========================================================================
   6. OFFICIAL CHANNEL CARDS (HOME)
   ========================================================================== */
.channel-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: var(--hover-transition);
    height: 100%;
}

.channel-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-red);
}

/* ==========================================================================
   7. WORKFLOW FLOWCHART UI
   ========================================================================== */
.workflow-step-card {
    background: #ffffff;
    border-radius: 16px;
    border-left: 6px solid var(--primary-red);
    padding: 24px;
    box-shadow: var(--card-shadow);
    position: relative;
    transition: var(--hover-transition);
}

.workflow-step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.step-number-badge {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--navy-dark);
    color: #ffffff;
    font-weight: 800;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

/* ==========================================================================
   8. LINE STATUS PILL & DOT INDICATOR
   ========================================================================== */
.line-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-online {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.dot-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #22c55e;
    animation: blinkDot 1.2s infinite alternate;
}

@keyframes blinkDot {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* ==========================================================================
   9. MAP & MARKERCLUSTER CUSTOM STYLING
   ========================================================================== */
.marker-cluster-small {
    background-color: rgba(239, 68, 68, 0.6) !important;
}
.marker-cluster-small div {
    background-color: rgba(220, 38, 38, 0.9) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

.marker-cluster-medium {
    background-color: rgba(245, 158, 11, 0.6) !important;
}
.marker-cluster-medium div {
    background-color: rgba(217, 119, 6, 0.9) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

.marker-cluster-large {
    background-color: rgba(15, 23, 42, 0.7) !important;
}
.marker-cluster-large div {
    background-color: rgba(15, 23, 42, 0.95) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

/* ==========================================================================
   10. OFFICIAL MASTER FOOTER (BPBD JAKARTA PORTAL STANDARD)
   ========================================================================== */
footer {
    background: #090d16;
    color: #94a3b8;
    padding-top: 65px;
    padding-bottom: 35px;
    border-top: 4px solid var(--primary-red);
}

footer h5 {
    color: #ffffff;
    font-weight: 700;
}

footer a {
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--hover-transition);
}

footer a:hover {
    color: var(--accent-yellow);
}

/* ==========================================================================
   11. COMPREHENSIVE RESPONSIVE DESIGN & MOBILE-FIRST OPTIMIZATIONS
   ========================================================================== */

/* Prevent horizontal overflow on any device */
html, body {
    max-width: 100%;
    overflow-x: hidden !important;
}

/* Ensure text & titles wrap properly on narrow screens */
h1, h2, h3, h4, h5, h6, .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Touch-friendly horizontal scrollbar for filter tags */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.overflow-x-auto::-webkit-scrollbar {
    height: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
    background-color: rgba(220, 38, 38, 0.3);
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   A. Tablets & Small Laptops (Max Width: 991.98px)
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .hero-emergency-section {
        padding: 50px 0 60px;
    }

    .hero-emergency-section::before {
        width: 400px;
        height: 400px;
        right: -20%;
        top: -20%;
    }

    .navbar-siaga {
        padding: 10px 0;
    }

    .navbar-collapse {
        background-color: #ffffff;
        padding: 16px;
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
        margin-top: 12px;
        border: 1px solid #e2e8f0;
    }

    .navbar-nav .nav-link {
        padding: 10px 14px !important;
        border-radius: 10px;
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        background-color: rgba(220, 38, 38, 0.08);
    }
}

/* --------------------------------------------------------------------------
   B. Mobile Devices & Small Tablets (Max Width: 767.98px)
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .top-announcement-bar {
        font-size: 0.78rem;
        padding: 8px 0;
    }

    .top-announcement-bar .container {
        justify-content: center !important;
        text-align: center;
    }

    #accessibility-toolbar {
        margin-top: 4px;
        justify-content: center;
        width: 100%;
    }

    .logo-img-112 {
        height: 36px;
    }

    .navbar-brand strong {
        font-size: 1rem !important;
    }

    .navbar-brand small {
        font-size: 0.65rem !important;
    }

    .hero-emergency-section h1 {
        font-size: 2rem !important;
        line-height: 1.25;
    }

    .hero-emergency-section p.lead {
        font-size: 1rem !important;
    }

    .btn-call-112-hero {
        width: 100%;
        justify-content: center;
        font-size: 1.25rem;
        padding: 14px 20px;
        border-radius: 40px;
    }

    /* Map & Sidebar on Mobile */
    #incident-map {
        height: 380px !important;
        border-radius: 12px;
    }

    .incident-list-scroll {
        max-height: 380px !important;
    }

    /* Form Controls on Mobile */
    .form-select, .form-control {
        font-size: 0.9rem;
        padding: 10px 16px;
    }

    /* Tables on Mobile */
    .table-responsive {
        border-radius: 12px;
    }

    .table th, .table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    /* Footer Mobile Spacing */
    footer {
        padding-top: 45px;
        padding-bottom: 25px;
        text-align: center;
    }

    footer .d-flex.align-items-center {
        justify-content: center;
    }

    footer .col-6 {
        text-align: left;
    }
}

/* --------------------------------------------------------------------------
   C. Extra Small Mobile Devices / Narrow Smartphones (Max Width: 575.98px)
   -------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .hero-emergency-section {
        padding: 35px 0 45px;
    }

    .hero-emergency-section h1 {
        font-size: 1.75rem !important;
    }

    .btn-call-112-hero {
        font-size: 1.1rem;
        padding: 12px 16px;
    }

    .btn-call-112-hero i {
        font-size: 1.4rem;
    }

    .fab-emergency-112 {
        bottom: 16px;
        right: 16px;
        padding: 10px 18px;
        font-size: 0.92rem;
        border-radius: 40px;
    }

    .live-counter {
        font-size: 1.75rem !important;
    }

    /* Service Cards & Grid Padding */
    .service-card, .channel-card, .workflow-step-card {
        padding: 18px;
        border-radius: 14px;
    }

    .service-icon-box {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        border-radius: 12px;
    }

    /* Modal Responsiveness */
    .modal-content {
        padding: 16px !important;
    }

    .modal-body .display-3 {
        font-size: 2.5rem !important;
    }

    .modal-body .display-1 {
        font-size: 3.5rem !important;
    }

    /* Filter buttons tags spacing */
    .service-filter-tag {
        font-size: 0.8rem !important;
        padding: 6px 12px !important;
        white-space: nowrap;
    }
}
