:root {
    --bg-main: #050814;
    --card: #070d18;
    --primary: #2fd387;
    --primary-soft: rgba(47, 211, 135, 0.18);
    --text-main: #f3f8f6;
    --text-muted: #98a4b2;
    --accent: #39bff2;
    --radius: 18px;
    --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background: radial-gradient(circle at top left, rgba(47, 211, 135, 0.25), transparent 55%),
        radial-gradient(circle at bottom right, rgba(57, 191, 242, 0.25), transparent 55%),
        #050814;
    color: var(--text-main);
    line-height: 1.7;
    min-height: 100vh;
    padding: 18px 12px 26px;
    display: flex;
    justify-content: center;
}




.page {
    width: 100%;
    max-width: 850px;
    background: linear-gradient(135deg, #050b17, #060918);
    border-radius: 22px;
    border: 1px solid rgba(47, 211, 135, 0.4);
    box-shadow:
        0 18px 55px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(47, 211, 135, 0.25);
    padding: 20px 18px 24px;
}



header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(47, 211, 135, 0.7);
    background: rgba(2, 15, 10, 0.9);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 10px rgba(47, 211, 135, 0.9);
}

.back-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.back-link a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed rgba(57, 191, 242, 0.8);
}

.back-link a:hover {
    opacity: 0.8;
}

h1 {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.hero-image {
    margin-bottom: 18px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(47, 211, 135, 0.4);
    background: #000;
}

.hero-image img {
    width: 100%;
    display: block;
}

.section {
    margin-top: 14px;
}

.section h2 {
    font-size: 0.98rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-family: var(--font-mono);
    margin-bottom: 6px;
    color: var(--primary);
}

.section p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.list {
    margin-top: 4px;
    padding-left: 18px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag {
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(47, 211, 135, 0.7);
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--primary);
    background: rgba(5, 15, 12, 0.9);
}

.tag-alt {
    border-color: rgba(57, 191, 242, 0.7);
    color: var(--accent);
    background: rgba(4, 14, 23, 0.9);
}

.meta-grid {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.88rem;
}



.meta-box {
    border-radius: 14px;
    background: rgba(4, 9, 20, 0.9);
    border: 1px solid rgba(47, 211, 135, 0.4);
    padding: 10px 11px;
}

.meta-label {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.meta-value {
    font-size: 0.9rem;
}

footer {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px dashed rgba(47, 211, 135, 0.5);
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}



.temp-wrapper {
    max-width: 700px;
    max-height: 350px;
    margin: 0 auto;
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(4, 9, 18, 0.7);

    /* outline utama */
    border: 1px solid rgba(47, 211, 135, 0.7);

    /* outline kedua (tipis dan dekat sudut) */
    box-shadow:
        0 0 10px rgba(47, 211, 135, 0.6),
        inset 0 0 2px rgba(47, 211, 135, 0.9);
}

#temp-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.6rem;
    justify-content: center;
}

#temp-stats span {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(111, 195, 152, 0.6);
    background: rgba(4, 9, 18, 0.9);
}

#container-temp {
    height: 260px;
    max-width: 100%;
}

.gallery-wrapper {
    max-width: 720px;
    max-height: 500px;
    width: 100%;
    margin: 0 auto;
}

.gallery-title {
    margin-bottom: 10px;
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.9;
}

.gallery-frame {
    margin: 0 auto;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(111, 195, 152, 0.6);
    background: #020514;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.8),
        0 0 16px rgba(47, 211, 135, 0.25);
}

.gallery-track {
    display: flex;
    transition: transform 0.35s ease-in-out;
    will-change: transform;
}

.gallery-slide {
    min-width: 100%;
    user-select: none;
}

.gallery-slide img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    display: block;
}



/* Tombol prev / next */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(70, 253, 180, 0.7);
    background: rgba(101, 101, 102, 0.8);
    color: #f3f8f6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background 0.15s, transform 0.15s, opacity 0.15s;
    opacity: 0.85;
}

