
/* =========================================================
   ROOT
========================================================= */

:root {

    --header-height: 62px;

    --panel-width: 405px;

    --bg: #f6f7f9;
    --white: #ffffff;

    --border: #e5e7eb;

    --text: #111827;
    --muted: #6b7280;

    --red: #dc2626;
    --red-dark: #991b1b;
    --red-soft: #fef2f2;
}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
}

html,
body {

    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;
}

body {

    overflow: hidden;

    font-family:
        "Plus Jakarta Sans",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text);

    background: var(--bg);
}


/* =========================================================
   HEADER
========================================================= */

.header {

    position: relative;

    z-index: 5000;

    height: var(--header-height);

    display: flex;
    align-items: center;

    padding: 0 20px;

    background: rgba(255,255,255,.97);

    border-bottom:
        1px solid var(--border);
}

.header-title {

    font-size: 15px;

    line-height: 1.2;

    font-weight: 800;

    letter-spacing: -.025em;
}

.header-subtitle {

    margin-top: 4px;

    font-size: 9px;

    line-height: 1;

    font-weight: 500;

    color: #9ca3af;
}


/* =========================================================
   MAP
========================================================= */

#map {

    position: absolute;

    top: var(--header-height);

    right: 0;
    bottom: 0;
    left: 0;

    z-index: 1;
}


/* =========================================================
   VAAC PANEL
========================================================= */

.vaac-panel {

    position: absolute;

    z-index: 3000;

    top:
        calc(
            var(--header-height) + 14px
        );

    left: 14px;

    width: var(--panel-width);

    max-height:
        calc(
            100vh -
            var(--header-height) -
            28px
        );

    display: flex;

    flex-direction: column;

    background:
        rgba(255,255,255,.98);

    border:
        1px solid var(--border);

    border-radius: 14px;

    overflow: hidden;

    box-shadow:
        0 12px 38px rgba(0,0,0,.14);

    transition:
        transform .22s ease,
        opacity .22s ease;
}


/* =========================================================
   VAAC HEADER
========================================================= */

.vaac-header {

    position: relative;

    flex: 0 0 auto;

    padding: 15px 16px;

    background: #fff;

    border-bottom:
        1px solid var(--border);

    cursor: pointer;

    user-select: none;
}

.vaac-header:hover {

    background: #fafafa;
}

.vaac-title {

    padding-right: 32px;

    font-size: 14px;

    font-weight: 800;

    letter-spacing: -.02em;
}

.vaac-meta {

    margin-top: 4px;

    font-size: 9px;

    font-weight: 500;

    color: #9ca3af;
}


/* collapse icon */

.vaac-toggle {

    position: absolute;

    top: 50%;
    right: 14px;

    width: 25px;
    height: 25px;

    display: flex;

    align-items: center;
    justify-content: center;

    transform:
        translateY(-50%);

    border:
        1px solid #e5e7eb;

    border-radius: 7px;

    background: #f9fafb;

    color: #6b7280;

    font-size: 13px;

    line-height: 1;

    transition:
        transform .2s ease;
}


/* =========================================================
   VAAC BODY
========================================================= */

.vaac-body {

    min-height: 0;

    display: flex;

    flex-direction: column;

    overflow: hidden;

    transition:
        max-height .25s ease,
        opacity .2s ease;
}

.vaac-content {

    min-height: 0;

    overflow-y: auto;

    padding: 16px;

    background: #fafafa;

    scrollbar-width: thin;
}


/* raw advisory */

.vaac-raw {

    margin: 0;

    white-space: pre-wrap;

    overflow-wrap: anywhere;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;

    font-size: 11px;

    line-height: 1.65;

    color: #374151;
}


/* =========================================================
   VAAC GRAPHIC
========================================================= */

.vaac-graphic-wrap {

    padding: 12px 16px 16px;

    background: #fafafa;

    border-top:
        1px solid #eeeeee;
}

.vaac-graphic-label {

    margin-bottom: 8px;

    font-size: 9px;

    font-weight: 700;

    color: #9ca3af;

    text-transform: uppercase;

    letter-spacing: .04em;
}

.vaac-graphic {

    display: block;

    width: 100%;

    height: auto;

    border:
        1px solid #e5e7eb;

    border-radius: 9px;

    background: #fff;
}


/* =========================================================
   COLLAPSED
========================================================= */

.vaac-panel.collapsed {

    max-height: none;

}

.vaac-panel.collapsed .vaac-body {

    max-height: 0;

    opacity: 0;

    pointer-events: none;
}

