:root {
    --primary-bg: #1a1a1a;
    --text-color: #ffffff;
    --hotspot-color: rgba(255, 255, 255, 0.3);
    --hotspot-hover: rgba(255, 165, 0, 0.6);
    --tooltip-bg: #f3e5d0;
    --tooltip-text: #4e342e;
    --tooltip-icon-bg: #5a9e33;
}

/* ============================================================
   BARU: Wrapper gabungan Kalender Event + Kategori/Jenis Wisata
   Menumpuk Kalender Event (atas) & Legend Wisata (bawah) di
   pojok kiri-bawah peta menggunakan flexbox, supaya keduanya
   otomatis sejajar rapi tanpa menghitung top/bottom manual.
   #kalender-event & #sidebar-legend masing-masing sudah diubah
   jadi position:static di CSS-nya supaya ikut alur wrapper ini.
   ============================================================ */
#left-bottom-stack {
    position: absolute;
    bottom: 3%;
    left: 2%;
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

/* ============================================================
   API LOADER
   Overlay loading indicator saat fetch data wisata berlangsung.
   Dikontrol oleh JS: showApiLoader() / hideApiLoader()
   ============================================================ */
#api-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 500;
    backdrop-filter: blur(4px);
}

.api-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 28px 40px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.api-loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: apiSpin 0.8s linear infinite;
}

@keyframes apiSpin {
    to {
        transform: rotate(360deg);
    }
}

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

html {
    height: 100%;
    background-color: var(--primary-bg);
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    margin: 0;
}

.map-container {
    position: relative;
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url('../../images/bg_peta.png') no-repeat;
    background-size: 150% 150%;
    /* Gambar diperbesar agar ada ruang untuk bergeser */
    animation: panClouds 60s ease-in-out infinite alternate;
    overflow: hidden;
}

/* Animasi Awan Bergerak Pelan */
@keyframes panClouds {
    0% {
        background-position: 0% 10%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 20% 90%;
    }
}

.map-image {
    width: 95vw;
    height: 92vh;
    max-width: 1920px;
    max-height: 1080px;
    object-fit: fill;
    filter: drop-shadow(0 25px 40px rgba(0, 0, 0, 0.6));
    /* Bayangan mengikuti bentuk peta */
    margin-top: 80px;
    /* Diturunkan sedikit */
    animation: fadeIn 1.5s ease-in-out;
    z-index: 1;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes floating {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Pengaturan Posisi & Ukuran Gambar Bantuan Anak (Bisa diatur di sini) */
#bantuan-anak {
    position: absolute;
    bottom: 1%;
    right: 2%;
    width: 320px;
    max-width: 25vw;
    z-index: 24;
    filter: drop-shadow(0px 10px 15px rgba(0, 0, 0, 0.5));
    animation: floating 3.5s ease-in-out infinite;
}

.anak_petualang {
    width: 100%;
    height: auto;
    display: block;
}

.ai-speech-bubble {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 16px;
    padding: 10px 14px;
    color: #333;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    z-index: 25;
    width: 220px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: default;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s;
    transform-origin: bottom center;
}

.ai-speech-bubble:hover {
    transform: translateX(-50%) scale(1.03);
    border-color: #d2e3fc;
}

.bubble-text {
    text-align: center;
    line-height: 1.3;
    font-size: 0.8rem;
}

.bubble-text .light-text {
    color: #666;
    font-size: 0.75rem;
}

.typing-line {
    display: block;
    min-height: 2.1em;
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 0.95em;
    margin-left: 2px;
    vertical-align: text-bottom;
    background: #1a73e8;
    animation: bubbleCaretBlink 1s step-end infinite;
}

@keyframes bubbleCaretBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

.bubble-sr-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .typing-cursor {
        animation: none;
    }
}

.chat-btn {
    background: linear-gradient(180deg, #558b2f 0%, #33691e 100%);
    color: var(--text-color);
    border: 1px solid #1b5e20;
    border-radius: 20px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: all 0.2s ease;
}

.chat-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 6px 12px rgba(90, 158, 51, 0.35), 0 2px 6px rgba(0,0,0,0.2);
}

.chat-btn:focus-visible {
    outline: 2px solid var(--hotspot-hover);
    outline-offset: 2px;
}

.ai-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0 10px;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

/* Modal Bottom Sheet */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    /* Berubah menjadi center agar melayang */
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bottom-sheet-overlay.active {
    display: flex;
    opacity: 1;
}

.bottom-sheet {
    background: white;
    width: 100%;
    max-width: 400px;
    /* Diperkecil agar lebih ringkas */
    border-radius: 16px;
    /* Melengkung di semua sisi */
    padding: 20px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
    color: #202124;
    font-family: 'Roboto', 'Inter', sans-serif;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.bottom-sheet-overlay.active .bottom-sheet {
    transform: translateY(0);
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sheet-header h3 {
    font-weight: 500;
    font-size: 1.2rem;
    margin: 0;
}

.sheet-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #5f6368;
}

/* Simpan List */
.list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
}