.gallery-nav-btn:hover {
    background: rgba(10, 18, 50, 0.95);
    transform: translateY(-50%) scale(1.05);
    opacity: 1;
}

.gallery-nav-btn span {
    font-size: 1.1rem;
}

.gallery-nav-prev {
    left: 10px;
}

.gallery-nav-next {
    right: 10px;
}

/* Indicator dot */
.gallery-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(5, 8, 20, 0.8);
    backdrop-filter: blur(6px);
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(243, 248, 246, 0.7);
    background: transparent;
    opacity: 0.6;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, opacity 0.15s;
}

.gallery-dot.active {
    background: #2fd387;
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(47, 211, 135, 0.8);
}

/* Caption kecil */
.gallery-caption {
    padding: 8px 10px 0;
    font-size: 0.82rem;
    color: #9ca8b5;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.gallery-modal.open {
    display: flex;
}

/* Container media */

.gallery-modal-media {
    position: relative;
    max-width: 80vw;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-modal-media img,
.gallery-modal-media video {
    max-width: 80vw;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.9),
        0 0 22px rgba(47, 211, 135, 0.6);
    background: #020514;
    object-fit: contain;
}

/* Tombol close */
.modal-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(5, 8, 20, 0.9);
    border: 1px solid rgba(247, 124, 108, 0.7);
    color: rgb(247, 43, 7);
    font-size: 1.1rem;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    z-index: 10000;
    font-family: monospace;
}

.modal-close-btn:hover {
    background: rgba(8, 22, 40, 0.95);
    box-shadow: 0 0 10px rgba(47, 211, 135, 0.7);
}


.gallery-slide[data-type="video"] img {
    position: relative;
}

.gallery-slide[data-type="video"]::after {
    content: "▶";
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 6px black;
    pointer-events: none;
}

.modal-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(5, 8, 20, 0.9);
    border: 1px solid rgba(111, 195, 152, 0.7);
    color: #f3f8f6;
    font-size: 1.4rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-nav-btn:hover {
    background: rgba(8, 22, 40, 0.95);
    box-shadow: 0 0 10px rgba(47, 211, 135, 0.7);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}


.stat {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-family: var(--font-mono);
    opacity: 0.9;
    background: rgba(4, 9, 18, 0.7);
}

/* Default: hijau (Avg) */
.stat.avg {
    border: 1px solid rgba(27, 162, 252, 0.7);
    color: rgba(74, 208, 248, 0.9);
    box-shadow:
        0 0 8px rgba(47, 211, 135, 0.35),
        inset 0 0 4px rgba(47, 211, 135, 0.35);
}

/* Min: Kuning */
.stat.min {
    border: 1px solid rgba(255, 216, 0, 0.8);
    color: rgb(255, 230, 0);
    box-shadow:
        0 0 8px rgba(255, 216, 0, 0.3),
        inset 0 0 4px rgba(255, 216, 0, 0.4);
}

/* Max: Merah */
.stat.max {
    border: 1px solid rgba(255, 55, 0, 0.8);
    color: rgb(255, 80, 45);
    box-shadow:
        0 0 8px rgba(255, 25, 0, 0.35),
        inset 0 0 5px rgba(255, 30, 0, 0.38);
}



.map-wrapper {
    max-width: 812px;
    margin: 0 auto;
    /* padding: 0 16px; ← HAPUS ini */
}

.map-container {
    position: relative;
    width: 100%;
    max-width: 812px;
    /* Sama kayak wrapper */
    margin: 0 auto;
    /* ← Tambah center */
    border-radius: 16px;
    border: 1px solid rgba(47, 211, 135, 0.7);
    box-shadow:
        0 0 16px rgba(47, 211, 135, 0.3),
        inset 0 0 10px rgba(47, 211, 135, 0.2);
    overflow: hidden;
}

#map {
    width: 100%;
    height: 500px;
}

