:root {
    --primary-color: #5cc6d0;
    --secondary-color: #d3a767;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --daun:#27ae60;
    --foodwastedandaun:#2980b9;
    --foodwaste:#114d3d;
}

/* Tambahkan ini ke CSS Anda */
html {
    scroll-behavior: smooth;
}

/* Map Section */
#map-section {
    position: relative;
    height: 82vh;
    scroll-margin-top: 10px; /* Sesuaikan dengan tinggi header Anda */
}

@media (max-width: 768px) {
    #map-section, #map-container {
        height: 82vh !important;
        scroll-margin-top: 10px; /* Lebih kecil untuk mobile */
    }
}

.mapboxgl-canvas {
    border-radius: 8px;
    width: 100%;
    height: 100%;
}

.marker {
    cursor: pointer;
    transition: all 0.3s ease;
}

.marker:hover {
    transform: scale(1.1);
}

/* point List Styles */
.point-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.point-name {
    font-size: 12px;
    font-weight: 500;
    overflow: hidden;
}
.badge-type {
    position:absolute; top:10px; left:10px; background:#ed1c24; padding:4px 8px; border-radius:6px;
    font-weight: 600;
    color: #fff;
}
.point-address, .popup-address {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.5rem;
    line-height: 1.4;
    font-size: 0.73rem;
}

.point-type {
    display: inline-block;
    border-radius: 12px;
    font-size: 0.8em;
    padding: 2px 0;
}
.point-type span.badge {
    color: #fff;
    font-size: 0.7rem;
}

/* Marker Styles */
.bg-daun {
    background-color: var(--daun) !important;
}
.bg-foodwastedandaun {
    background-color: var(--foodwastedandaun) !important;
}
.bg-foodwaste {
    background-color: var(--foodwaste) !important;
}

.marker-point {
    background-size: cover;
    width: 35px;
    height: 35px;
}

/* .marker-organik {
    background-image: url('../img/organik.svg');
    background-size: contain;
    background-repeat: no-repeat;
    width: 40px;
    height: 40px;
    position: relative;
    filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.marker-nonorganik {
    background-image: url('../img/nonorganik.svg');
    background-size: contain;
    background-repeat: no-repeat;
    width: 40px;
    height: 40px;
    position: relative;
    filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.marker-b3 {
    background-image: url('../img/b3.svg');
    background-size: contain;
    background-repeat: no-repeat;
    width: 40px;
    height: 40px;
    position: relative;
    filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.6));
    transition: all 0.3s ease;
}

.marker-residu {
    background-image: url('../img/residu.svg');
    -webkit-filter: drop-shadow(5px 5px 5px #222);
    filter: drop-shadow(5px 5px 5px #222);
} */

/* .marker-subdistrict {
    max-width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}
.marker-subdistrict:hover {
    background: var(--secondary-color);
}

.marker-village {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 10px;
} */


/* Style dasar untuk semua popup */
.mapboxgl-popup {
    z-index: 100;
    will-change: transform;
    transition: opacity 0.2s ease;
    min-width: 320px;
}

/* Style khusus untuk mobile */
.mapboxgl-popup.mobile-popup {
    top: 5% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    /*max-width: 90vw;*/
}