.list-item:hover {
    background: #f8f9fa;
}

.list-item .icon {
    font-size: 20px;
    color: #5f6368;
}

.list-item strong {
    font-weight: 400;
    font-size: 1rem;
}

.list-item small {
    color: #5f6368;
    font-size: 0.85rem;
}

.btn-new-list {
    width: 100%;
    padding: 12px;
    background: #e0f7fa;
    color: #006064;
    border: none;
    border-radius: 24px;
    font-weight: 500;
    font-size: 1rem;
    margin-top: 15px;
    cursor: pointer;
}

/* Bagikan Card */
.share-card {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.share-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.share-info {
    padding: 12px 15px;
}

.share-info strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.share-info p {
    color: #5f6368;
    font-size: 0.85rem;
    margin-bottom: 6px;
    line-height: 1.3;
}

.share-info a {
    color: #1a73e8;
    text-decoration: none;
    font-size: 0.85rem;
}

.share-actions {
    display: flex;
    justify-content: space-around;
    padding-bottom: 15px;
}

.s-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.s-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
}

.s-action span {
    font-size: 0.75rem;
    font-weight: 500;
    color: #3c4043;
}

/* Ulasan Tab */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.review-item {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    border-bottom: 1px solid #f1f3f4;
    padding-bottom: 15px;
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ea4335;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

.review-content strong {
    font-size: 0.95rem;
}

.review-content .r-meta {
    font-size: 0.75rem;
    color: #70757a;
    margin-bottom: 5px;
}

.review-content .r-stars {
    color: #fbbc04;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.review-content p {
    font-size: 0.85rem;
    color: #3c4043;
    line-height: 1.4;
    margin: 0;
}

/* Schedule Expandable */
.schedule-row {
    align-items: flex-start !important;
    cursor: pointer;
    padding: 8px 0;
    margin: -8px 0;
    /* To offset padding for click area */
}

.schedule-row:hover {
    background-color: #f8f9fa;
}

.schedule-container {
    flex-grow: 1;
}

.schedule-header {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.schedule-header .status {
    color: #d93025;
    /* Red like 'Tutup' */
    font-weight: 400;
}

.schedule-header .arrow {
    font-size: 10px;
    margin-left: 10px;
    color: #5f6368;
    transition: transform 0.2s;
}

.schedule-header .arrow.open {
    transform: rotate(180deg);
}

.schedule-list {
    margin-top: 10px;
    padding-left: 0px;
}

.schedule-list table {
    width: 100%;
    font-size: 0.85rem;
    color: #202124;
    border-collapse: collapse;
}

.schedule-list td {
    padding: 5px 0;
}

.schedule-list td:first-child {
    font-weight: 400;
    width: 80px;
}

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.active {
    display: flex;
    opacity: 1;
}

.popup-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #202124;
    font-family: 'Roboto', 'Inter', sans-serif;
    max-height: 90vh;
    overflow-y: auto;
}

.popup-overlay.active .popup-content {
    transform: translateY(0);
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #5f6368;
}

.popup-header {
    height: 200px;
    position: relative;
    background-color: #ddd;
    overflow: hidden;
}

.slider-container {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease-in-out;
}

.slider-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    color: #333;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background 0.2s;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

.slider-btn.prev {
    left: 10px;
}

.slider-btn.next {
    right: 10px;
}

.slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.slider-dots .dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.slider-dots .dot.active {
    background: white;
    transform: scale(1.1);
}

.popup-body {
    padding: 20px;
}

.popup-body h2 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    font-weight: 400;
}

.popup-rating {
    font-size: 0.85rem;
    color: #70757a;
    margin-bottom: 15px;
    line-height: 1.4;
}

.popup-rating .stars {
    color: #fbbc04;
    font-size: 1rem;
}

.popup-tabs {
    display: flex;
    border-bottom: 1px solid #e8eaed;
    margin-bottom: 20px;
}

.popup-tabs .tab {
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #70757a;
    font-weight: 500;
}

.popup-tabs .tab.active {
    color: #1a73e8;
    border-bottom: 2px solid #1a73e8;
}

.popup-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 60px;
    text-align: center;
}

.action-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #1a73e8;
    display: flex;
    justify-content: center;
    align-items: center;
}

.action-btn span {
    font-size: 0.75rem;
    color: #1a73e8;
    font-weight: 500;
    line-height: 1.1;
}

.popup-details {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #3c4043;
}

.popup-details hr {
    border: none;
    border-top: 1px solid #e8eaed;
    margin: 15px 0;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.info-icon {
    color: #1a73e8;
    display: flex;
    align-items: center;
    justify-content: center;
}