/* Panel status di sebelah kanan dalam map */
.map-status-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 180px;
    max-height: 90%;
    padding: 10px 10px 8px;
    background: rgba(5, 8, 20, 0.92);
    border-radius: 12px;
    border: 1px solid rgba(88, 208, 245, 0.7);
    box-shadow: 0 0 14px rgba(0, 0, 0, 0.85);
    font-size: 0.8rem;
    backdrop-filter: blur(4px);
    flex-direction: column;
    gap: 6px;
    pointer-events: auto;
    z-index: 1200;

    /* ⬇⬇ penting: default tidak tampil */
    display: none;
}

/* Jika aktif (ditampilkan) */
.map-status-panel.is-visible {
    display: flex;
}

.status-toggle-btn {
    position: absolute;
    bottom: 10px;
    /* ⬅ pindahkan ke bawah */
    left: 10px;
    z-index: 1300;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(88, 208, 245, 0.8);
    background: rgba(5, 12, 28, 0.95);
    color: #58d0f5;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    font-family: var(--font-mono);
}



.status-toggle-btn:hover {
    background: rgba(12, 24, 46, 0.98);
    box-shadow: 0 0 8px rgba(88, 208, 245, 0.7);
}

.map-status-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #58d0f5;
    margin-bottom: 4px;
}

.map-status-subtitle {
    font-size: 0.7rem;
    color: #9ca8b5;
    margin-bottom: 6px;
}

.vehicle-status-list {
    overflow-y: auto;
    padding-right: 2px;
    max-height: 220px;
}

.vehicle-status-list::-webkit-scrollbar {
    width: 6px;
}

.vehicle-status-list::-webkit-scrollbar-thumb {
    background: #58d0f5;
    border-radius: 4px;
}

.vehicle-status-item {
    padding: 6px 7px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: rgba(8, 14, 30, 0.92);
    border: 1px solid rgba(80, 96, 120, 0.7);
}

.vehicle-status-item.inside {
    border-color: rgba(47, 211, 135, 0.9);
    box-shadow: 0 0 8px rgba(47, 211, 135, 0.5);
}

.vehicle-status-item.outside {
    border-color: rgba(255, 72, 72, 0.9);
    box-shadow: 0 0 8px rgba(255, 72, 72, 0.5);
}

.vehicle-id {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.vehicle-status-text {
    font-size: 0.72rem;
    color: #c0cad8;
}

.vehicle-status-text span.label {
    font-weight: 600;
}

.vehicle-status-text span.inside-label {
    color: #9df5bf;
}

.vehicle-status-text span.outside-label {
    color: #ff9c9c;
}

.status-modal-btn {
    margin-top: 4px;
    align-self: flex-start;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(88, 208, 245, 0.8);
    background: rgba(5, 12, 28, 0.95);
    color: #58d0f5;
    cursor: pointer;
}

.status-modal-btn:hover {
    background: rgba(12, 24, 46, 0.98);
    box-shadow: 0 0 8px rgba(88, 208, 245, 0.7);
}



/* MODAL daftar semua armada */
.status-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.status-modal.open {
    display: flex;
}

.status-modal-content {
    width: min(420px, 90vw);
    max-height: 80vh;
    background: rgba(5, 8, 20, 0.98);
    border-radius: 14px;
    border: 1px solid rgba(88, 208, 245, 0.8);
    box-shadow: 0 0 22px rgba(0, 0, 0, 0.9);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
}

.status-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.status-modal-title {
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #58d0f5;
}

.status-modal-close {
    border: 1px solid rgba(150, 160, 180, 0.8);
    background: rgba(8, 16, 32, 0.95);
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 3px 8px;
    cursor: pointer;
    color: #c0cad8;
}

.status-modal-close:hover {
    background: rgba(18, 26, 48, 0.98);
}

.status-modal-subtitle {
    font-size: 0.74rem;
    color: #9ca8b5;
    margin-bottom: 6px;
}

.status-modal-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

/* Overlay modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    /* awalnya hidden */
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#chart-wrapper {
    background: #111827;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
    box-shadow: 0 0 8px rgba(0, 0, 0, .4);
}

#container {
  height: 200px;
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
}