/* === RESET & FONT === */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #e0f2f1 0%, #fce4ec 100%);
    position: fixed;
    inset: 0;
    touch-action: manipulation;
}

/* === GLOBAL BUTTON === */
button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s ease;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* === PROFILE BUTTON (ICON) === */
.profile-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    padding: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

/* === TOP CONTROLS === */
.top-controls {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 20px);
    right: calc(env(safe-area-inset-right, 0px) + 20px);
    display: flex;
    gap: 10px;
    z-index: 1000;
}

/* === WRAPPER === */
.user-profile-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* === CARD === */
.card {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 420px;
    text-align: center;

}

.card.show {
    display: block;
}

.card p {
    font-size: 13px;
    margin-bottom: 8px;
    color: #333;
}

/* === MAP === */
#map {
    height: 100vh;
    width: 100%;
}

.drawer {
    display: none;
    position: absolute;
    top: 55px;
    right: 0;
    background: rgba(0, 123, 255, 0.15); /* Lebih transparan */
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.2), 0 6px 20px rgba(0, 0, 0, 0.15); /* Kurangi glow */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 123, 255, 0.3);
    width: 220px;
    text-align: left;
    z-index: 1001;

    font-family: 'Poppins', sans-serif;
    font-size: 13.5px;
    color: #007bff; /* Biru seperti toolbar */
    line-height: 1.5;
}

.drawer p {
    margin-bottom: 6px;
    font-weight: 500;
}

.drawer strong {
    font-weight: 600;
    color: #007bff; /* Biru */
}

.drawer.show {
    display: block;
}

.drawer button+button {
    margin-top: 8px;
}

.drawer button {
    background: rgba(0, 123, 255, 0.1); /* Sedikit transparan */
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.3s ease;
}

.drawer button:hover {
    background: rgba(0, 123, 255, 0.3);
    color: white;
}

.drawer-section {
    margin: 14px 0;
    padding-top: 12px;
    border-top: 1px solid #eef0f4;
}

.drawer-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

form {
    text-align: left;
}

.left-toolbar {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 20px);
    left: calc(env(safe-area-inset-left, 0px) + 20px);
    z-index: 1000;
    display: none;
    flex-direction: row;
    align-items: center;
    background: rgba(0, 123, 255, 0.15); /* Lebih transparan */
    padding: 6px;
    border-radius: 16px;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.2), 0 8px 24px rgba(26, 26, 26, 0.16); /* Kurangi glow */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 123, 255, 0.3);
    gap: 8px;
    animation: hudGlow 2s ease-in-out infinite alternate; /* Animasi berpendar */
}

.tool-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 123, 255, 0.1); /* Semi transparan biru */
    color: #007bff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s all ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background: rgba(0, 123, 255, 0.3);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.7); /* Glow on hover */
}

.tool-btn.active {
    background: rgba(0, 123, 255, 0.5);
    color: white;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.8); /* Stronger glow when active */
}

.leaflet-div-icon.gps-indicator-icon {
    background: transparent;
    border: none;
}

.gps-indicator {
    position: relative;
    display: block;
    width: 22px;
    height: 22px;
}

.gps-indicator-pulse {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.28);
    animation: gpsPulse 1.8s ease-out infinite;
}

.gps-indicator-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.95), 0 0 18px rgba(34, 197, 94, 0.92);
}

@keyframes gpsPulse {
    0% {
        transform: scale(0.55);
        opacity: 0.85;
    }

    70% {
        transform: scale(1.45);
        opacity: 0;
    }

    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

.tool-separator {
    width: 1px;
    height: 26px;
    background: rgba(0, 123, 255, 0.4); /* Biru semi transparan */
    margin: 0 2px;
}
.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.layer-label {
    font-size: 13px;
    color: white; /* Warna terang untuk kontras di satelite */
}

/* Style Switch Toggle (Biar lebih keren dari checkbox biasa) */
.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}

.switch input { display: none; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.5); /* Semi transparan putih untuk kontras */
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px; width: 12px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: #007bff; } /* Biru konsisten */
input:checked + .slider:before { transform: translateX(16px); }

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(32, 20, 54, 0.38);
    backdrop-filter: blur(3px);
    z-index: 2000;
}

.modal-overlay.show {
    display: flex;
}

.modal-overlay-input {
    align-items: flex-start;
    padding-top: max(32px, env(safe-area-inset-top, 0px) + 20px);
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px) + 20px);
}

.modal-dialog {
    width: min(100%, 360px);
    background: #ffffff;
    border-radius: 14px;
    padding: 24px 22px 18px;
    box-shadow: 0 18px 40px rgba(50, 31, 78, 0.24);
    text-align: center;
}

.modal-dialog-input {
    margin-top: 0;
    max-height: min(420px, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 48px));
    overflow-y: auto;
}

.modal-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffe08a, #ffb347);
    color: #6d3c00;
    font-size: 1.35rem;
}

.modal-dialog h3 {
    font-size: 1.05rem;
    color: #3b2759;
    margin-bottom: 8px;
}

.modal-dialog p {
    font-size: 0.92rem;
    line-height: 1.5;
    color: #5f6377;
    margin-bottom: 18px;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-input {
    width: 100%;
    padding: 11px 12px;
    margin-bottom: 16px;
    border: 1px solid #d6dbe5;
    border-radius: 10px;
    font-size: 0.94rem;
    font-family: 'Poppins', sans-serif;
    color: #263247;
    outline: none;
}

.modal-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.modal-btn {
    width: auto;
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    transform: none;
}

.modal-btn:hover {
    transform: none;
}

.modal-btn-secondary {
    background: #eef1f7;
    color: #4d5875;
}

.modal-btn-danger {
    background: linear-gradient(135deg, #e35d6a, #c43d68);
    color: #ffffff;
}

.map-label {
    background: transparent;
    border: none;
}

.map-label span {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.78);
    color: #263247;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.map-label-kecamatan span {
    color: #0f766e;
    background: rgba(240, 253, 250, 0.86);
}

.map-label-desa span {
    color: #6d28d9;
    background: rgba(255, 255, 255, 0.88);
}

/* === FUTURISTIC HUD ANIMATION === */
@keyframes hudGlow {
    0% {
        box-shadow: 0 0 10px rgba(0, 123, 255, 0.2), 0 8px 24px rgba(26, 26, 26, 0.16);
    }
    100% {
        box-shadow: 0 0 15px rgba(0, 123, 255, 0.3), 0 8px 24px rgba(26, 26, 26, 0.16);
    }
}