.vaac-panel.collapsed .vaac-toggle {

    transform:
        translateY(-50%)
        rotate(180deg);
}


/* =========================================================
   LOADING / ERROR
========================================================= */

.loading {

    color: #9ca3af;
}

.error {

    color: #b91c1c;
}


/* =========================================================
   KRAKATAU ICON
========================================================= */

.krakatau-marker {

    background: transparent;

    border: 0;
}


/* =========================================================
   SIGMET POPUP
========================================================= */

.leaflet-popup-content-wrapper {

    padding: 0;

    border-radius: 14px;

    overflow: hidden;

    box-shadow:
        0 12px 38px rgba(0,0,0,.19);
}

.leaflet-popup-content {

    width: 410px !important;

    margin: 0;
}

.sigmet-popup {

    font-family:
        "Plus Jakarta Sans",
        sans-serif;
}


/* popup header */

.sigmet-head {

    padding: 16px 18px;

    background:
        var(--red-soft);

    border-bottom:
        1px solid #fee2e2;
}

.sigmet-title {

    font-size: 17px;

    font-weight: 800;

    color: var(--red-dark);

    letter-spacing: -.025em;
}

.sigmet-subtitle {

    margin-top: 4px;

    font-size: 10px;

    font-weight: 500;

    color: #b91c1c;
}


/* popup info */

.sigmet-info {

    padding: 13px 18px 17px;

    background: #fff;
}

.sigmet-row {

    display: grid;

    grid-template-columns:
        90px minmax(0,1fr);

    gap: 14px;

    padding: 8px 0;

    border-bottom:
        1px solid #f1f2f4;
}

.sigmet-row:last-of-type {

    border-bottom: 0;
}

.sigmet-label {

    font-size: 10px;

    line-height: 1.5;

    font-weight: 600;

    color: #9ca3af;
}

.sigmet-value {

    min-width: 0;

    font-size: 10px;

    line-height: 1.5;

    font-weight: 600;

    color: #374151;

    overflow-wrap: anywhere;
}


/* raw SIGMET */

.raw-title {

    margin-top: 14px;

    margin-bottom: 7px;

    font-size: 10px;

    font-weight: 700;

    color: #6b7280;
}

.raw-sigmet {

    margin: 0;

    padding: 12px;

    background: #f8fafc;

    border:
        1px solid #e5e7eb;

    border-radius: 9px;

    white-space: pre-wrap;

    overflow-wrap: anywhere;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;

    font-size: 10px;

    line-height: 1.65;

    color: #374151;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

    :root {
        --header-height: 56px;
    }


    .header {

        padding: 0 14px;
    }

    .header-title {

        font-size: 14px;
    }

    .header-subtitle {

        font-size: 8px;
    }


    #map {

        top: var(--header-height);
    }


    /* ---------------------------------------------
       PANEL
    --------------------------------------------- */

    .vaac-panel {

        top: 66px;

        left: 8px;

        width:
            min(
                calc(100vw - 16px),
                420px
            );

        max-height:
            calc(
                100vh -
                74px
            );

        border-radius: 13px;
    }


    .vaac-header {

        padding: 13px 14px;
    }


    .vaac-title {

        font-size: 13px;
    }


    .vaac-meta {

        font-size: 8px;
    }


    .vaac-content {

        padding: 14px;
    }


    .vaac-raw {

        font-size: 10px;

        line-height: 1.65;
    }


    .vaac-graphic-wrap {

        padding:
            10px 14px 14px;
    }


    /*
     * Popup hampir selebar
     * layar HP.
     */

    .leaflet-popup-content {

        width:
            calc(100vw - 42px) !important;

        max-width: 430px;
    }


    .sigmet-head {

        padding:
            16px 17px;
    }


    .sigmet-title {

        font-size: 16px;
    }


    .sigmet-subtitle {

        font-size: 9px;
    }


    .sigmet-info {

        padding:
            12px 17px 17px;
    }


    .sigmet-row {

        grid-template-columns:
            82px minmax(0,1fr);

        gap: 11px;

        padding: 8px 0;
    }


    .sigmet-label,
    .sigmet-value {

        font-size: 10px;

        line-height: 1.55;
    }


    .raw-sigmet {

        padding: 12px;

        font-size: 9.5px;

        line-height: 1.65;
    }


    /*
     * Tombol zoom sedikit
     * masuk dari tepi.
     */

    .leaflet-top.leaflet-left {

        top: 8px;
        left: 8px;
    }

}