.mapboxgl-popup.mobile-popup .mapboxgl-popup-content {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Style khusus untuk desktop */
.mapboxgl-popup.desktop-popup {
    position: absolute;
    top: 40% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;

}

.mapboxgl-popup.desktop-popup .mapboxgl-popup-content {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 320px;
    max-width: 320px;
}

/* Media query untuk responsive design */
@media (max-width: 767px) {
    .mapboxgl-popup-tip {
        display: none;
    }

    .mapboxgl-popup-close-button {
        font-size: 22px;
        right: 8px;
        top: 8px;
    }
}

.mapboxgl-popup-content {
    padding: 0 !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    min-width: 320px;
    max-width: 320px;

}
.mapboxgl-popup-content .mapboxgl-popup-close-button {
    color: #fff;
    font-size: 33px;
    opacity: 1;
    top: 10px;
    right: 10px;
}

/* Banner Gambar */
.popup-banner {
    height: 140px;
    width: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Placeholder jika tidak ada gambar */
.popup-banner::before {
    content: '';
    /* position: absolute; */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
}

/* Konten Popup */
.popup-content {
    padding: 16px;
    position: relative;
}

/* Judul */
.popup-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #2d3436;
}

/* Alamat */
.popup-address {
    font-size: 12px;
    color: #636e72;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

/* Detail */
.popup-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f6fa;
    border-radius: 50%;
    color: #3498db;
    font-size: 12px;
}

.detail-label {
    font-size: 12px;
    font-weight: 400;
    color: #333;
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #2d3436;
}

/* Tombol Aksi */
.popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.primary-btn {
    background-color: #3498db;
    color: white;
    border: none;
}

.secondary-btn {
    background-color: #f5f6fa;
    color: #3498db;
    border: 1px solid #dfe6e9;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.primary-btn:hover {
    background-color: #2980b9;
}

.secondary-btn:hover {
    background-color: #dfe6e9;
}

/* Badge */
.popup-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: var(--secondary-color);
    color: white;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* Dark Mode */
.popup-dark .mapboxgl-popup-content {
    background-color: #2d3436;
}

.popup-dark .popup-title,
.popup-dark .detail-value {
    color: #f5f6fa;
}

.popup-dark .popup-address,
.popup-dark .detail-label {
    color: #b2bec3;
}

.popup-dark .secondary-btn {
    background-color: #34495e;
    border-color: #3c4a5e;
    color: #f5f6fa;
}

.popup-dark .detail-icon {
    background-color: #34495e;
    color: #3498db;
}

/* Efek Hover Popup */
.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip {
    border-top-color: rgba(0, 0, 0, 0.1) !important;
}

.mapboxgl-popup-anchor-top .mapboxgl-popup-tip {
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

/* Animasi */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.point-popup {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 280px;
    padding: 12px;
}

.point-popup h5 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.point-popup .address {
    margin: 0 0 12px 0;
    color: #7f8c8d;
    font-size: 13px;
    line-height: 1.4;
}

.point-popup .details div {
    margin-bottom: 6px;
    font-size: 13px;
    color: #34495e;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.direction-btn, .transport-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.direction-btn {
    background-color: #4285F4;
    color: white;
    border: none;
}

.direction-btn:hover {
    background-color: #3367D6;
    transform: translateY(-1px);
}

.transport-btn {
    background-color: #f1f3f4;
    color: #5f6368;
    border: 1px solid #dadce0;
    cursor: pointer;
}

.transport-btn:hover {
    background-color: #e8eaed;
    transform: translateY(-1px);
}

.direction-btn i, .transport-btn i {
    margin-right: 6px;
    font-size: 12px;
}

.point-item {
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.location-title {
    font-size: 0.9rem;
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

.no-results {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
}

.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section label {
    font-weight: 500;
    margin-bottom: 0.3rem;
    display: block;
}

.filter-section select {
    width: 100%;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s;
}

.filter-section select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.marker-temporary {
    width: 24px;
    height: 24px;
    position: relative;
}

.pulse-effect {
    width: 100%;
    height: 100%;
    background-color: #ff0000;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.7;
    }
    70% {
        transform: scale(1.3);
        opacity: 0.2;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.7;
    }
}

#loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px;
    border-radius: 5px;
    z-index: 1000;
    display: none;
}

#error-message, #warning-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4444;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
    display: none;
    max-width: 80%;
    text-align: center;
}

#warning-message {
    background: #ffbb33;
}

/* Toggle Button */
#toggle-sidebar {
    border: none;
    border-radius: 8px;
    padding: 0 10px;
}
#toggle-sidebar:hover {
    padding: 0 10px;
}

