:root {
    --bg: #0b1020;
    --bg-soft: #12172a;
    --card: #1a213b;
    --text: #e9ecf5;
    --muted: #a8b0c8;
    --accent: #b8d9f1;
    --accent-2: #9d7bff;
    --success: #64d2a3;
    --warning: #ffd166;
    --danger: #ff7a90;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --radius: 12px;
}

/* ===== Global ===== */
html,
body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

#map {
    position: absolute;
    inset: 52px 0 0 0;
}

.leaflet-control-zoom {
    display: none !important;
}

/* ===== Header ===== */
.app-header {
    height: 55px;
    background: var(--card);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    z-index: 1003;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    position: relative;
}

/* ===== Chip ===== */
#chipLabel {
    font-weight: 700;
    padding: 0px 10px;
    border-radius: 999px;
    color: var(--bg);
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: none;
}

/* ===== Chip ===== */
#chipLabel_main {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 700;
    font-size: 1.2em;
    padding: 3px 25px;
    border-radius: 999px;
    color: var(--bg);
    background: linear-gradient(        50deg,        var(--accent),        white,        var(--accent-2)    );
    background-size: 200% 100%;
    background-position: 0% 0%;
    animation: shine 4s linear infinite;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 800;
    display: block;
    -webkit-animation: shine 4s linear infinite;
}


.brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 0 0 auto;
    padding-left: 3vw;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-banner {
    height: 40px;
    object-fit: contain;
}

.header-right {
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ===== Sidebar ===== */
.sidebar-left,
.sidebar-right {
    position: absolute;
    top: 60px;
    width: 52px;
    border-radius: var(--radius);
    background: var(--muted);
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .45rem .25rem;
    z-index: 1002;
}

.sidebar-left {
    left: .4rem;
    align-items: flex-start;
}

.sidebar-right {
    right: .4rem;
    align-items: flex-end;
}

#sidebarRight .nav-btn.active-overlay {
    background-color: orange;
    color: white;
    border-radius: 8px;
}


/* Nav item */
.nav-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0);
}

/* Icon bulat */
/* ===== Label default hidden & slide-in ===== */
.btn-labelLeft,
.btn-labelRight {
    display: none;
    opacity: 0;
    transform: translateX(-20px);
    /* slide dari kiri */
    font-size: 12px;
    color: var(--bg);
    background: var(--muted);
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
    pointer-events: none;
    /* tidak mengganggu klik */
    transition: opacity .25s ease, transform .25s ease, background .2s, color .2s;
}

/* ===== Sidebar hover -> show semua label ===== */
.sidebar-left:hover .btn-labelLeft,
.sidebar-right:hover .btn-labelRight {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    display: inline-block;
}

/* ===== Nav button default ===== */
.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(26, 33, 59, 1);
    background: rgba(255, 255, 255, .5);
    color: rgba(26, 33, 59, 1);
    font-size: 1rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .2s, color .2s, transform .2s, box-shadow .2s;
    position: relative;
}

/* Hover nav-btn */
.nav-btn:hover {
    background: var(--warning);
    /* orange */
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    font-weight: bold;
}

.map-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    /* di atas peta */
    display: none;
    /* default hidden */
}

/* Label pasangan saat nav-btn hover */
.nav-item:hover .btn-labelRight,
.nav-item:hover .btn-labelLeft {
    background: var(--warning);
    color: var(--bg);
    opacity: 1;
    transform: translateX(0);
    font-weight: bold;
}

/* Label pasangan saat aktif (diklik) */
.btn-labelLeft.active,
.btn-labelRight.active {
    background: var(--warning);
    color: var(--bg);
    opacity: 1;
    transform: translateX(0);
}


/* Brand logo */
.brand-logo {
    height: 40px;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
    transition: filter 0.3s ease;
}

.brand-logo:hover {
    filter: drop-shadow(0 0 6px rgba(0, 150, 255, 0.9)) drop-shadow(0 0 12px rgba(0, 150, 255, 0.6));
}

/* ===== Bottom sheet ===== */
.bottom-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 20px;
    /* tinggi compact */
    max-height: 270px;
    /* maksimal separuh layar */
    display: flex;
    flex-direction: column;
    background: rgba(26, 33, 59, .95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, .15);
    transition: height .25s ease, transform .25s ease, opacity .2s ease;
    z-index: 1004;
    overflow: hidden;
    display:none;
}

