:root {
    --green-deep: #021a0e;
    --green-dark: #042d16;
    --green-mid: #06401f;
    --green-accent: #0a5c2c;
    --green-light: #2ecc71;
    --cyan: #00d4aa;
    --gold: #e6a817;
    --gold-light: #ffd740;
    --white: #ffffff;
    --white-08: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.10);
    --radius-lg: 16px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-h: 72px;
    --info-h: 90px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    overflow: hidden;
    direction: rtl;
    font-family: 'Cairo', sans-serif;
    background: var(--green-deep);
    color: var(--white);
}

/* ── HEADER ── */
header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    height: var(--header-h);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(2, 26, 14, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(46, 204, 113, 0.15);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(46, 204, 113, 0.3));
    transition: filter var(--transition), transform var(--transition);
}

.header-brand:hover .logo-img {
    filter: drop-shadow(0 4px 16px rgba(46, 204, 113, 0.55));
    transform: scale(1.04);
}

.logo-fallback {
    display: none;
    align-items: center;
    gap: 10px;
}

.logo-fallback-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #0a5c2c, #00d4aa);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.logo-fallback-text {
    font-family: 'Amiri Quran', serif;
    font-size: 19px;
    color: white;
}

.logo-fallback-sub {
    font-size: 10px;
    color: #2ecc71;
    letter-spacing: 2px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 14px;
    color: var(--gold-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: white;
    background: var(--white-08);
}

.nav-link.active {
    color: var(--gold-light);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 14px;
    left: 14px;
    height: 2px;
    background: var(--gold-light);
    border-radius: 2px;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(230, 168, 23, 0.15), rgba(255, 215, 64, 0.08));
    border: 1px solid rgba(230, 168, 23, 0.35);
    border-radius: 50px;
    color: var(--gold-light);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-login:hover {
    background: linear-gradient(135deg, rgba(230, 168, 23, 0.28), rgba(255, 215, 64, 0.15));
    border-color: var(--gold-light);
    transform: translateY(-1px);
}

/* ── INFO BAR ── */
.info-bar {
    position: fixed;
    top: var(--header-h);
    right: 0;
    left: 0;
    z-index: 900;
    background: rgba(4, 45, 22, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(46, 204, 113, 0.12);
    padding: 10px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.info-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.38);
}

.breadcrumb-link {
    color: var(--green-light);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb-link:hover {
    color: var(--cyan);
}

.info-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gold-light);
}

.info-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.info-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

.info-stat-num {
    font-weight: 700;
    color: var(--cyan);
}

/* ── MAP CONTAINER ── */
#map-container {
    position: fixed;
    top: calc(var(--header-h) + var(--info-h));
    right: 0;
    left: 0;
    bottom: 44px;
}

#map {
    width: 100%;
    height: 100%;
}