#map-section #sidebar {
    padding-left: 0;
    width: 350px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 2;
}


#map-container {
    margin-left: 0;
    width: 100%;
    height: 82vh;
}

/* Modal dan kontainer utama */
#map-section-modal .modal-content {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#map-section {
    flex: 1;
    min-height: 0; /* Penting untuk Chrome */
    display: flex;
    flex-direction: column;
}

#map-container {
    flex: 1;
    position: relative;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Pastikan modal fullscreen */
.modal-fullscreen {
    width: 100vw;
    margin: 0;
    max-width: none;
}

#sidebar.show {
    transform: translateX(-120%);
/*    transform: translateX(0);*/
}

#map-container.sidebar-show {
   margin-left: 300px;
}

.bg-informasi {
    background: url(../images/background-footer.png) no-repeat;
    background-size: 100% !important;
    background-position: bottom center;
}
/* Map Legend Styles */
.map-legend {
    position: absolute;
    bottom: 30px;
    right: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.dark .map-legend,
.map-legend.dark {
    background: rgba(30, 30, 30, 0.92);
    backdrop-filter: blur(8px);
    border-color: rgba(255, 255, 255, 0.1);
}

.legend-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #374151;
}

.dark .legend-header,
.map-legend.dark .legend-header {
    color: #d1d5db;
    border-bottom-color: #374151;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legend-section-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #9ca3af;
    padding-top: 6px;
    margin-bottom: 2px;
}

.legend-section-header:first-of-type {
    padding-top: 0;
}

.dark .legend-section-header,
.map-legend.dark .legend-section-header {
    color: #6b7280;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 4px;
    border-radius: 6px;
    transition: background-color 0.15s;
}

.legend-item:hover {
    background-color: #f3f4f6;
}

.dark .legend-item:hover,
.map-legend.dark .legend-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.legend-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.legend-label {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    line-height: 1.2;
}

/* Legend colored circle markers (subdistrict/village) */
.legend-marker {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.legend-marker-subdistrict {
    background-color: #145846;
}

.legend-marker-village {
    background-color: #00bcf1;
}

.dark .legend-label,
.map-legend.dark .legend-label {
    color: #e5e7eb;
}

@media (max-width: 768px) {
    .map-legend {
        bottom: 90px;
        right: 8px;
        padding: 10px 12px;
        min-width: 120px;
    }
    .legend-icon,
    .legend-marker {
        width: 20px;
        height: 20px;
    }
    .legend-label {
        font-size: 11px;
    }
    .legend-header {
        font-size: 10px;
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    #map-section #sidebar {
        left: -100% !important;
    }
    #sidebar.show {
        transform: translateX(0);
        left: 0 !important;
    }
    #sidebar {
        transform: translateX(-100%);
        width: 320px;
    }

    .page-title {
        padding: 60px 0;
    }

    .info-section {
        padding: 40px 0;
    }

    .cover-slider, .slider-section {
        background-size: 100% !important;
        height: 24vh;
    }

    .cover-slider, .slider-section h5 {
        font-size: 14px;
    }

    .cover-slider .content, .slider-section .content {
        width: 85%;
        right: 0;
        left: 0;
        top: 22%;
        margin: 0 auto;
    }
    .cover-slider .content .btn-main, .slider-section .content .btn-main {
        padding: 5px 10px;
        font-size: 12px;
    }
    .cover-slider .content p, .slider-section .content p {
        margin-bottom: 0;
        line-height: normal;
        font-size: 14px;
    }
    .swiper-inner .content .btn-main {
        background-color: #333;
        color: var(--primary-color);
        padding: 0 12px;
    }
    .swiper-button-next:after, .swiper-button-prev:after {
        font-size: 16px;
    }
    .swiper-button-prev {
        left: 10px;
    }
    .swiper-button-next {
        right: 10px;
    }
}