.grabber {
    width: 40px;
    height: 10px;
    margin: .4rem auto;
    border-radius: 999px;
    background: rgba(255, 255, 255, .35);
}

.sheet-header {
    display: flex;
    align-items: center;
    padding: .05rem .6rem;
    border-bottom: 1px solid rgba(255, 255, 255, .15);
}

.sheet-title {
    font-size: 1.2rem;
    font-weight: 700;
}


.sheet-footer {
    padding: .6rem;
    border-top: 1px solid rgba(255, 255, 255, .15);
    display: none;
}

.timeline {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.timeline input[type=range] {
    width: 100%;
}

.badge-soft {
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .25);
}

/* ===== Central Menu ===== */
#centralMenu {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center; /* horizontal center */
    align-items: center;     /* vertical center */
    z-index: 1000;
}

#perjalananMenu .bi-search {
    font-size: 24px;
}

#perjalananMenu,
#jalurKeretaMenu,
#kecamatanMenu,
#lokasiMenu {
    position: absolute;
    bottom: 0px;
    /* di atas bottom sheet */
    left: 1rem;
    background: var(--text);
    border-radius: 10px;
    padding: 6px 10px;
    width: 300px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    display: none;
}

#row_sheet {
    display: none;
}

#currentTime {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--accent);
    text-align: center;
    display: block;
}

/* tombol kiri */
#btnLeftMenu {
    position: fixed;
    /* biar nempel ke viewport, bukan header */
    top: 50%;
    /* posisikan di tengah tinggi */
    left: 0;
    /* nempel ke sisi kiri */
    transform: translateY(-50%);
    /* betul-betul center secara vertikal */
    z-index: 1000;
    /* biar di atas header */
    padding: 20px 5px;
    border-radius: 0 6px 6px 0;
    display : none
    /* opsional, biar ada sudut rounded ke kanan */
}

/* tombol kanan */
#btnRightMenu {
    position: fixed;
    top: 50%;
    right: 0;
    /* nempel ke sisi kanan */
    transform: translateY(-50%);
    z-index: 1000;
    padding: 20px 7px;
    border-radius: 6px 0 0 6px;
    border: 3px solid var(--bg);
    /* opsional, sudut rounded ke kiri */
}

#hasil-lokasi li {
  cursor: pointer;
}
#hasil-lokasi li:hover {
  background-color: #fceaba;
}

.scroll-time {
    display: flex;
    gap: 5px;
    margin: 5px 0;
}

input[type="text"] {
    width: 100%;
    padding: 5px;
    margin: 3px 0 5px 0;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 1);
    color: rgba(0, 0, 0, 0.8);
    ;
}

/* Buttons */
button.btn-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    background: var(--accent);
    color: var(--bg);
    border: 1px solid var(--accent-2);
    transition: background .2s, transform .2s;
}

button.btn-sm:hover {
    background: var(--accent-2);
    transform: scale(1.05);
}

/* Flex menu horizontal */
.menu-content.d-flex>* {
    min-width: 0;
}

/* ===== Responsive ===== */
.toggle-left,
.toggle-right {
    display: none;
}

@media (max-width:768px) {

    .sidebar-left,
    .sidebar-right {
        display: none;
        /* total hilang */
    }

    .toggle-left,
    .toggle-right {
        display: inline-flex;
    }

    #chipLabel_main,
    .header-center {
        display: none;
    }

    
    #chipLabel {
        display: block;
    }

    #perjalananMenu .bi-search {
        font-size: 16px;
    }

    #jalurKeretaMenu,
    #kecamatanMenu,
    #lokasiMenu,
    #perjalananMenu {
        width: 90vw;
    }


    #clock {
        font-family: "Courier New", monospace;
        letter-spacing: -10px;
    }


    .menu-content.d-flex {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .menu-content.d-flex>* {
        width: 100% !important;
    }

    .bottom-sheet {
        max-height: 50vh;
    }

}

/* Kalau dibuka */
.sidebar-left.is-open,
.sidebar-right.is-open {
    display: flex;
    /* muncul kembali */
}