/* ── FLOATING PANEL (right) ── */
.float-panel {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 800;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Panel button with dropdown */
.panel-btn-wrap {
    position: relative;
}

.panel-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    width: 52px;
    height: 52px;
    background: rgba(2, 26, 14, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 14px;
    color: var(--green-light);
    cursor: pointer;
    transition: var(--transition);
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.panel-btn:hover {
    background: rgba(10, 92, 44, 0.85);
    border-color: var(--green-light);
    transform: scale(1.05);
}

.panel-btn.active {
    background: rgba(10, 92, 44, 0.90);
    border-color: var(--gold-light);
    color: var(--gold-light);
}

/* Dropdown menu */
.panel-dropdown {
    position: absolute;
    top: 0;
    right: 60px;
    background: rgba(2, 26, 14, 0.96);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 14px;
    padding: 8px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    gap: 4px;
    animation: slide-in 0.2s ease;
}

.panel-dropdown.open {
    display: flex;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.dropdown-title {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1.5px;
    padding: 4px 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 2px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.70);
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid transparent;
}

.dropdown-item:hover {
    background: rgba(46, 204, 113, 0.10);
    color: white;
}

.dropdown-item.active {
    background: rgba(46, 204, 113, 0.15);
    color: var(--green-light);
    border-color: rgba(46, 204, 113, 0.25);
}

.dropdown-item-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Checkbox style for data layers */
.dropdown-item .chk {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: var(--transition);
}

.dropdown-item.active .chk {
    background: var(--green-light);
    border-color: var(--green-light);
    color: #021a0e;
}

/* Color dots */
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* ── ZOOM & RESET ── */
.zoom-controls {
    position: absolute;
    bottom: 80px;
    right: 14px;
    z-index: 800;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    background: rgba(2, 26, 14, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(46, 204, 113, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: rgba(10, 92, 44, 0.85);
    border-color: var(--green-light);
}

.btn-reset {
    position: absolute;
    bottom: 14px;
    right: 14px;
    z-index: 800;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: rgba(2, 26, 14, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(46, 204, 113, 0.22);
    border-radius: 50px;
    color: var(--green-light);
    font-family: 'Cairo', sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-reset:hover {
    background: rgba(10, 92, 44, 0.85);
}

/* ── LEGEND ── */
.map-legend {
    position: absolute;
    bottom: 14px;
    left: 14px;
    z-index: 800;
    background: rgba(2, 26, 14, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    min-width: 155px;
}

.legend-title {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.38);
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.70);
    margin-bottom: 5px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.leg-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* ── LOADING ── */
.map-loading {
    position: absolute;
    inset: 0;
    z-index: 900;
    background: rgba(2, 26, 14, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.map-loading.hidden {
    display: none;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
}

/* ── COORDS ── */
.coords-bar {
    position: absolute;
    bottom: 54px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    background: rgba(2, 26, 14, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 4px 14px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.40);
    pointer-events: none;
    white-space: nowrap;
}

/* ── POPUP ── */
.leaflet-popup-content-wrapper {
    background: rgba(4, 45, 22, 0.97) !important;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(46, 204, 113, 0.25) !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5) !important;
    color: white !important;
    direction: rtl;
    font-family: 'Cairo', sans-serif !important;
}

.leaflet-popup-tip-container {
    display: none;
}

.leaflet-popup-content {
    margin: 0 !important;
}

.popup-inner {
    padding: 14px 18px;
    min-width: 200px;
}

.popup-type {
    font-size: 10px;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 6px;
}

.popup-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.5;
    color: white;
}

.popup-row {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.50);
    margin-bottom: 3px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.popup-row span {
    color: rgba(255, 255, 255, 0.85);
    text-align: left;
    direction: ltr;
}

.leaflet-popup-close-button {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 16px !important;
    top: 8px !important;
    left: 8px !important;
    right: auto !important;
}

/* ── FOOTER ── */
.map-footer {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 700;
    padding: 0 32px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(2, 26, 14, 0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(46, 204, 113, 0.10);
}

.footer-copy {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.30);
}

.footer-copy strong {
    color: rgba(255, 255, 255, 0.55);
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border: none;
    border-radius: 50px;
    color: white;
    font-family: 'Cairo', sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(37, 211, 102, 0.25);
    transition: var(--transition);
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
}

/* ── LOGIN MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: linear-gradient(160deg, #042d16, #021a0e);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 20px;
    padding: 36px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    transform: translateY(30px) scale(0.96);
    transition: transform 0.35s ease;
    position: relative;
}

.modal-overlay.open .modal-box {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 12px;
    left: 14px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 20px;
    cursor: pointer;
}

.modal-close:hover {
    color: white;
}

.modal-logo {
    text-align: center;
    margin-bottom: 20px;
}

.modal-logo-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #0a5c2c, #00d4aa);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 8px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 3px;
}

.modal-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.40);
}

.modal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 4px;
}

.modal-tab {
    flex: 1;
    padding: 8px;
    background: none;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.50);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.modal-tab.active {
    background: rgba(46, 204, 113, 0.15);
    color: var(--green-light);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
}

.form-input {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: white;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    outline: none;
    direction: rtl;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--green-light);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.btn-submit {
    padding: 11px;
    margin-top: 4px;
    background: linear-gradient(135deg, #0a5c2c, #1a8c4e);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-submit:hover {
    transform: translateY(-2px);
}

.modal-footer-note {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.30);
    margin-top: 6px;
}

.modal-footer-note span {
    color: var(--green-light);
    cursor: pointer;
    font-weight: 600;
}

/* ── RESPONSIVE ── */
@media (max-width:768px) {
    :root {
        --info-h: 80px;
    }

    header {
        padding: 0 12px;
    }

    .info-bar {
        padding: 8px 12px;
    }

    .header-nav {
        display: none;
    }

    .info-stats {
        display: none;
    }

    .map-footer {
        padding: 0 12px;
    }

    .btn-login {
        padding: 7px 12px;
        font-size: 12px;
    }

    .panel-dropdown {
        right: auto;
        left: 60px;
    }
}