@media (max-width: 768px) {
    .page-title {
        padding: 40px 0;
    }
    #sidebar {
        width: 100% !important;
    }
}

.popup-dark .content h6, .popup-dark .content p,
.popup-dark .chargerbox-table td {
    color: #f5f6fa;
}
.content p {
    font-size: 12px;
}

.pln-app-download {
    text-align: center;
    margin: 20px 0;
    font-family: Arial, sans-serif;
}
.pln-app-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
    margin-bottom: 10px;
}
.pln-app-btn:hover {
    color: #d3a767;
}
.pln-app-btn img {
    width: 44px;
    margin-right: 10px;
}
.pln-app-fallback {
    margin-top: 10px;
    font-size: 14px;
    color: #555;
}
.pln-app-fallback a {
    color: #0066cc;
    text-decoration: none;
    margin: 0 5px;
}
.pln-app-fallback a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 480px) {
    .pln-app-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    .pln-app-fallback {
        font-size: 12px;
        display: flex;
        flex-direction: column;
    }
    .pln-app-fallback a {
        margin: 3px 0;
    }
}

.marker {
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    border: 2px solid #fff;
}

.marker:hover {
    transform: scale(1.1);
}

.marker-point {
    background-size: cover;
    background-position: center;
    border-radius: 50%;
}

/* Warna marker berdasarkan jenis sampah */
.marker-organik { background-color: #28a745; }
.marker-nonorganik { background-color: #17a2b8; }
.marker-b3 { background-color: #dc3545; }
.marker-residu { background-color: #6c757d; }

.marker-subdistrict {
    background-color: #e31a1c;
}

.marker-village{
    background-color: #5cc6d0;
}

.marker-temporary {
    background-color: var(--foodwastedandaun);
}

/* Indonesia map */
.indonesia-map {
    background-image: url('../img/kab-kudus.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover !important; /* gambar utuh menyesuaikan container */
    width: 100%;
    /*height: 41vh;*/
    position: relative;
    aspect-ratio: 5/3;
    border-radius: 5px;
}

#subdistrict-nav a {
    width: 40px;
    height: 40px;
    background-image: url('../img/location.png');
    background-size: 20px;
    background-repeat: no-repeat;
    background-position: center center;
    position: absolute;
}
#subdistrict-nav a.map-all {
    margin-left: auto;
    margin-right: auto;
    top: 2%;
    left: 0;
    /*right: 0;*/
    text-align: center;
    width: 200px;
    padding-left: 20px;
    color: var(--dark-color);
    background-position: left top;
    /*display: none;*/
}
#subdistrict-nav a.map-all .badge {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 2px 5px;
    border-radius: 5px;
    font-size: 15px;
    margin-left: 7px;
}

#subdistrict-nav a.map-gebog {
    top: 15%;
    left: 44%;
}
#subdistrict-nav a.map-dawe {
    top:20%;
    right: 40%;
}
#subdistrict-nav a.map-bae {
    top: 40%;
    left: 48%;
}
#subdistrict-nav a.map-jekulo {
    top:44%;
    right: 34%;
}
#subdistrict-nav a.map-kaliwungu {
    top: 40%;
    left: 36%;
}
#subdistrict-nav a.map-kota-kudus {
    top: 45%;
    left: 45%;
}
#subdistrict-nav a.map-jati {
    bottom: 36%;
    left: 42%;
}
#subdistrict-nav a.map-mejobo {
    bottom:35%;
    right: 43%;
}
#subdistrict-nav a.map-undaan {
    bottom: 18%;
    left: 42%;
}

@media screen and (max-width: 1680px) {

}

@media screen and (max-width: 1400px) {

}

@media screen and (max-width: 1280px) {

}

@media screen and (max-width: 1199px) {

}

@media screen and (max-width: 1024px) {

}

@media screen and (max-width: 991px) {

}

@media screen and (max-width: 767px) {

}

@media screen and (max-width: 575px) {

}