/* ===== States ===== */
.is-open-left {
    transform: translateX(0) !important;
}

.is-open-right {
    transform: translateX(0) !important;
}

.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}

.is-expanded {
    height: 62vh !important;
}

.is-compact {
    height: 100px !important;
}


.sheet-body {
    flex: 1;
    overflow-y: auto;
    /* scroll vertikal saja */
    overflow-x: hidden;
    /* cegah scroll horizontal */
    padding: 1rem;
    background: var(---card);
}

.weather-card {
  background-color: #0c213e;
  border-radius: 10px;
  padding: 0;               /* reset padding, biar header rata */
  width: 100%;
  display: flex;
  flex-direction: column;   /* sekarang isi vertical */
  box-sizing: border-box;
  color: #fff;
  overflow: hidden;         /* biar border-radius juga berlaku ke header */
}

.weather-card .waktu {
  background-color: #162d4d;   /* lebih terang dari card */
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 4px;
}

.weather-card .content {
  flex: 0;
  display: flex;
  flex-direction: row;      /* kiri kanan isi card */
  justify-content: space-between;
  align-items: center;
  padding: 20px 12px;
}

.weather-card .main-info {
  flex: 0 0 40%;
  text-align: center;
}

.weather-card .main-info img {
  max-width: 70px;
  height: auto;
}

.weather-card .condition {
  font-weight: bold;
  font-size: 0.85rem;
  margin-top: 5px;
}

.weather-card .details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
}

.weather-card .details-item {
  display: flex;
  justify-content: space-between;
}


.main-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.main-info img {
    width: 50px;
    height: auto;
    margin-bottom: 5px;
}

.condition {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
}

.temp {
    font-size: 12px;
    color: #ced2d8;
}

.details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    margin-left: 8px;
}

.details-item {
    background-color: #133f67;
    border-radius: 5px;
    padding: 3px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-wrapper {
    overflow-x: auto;
    -ms-overflow-style: none;
    /* hide scrollbar IE/Edge lama */
    scrollbar-width: none;
    /* hide scrollbar Firefox */
    cursor: grab;
    /* kursor tangan grab */
}

.table-wrapper::-webkit-scrollbar {
    display: none;
    /* hide scrollbar Chrome/Safari/Edge */
}

.table-wrapper:active {
    cursor: grabbing;
    /* pas drag jadi grabbing */
}


/*JAM*/
#clock {
    font-family: "Courier New", monospace;
    position: relative;
    /* biar nempel di layar */
    font-size: 1.5em;
    font-weight: bold;
    color: rgba(12, 211, 211, 0.416);
    background: rgba(13, 255, 0, 0);
    /* transparan */
    padding: 5px 10px;
    border-radius: 10px;
    display: block;
    letter-spacing: 2px;
    z-index: 700;
}


#gempa {
    font-size: 0.8em;
    color: rgb(255, 255, 255);
    animation: scroll-left 30s linear infinite;
    -webkit-animation: scroll-left 30s linear infinite;
}

#gempaContainer {
    position: fixed;
    /* biar nempel di layar */
    right: 150px;
    /* jarak dari sisi kanan */
    bottom: 100px;
    /* jarak dari sisi atas */
    font-size: 1em;
    color: rgb(255, 255, 255);
    background: rgba(0, 0, 0, 0.5);
    /* transparan */
    padding: 0px 10px;
    border-radius: 10px;
    letter-spacing: 2px;
    width: 100vw;
    white-space: nowrap;
    z-index: 700;
    display: none;
}

.marker-cluster.cluster-small {
  background: rgba(0, 123, 255, 0.6);
  color: white;
}
.marker-cluster.cluster-medium {
  background: rgba(255, 193, 7, 0.7);
  color: black;
}
.marker-cluster.cluster-large {
  background: rgba(220, 53, 69, 0.8);
  color: white;
}


@keyframes scroll-left {
    from {
        transform: translateX(100%);
        -webkit-transform: translateX(100%);
        -moz-transform: translateX(100%);
        -ms-transform: translateX(100%);
        -o-transform: translateX(100%);
    }

    to {
        transform: translateX(-100%);
    }
}

/* Animasi cahaya putih berjalan */
@keyframes shine {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}