/* =========================================================
   SMALL PHONE
========================================================= */

@media (max-width: 430px) {

    .vaac-panel {

        left: 7px;

        width:
            calc(100vw - 14px);
    }


    .vaac-raw {

        font-size: 9.5px;
    }


    .leaflet-popup-content {

        width:
            calc(100vw - 30px) !important;
    }

}


/* =========================================================
   VERY SMALL PHONE
========================================================= */

@media (max-width: 360px) {

    .vaac-title {

        font-size: 12px;
    }

    .vaac-raw {

        font-size: 9px;
    }

    .raw-sigmet {

        font-size: 9px;
    }

}


/* =========================================================
   MOBILE HAMBURGER / SLIDE-IN MENU
   ========================================================= */

.mobile-menu-button {
    display: none;
    width: 38px;
    height: 38px;
    margin-right: 10px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.mobile-menu-button svg {
    width: 20px;
    height: 20px;
}

.mobile-menu-overlay {
    display: none;
}

@media (max-width: 700px) {
    .mobile-menu-button {
        display: inline-flex;
    }

    .header > div:last-child {
        display: none;
    }

    .vaac-panel {
        top: var(--header-height);
        left: 0;
        width: min(390px, 88vw);
        max-width: 390px;
        height: calc(100vh - var(--header-height));
        max-height: none;
        border-radius: 0 15px 15px 0;
        border-left: 0;
        display: flex;
        flex-direction: column;
        transform: translateX(-105%);
        opacity: 0;
        pointer-events: none;
        box-shadow: 12px 0 38px rgba(0,0,0,.16);
    }

    .vaac-panel.mobile-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-menu-overlay {
        position: fixed;
        inset: var(--header-height) 0 0 0;
        z-index: 2500;
        display: block;
        background: rgba(17,24,39,.28);
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
        backdrop-filter: blur(1px);
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .vaac-panel.collapsed {
        max-height: none;
    }

    .vaac-panel.collapsed .vaac-body {
        max-height: 0;
    }

.vaac-panel.mobile-open {
    height: calc(100dvh - var(--header-height));
    max-height: none;
    overflow: hidden;
}

.vaac-panel.mobile-open .vaac-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;

    overflow-y: auto;
    overflow-x: hidden;

    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;

    padding-bottom: 24px;
}

.vaac-panel.mobile-open .vaac-content {
    flex: none;
    min-height: auto;
    overflow: visible;
}

.vaac-panel.mobile-open .vaac-graphic-wrap {
    flex: none;
}

.vaac-panel.mobile-open .vaac-body::-webkit-scrollbar {
    width: 5px;
}

.vaac-panel.mobile-open .vaac-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}

}

/* =========================================================
   IMAGE MODAL
   ========================================================= */

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(17,24,39,.78);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity .22s ease,
        visibility .22s ease;
}

.image-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.image-modal-content {
    position: relative;
    width: min(1100px, 94vw);
    max-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(.96) translateY(8px);
    transition: transform .22s ease;
}

.image-modal.active .image-modal-content {
    transform: scale(1) translateY(0);
}

.image-modal-image {
    display: block;
    max-width: 100%;
    max-height: 88vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 70px rgba(0,0,0,.35);
}

.image-modal-close {
    position: absolute;
    top: -13px;
    right: -13px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 50%;
    background: rgba(255,255,255,.96);
    color: #374151;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,.2);
    transition: transform .15s ease, background .15s ease;
}

.image-modal-close:hover {
    transform: scale(1.06);
    background: #fff;
}

.image-modal-close svg {
    width: 19px;
    height: 19px;
}

/* Make the VAAC image obviously clickable */
.vaac-graphic {
    cursor: zoom-in;
    transition: transform .18s ease, box-shadow .18s ease;
}

.vaac-graphic:hover {
    box-shadow: 0 7px 20px rgba(0,0,0,.10);
}

/* =========================================================
   SIGMET POLYGON LABEL
   ========================================================= */

.sigmet-label-marker {
    background: transparent;
    border: 0;
}

.sigmet-polygon-label {
    display: inline-flex;
    align-items: center;
    max-width: 230px;
    padding: 6px 9px;
    border: 1px solid rgba(153,27,27,.25);
    border-radius: 8px;
    background: rgba(255,255,255,.94);
    color: #991b1b;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 10px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -.01em;
    white-space: normal;
    text-align: center;
    box-shadow: 0 5px 16px rgba(0,0,0,.12);
    pointer-events: none;
}
