:root {
    --primary-color: #ffd700;
    /* Gold for premium governmental look */
    --secondary-color: #1a237e;
    /* Deep Royal Blue */
    --accent-color: #00bcd4;
    /* Cyan for modern touch */
    --text-primary: #ffffff;
    --text-secondary: #b0bec5;
    --dark-bg: #0a0e17;
    --glass-bg: rgba(10, 14, 23, 0.85);
    --glass-border: rgba(255, 215, 0, 0.2);
    --card-bg: rgba(255, 255, 255, 0.03);
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Cairo', sans-serif;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    /* Base for rem */
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
        /* Slightly smaller base for mobile */
    }
}

body {
    font-family: var(--font-body);
    background-color: var(--dark-bg);
    color: var(--text-primary);
    overflow: hidden;
    /* Prevent body scroll */
    height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    /* Faster taps on mobile */
    user-select: none;
    /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

img {
    -webkit-user-drag: none;
    /* Prevent image dragging */
}


@media (max-width: 768px) {
    body {
        height: auto;
        overflow-y: auto;
    }
}

/* Map Container */
#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    filter: contrast(1.1) saturate(1.1);
    /* Enhance Satellite imagery */
}

/* --- Header & Layout Structure --- */
.main-header {
    flex: 0 0 auto;
    /* Prevent shrinking */
    /* Remove min-height or let it auto-size, keeping padding */
    padding: 15px 2%;
    background: linear-gradient(180deg, rgba(8, 12, 20, 0.98) 0%, rgba(15, 25, 40, 0.95) 100%);
    backdrop-filter: blur(25px);
    border-bottom: 2px solid rgba(255, 215, 0, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 4%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    position: relative;
    z-index: 2000;
    transition: all 0.5s ease;
    flex-wrap: nowrap;
}

.header-left,
.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header-nav {
    justify-content: flex-end;
    gap: 18px;
}

.header-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 30px;
}

.header-branding:hover {
    transform: translateY(-5px);
}

.logo-wrapper {
    position: relative;
    width: clamp(70px, 8vw, 100px);
    height: clamp(70px, 8vw, 100px);
    padding: 4px;
    background: linear-gradient(45deg, #ffd700, #b8860b);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
    overflow: hidden;
}

.logo-shimmer {
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(45deg,
            transparent 0%,
            rgba(255, 255, 255, 0) 45%,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(255, 255, 255, 0) 55%,
            transparent 100%);
    z-index: 3;
    animation: shimmer 5s infinite ease-in-out;
}

@keyframes shimmer {
    0% {
        transform: rotate(0deg) translate(-20%, -20%);
    }

    100% {
        transform: rotate(0deg) translate(20%, 20%);
    }
}

.logo-img-large {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #000;
    position: relative;
    z-index: 2;
}

.logo-text-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-text-center h1 {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem) !important;
    font-weight: 900 !important;
    color: white !important;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px !important;
    margin: 0 !important;
    font-family: 'Cairo', sans-serif;
    line-height: 1.1;
}

.title-separator {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin: 6px 0;
    box-shadow: 0 0 10px var(--primary-color);
}

.logo-text-center span {
    font-size: clamp(0.6rem, 1vw, 0.8rem) !important;
    color: var(--primary-color) !important;
    letter-spacing: 5px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    opacity: 0.85;
}

@media (max-width: 1100px) {
    .main-header {
        flex-wrap: wrap;
        padding: 15px 20px;
        min-height: auto;
    }

    .header-left,
    .header-nav {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 20px;
    }

    .header-left,
    .header-nav {
        order: 2;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .header-branding {
        order: 1;
        padding: 0;
    }

    .logo-wrapper {
        width: 80px;
        height: 80px;
    }
}

/* ==================== MODERN ICON BUTTONS ==================== */

.icon-wrapper {
    position: relative;
    display: inline-block;
}

/* Tooltip */
.icon-wrapper[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

.icon-wrapper:hover[data-tooltip]::before {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* Modern Icon Button Base */
.modern-icon-btn {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    min-width: 85px;
}

.modern-icon-btn:hover {
    transform: translateY(-6px) scale(1.08);
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.modern-icon-btn:active {
    transform: translateY(-3px) scale(1.02);
}

.icon-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.icon-inner i {
    font-size: 1.6rem;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.icon-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}


/* Blog Button - Gold Theme */
.blog-btn {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
    border-color: rgba(255, 215, 0, 0.4);
    color: #ffd700;
}

.blog-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.15));
    border-color: #ffd700;
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.2),
        inset 0 0 10px rgba(255, 215, 0, 0.1);
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 2px solid #ffd700;
    border-radius: 16px;
    opacity: 0;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

/* Account Button - Astronaut Theme */
.account-btn {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.15), rgba(103, 58, 183, 0.1));
    border-color: rgba(156, 39, 176, 0.3);
    color: #9c27b0;
}

.account-btn:hover {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.25), rgba(103, 58, 183, 0.15));
    border-color: #9c27b0;
    box-shadow: 0 15px 45px rgba(156, 39, 176, 0.3);
}

.glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(156, 39, 176, 0.4), transparent);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.account-btn:hover .glow-effect {
    opacity: 1;
    animation: glow-pulse 1.5s infinite;
}

@keyframes glow-pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.3;
    }
}

/* Directory Button */
/* Directory Button - Gold Theme */
.directory-btn {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
    border-color: rgba(255, 215, 0, 0.4);
    color: #ffd700;
}

.directory-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.15));
    border-color: #ffd700;
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.2),
        inset 0 0 10px rgba(255, 215, 0, 0.1);
}

/* Directory Modal */
.directory-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.directory-content {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    padding: 30px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.directory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.directory-header h2 {
    color: #ffd700;
    margin: 0;
    font-size: 1.8rem;
}

.close-directory {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-directory:hover {
    color: #ff4d4d;
}

.directory-table {
    width: 100%;
    border-collapse: collapse;
    color: white;
    text-align: right;
}

.directory-table th,
.directory-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.directory-table th {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    font-weight: 800;
}

.directory-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Tickets Button (Deprecated or fallback) */
.tickets-btn {
    background: linear-gradient(135deg, rgba(255, 87, 34, 0.15), rgba(244, 67, 54, 0.1));
    border-color: rgba(255, 87, 34, 0.3);
    color: #ff5722;
}

/* AI Button - Brain Theme */
.ai-btn {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15), rgba(3, 169, 244, 0.1));
    border-color: rgba(33, 150, 243, 0.3);
    color: #2196f3;
}

.ai-btn:hover {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.25), rgba(3, 169, 244, 0.15));
    border-color: #2196f3;
    box-shadow: 0 15px 45px rgba(33, 150, 243, 0.3);
}

.ai-btn i {
    animation: brain-think 2s ease-in-out infinite;
}

@keyframes brain-think {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Passport Button */
.passport-btn {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(67, 160, 71, 0.1));
    border-color: rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

.passport-btn:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.25), rgba(67, 160, 71, 0.15));
    border-color: #4caf50;
    box-shadow: 0 15px 45px rgba(76, 175, 80, 0.3);
}

/* Quests Button - Trophy Theme */
.quests-btn {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.1));
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.quests-btn:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25), rgba(255, 152, 0, 0.15));
    border-color: #ffc107;
    box-shadow: 0 15px 45px rgba(255, 193, 7, 0.3);
}

.quests-btn i {
    animation: trophy-shake 3s ease-in-out infinite;
}

@keyframes trophy-shake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

/* Settings Button */
/* Settings Button - Gold Theme */
.settings-btn {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
    border-color: rgba(255, 215, 0, 0.4);
    color: #ffd700;
}

.settings-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.15));
    border-color: #ffd700;
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.2),
        inset 0 0 10px rgba(255, 215, 0, 0.1);
}

.settings-btn i {
    animation: settings-spin 4s linear infinite;
}

@keyframes settings-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Ministry Button */
.ministry-btn {
    background: linear-gradient(135deg, rgba(121, 85, 72, 0.15), rgba(93, 64, 55, 0.1));
    border-color: rgba(121, 85, 72, 0.3);
    color: #795548;
}

.ministry-btn:hover {
    background: linear-gradient(135deg, rgba(121, 85, 72, 0.25), rgba(93, 64, 55, 0.15));
    border-color: #795548;
    box-shadow: 0 15px 45px rgba(121, 85, 72, 0.3);
}

/* Badge Notification */
.badge-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.6);
    animation: badge-bounce 2s infinite;
}

@keyframes badge-bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modern-icon-btn {
        padding: 12px 16px;
        min-width: 75px;
    }

    .icon-inner i {
        font-size: 1.4rem;
    }

    .icon-label {
        font-size: 0.65rem;
    }

    .header-nav {
        gap: 12px;
    }
}

.main-container {
    display: flex;
    flex: 1;
    /* Fill remaining vertical space */
    height: auto;
    /* Remove fixed calc height */
    overflow: hidden;
    position: relative;
    width: 100%;
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
}

/* Sidebar (Restructured) */
.sidebar {
    width: 380px;
    max-width: 100%;
    background: var(--glass-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    backdrop-filter: blur(20px);
    transition: transform 0.3s ease, width 0.3s ease;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: 400px;
        order: 2;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }
}

/* RTL Adjustments for Sidebar Border */
html[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid var(--glass-border);
}

.sidebar-header {
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-header h2 {
    color: white;
    font-size: 1.2rem;
    margin: 0;
}

/* Map adjustment */
.map-container-boxed {
    flex: 1;
    padding: clamp(15px, 2.5vw, 30px);
    background: linear-gradient(135deg, #000000 0%, #0a0e17 100%);
    position: relative;
    overflow: hidden;
    height: 100%;
}

@media (max-width: 768px) {
    .map-container-boxed {
        height: 60vh;
        order: 1;
        min-height: 400px;
        padding: 15px;
    }
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    border: 3px solid rgba(255, 215, 0, 0.4);
    box-shadow:
        inset 0 0 50px rgba(0, 0, 0, 0.9),
        0 15px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 215, 0, 0.2);
    z-index: 1;
    position: relative;
}

/* Custom Scale Bar Styling */
.leaflet-control-scale-line {
    background: rgba(0, 0, 0, 0.6) !important;
    border: 2px solid var(--primary-color) !important;
    border-top: none !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: bold !important;
    padding: 5px 10px !important;
    text-shadow: 1px 1px 2px #000;
    line-height: 1.2 !important;
    min-width: 100px !important;
    /* Make it wider */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Fixed Map Controls */
.fixed-map-controls {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

html[dir="rtl"] .fixed-map-controls {
    right: auto;
    left: 30px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(135deg, rgba(10, 14, 23, 0.95), rgba(15, 25, 40, 0.9));
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 10px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.map-control-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1.5px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    color: #ffd700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.map-control-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.2));
    border-color: #ffd700;
    transform: scale(1.1);
    box-shadow:
        0 6px 20px rgba(255, 215, 0, 0.4),
        0 0 20px rgba(255, 215, 0, 0.3);
}

.map-control-btn:active {
    transform: scale(0.95);
}

.map-control-btn i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Tactical Mode Button Special Style */
#tactical-btn,
.tactical-btn {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.2), rgba(0, 188, 212, 0.1));
    border-color: rgba(0, 188, 212, 0.4);
    color: #00bcd4;
}

#tactical-btn:hover,
.tactical-btn:hover {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.4), rgba(0, 188, 212, 0.3));
    border-color: #00bcd4;
    box-shadow:
        0 6px 20px rgba(0, 188, 212, 0.5),
        0 0 25px rgba(0, 188, 212, 0.4);
}

/* Astro Mode Button */
.astro-btn {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.2), rgba(233, 30, 99, 0.1));
    border-color: rgba(233, 30, 99, 0.4);
    color: #e91e63;
}

.astro-btn:hover {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.4), rgba(233, 30, 99, 0.3));
    border-color: #e91e63;
    box-shadow:
        0 6px 20px rgba(233, 30, 99, 0.5),
        0 0 25px rgba(233, 30, 99, 0.4);
}

/* Dashboard Button */
.dashboard-btn {
    background: linear-gradient(135deg, rgba(26, 35, 126, 0.3), rgba(26, 35, 126, 0.2));
    border-color: rgba(26, 35, 126, 0.5);
    color: #5c6bc0;
}

.dashboard-btn:hover {
    background: linear-gradient(135deg, rgba(26, 35, 126, 0.5), rgba(26, 35, 126, 0.4));
    border-color: #5c6bc0;
    box-shadow:
        0 6px 20px rgba(92, 107, 192, 0.5),
        0 0 25px rgba(92, 107, 192, 0.4);
}

/* Responsive Map Controls */
@media (max-width: 768px) {
    .fixed-map-controls {
        top: 15px;
        right: 15px;
        gap: 10px;
    }

    html[dir="rtl"] .fixed-map-controls {
        left: 15px;
    }

    .control-group {
        padding: 8px;
        gap: 6px;
    }

    .map-control-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}


/* Search & Filter Area */
.search-container {
    padding: 20px 25px;
}

.search-box {
    position: relative;
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    padding-right: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    flex: 1;
    font-size: 0.75rem;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    user-select: none;
}

.chip.active {
    background: var(--primary-color);
    color: #000;
    font-weight: bold;
    border-color: var(--primary-color);
}

/* Reserve List */
.reserve-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
}

.reserve-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: clamp(10px, 1.5vw, 15px);
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.reserve-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-5px);
    border-color: rgba(255, 255, 255, 0.1);
}

.reserve-item .icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.3);
    color: var(--primary-color);
}

.reserve-item-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 3px;
}

.reserve-item-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
}

/* Footer */
/* Footer - Hidden as requested (duplicate) */
.sidebar-footer {
    display: none;
}

/* --- Detail Overlay (Hero Style) --- */
.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    /* Arabic RTL implies content flow, but overlay is full screen */
    width: 100%;
    height: 100%;
    z-index: 5000;
    /* Higher than map controls z-index 1000 */
    background: #000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.4s, opacity 0.4s ease;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 100%;
}

.detail-overlay.active {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.4s ease;
}

/* Backdrop Image with Gradient */
.detail-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.detail-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.4);
    transform: scale(1.1);
    transition: transform 10s ease;
    /* Subtle zoom effect */
}

.detail-overlay.active .detail-backdrop img {
    transform: scale(1);
}

.detail-content-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: linear-gradient(to top, #0a0e17 10%, rgba(10, 14, 23, 0.85) 50%, transparent 100%);
    padding: 40px;
    display: flex;
    flex-direction: column;
}

/* Close Button */
.close-detail {
    position: fixed;
    top: 30px;
    left: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    backdrop-filter: blur(10px);
    z-index: 200;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-detail:hover {
    background: var(--primary-color);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

/* Hero Section inside Detail */
.hero-content {
    margin-top: 15vh;
    max-width: 900px;
    margin-right: auto;
    margin-left: auto;
    /* Center alignment */
    text-align: center;
    margin-bottom: 50px;
}

.hero-content h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    background: linear-gradient(to bottom, #fff, #ccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-tags {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.hero-tag {
    padding: 5px 15px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-desc {
    font-size: clamp(1rem, 4vw, 1.3rem);
    line-height: 1.8;
    color: #e0e0e0;
    margin-bottom: 40px;
    max-width: 800px;
    margin-right: auto;
    margin-left: auto;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 60px;
}

.btn-primary {
    padding: 15px 40px;
    background: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.btn-secondary {
    padding: 15px 30px;
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-secondary:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-3px);
}

/* Settings Button & Modal */
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.settings-trigger {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.settings-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.settings-modal.active {
    opacity: 1;
    visibility: visible;
}

.settings-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    color: white;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.settings-header button {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.st-label {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--text-secondary);
}

.st-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 20px;
}

.st-controls button {
    background: var(--primary-color);
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked+.slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.btn-print {
    background: transparent;
    border: 1px solid white;
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.btn-print:hover {
    background: white;
    color: black;
}

/* --- Time Travel Slider (Comparison) --- */
.time-travel-container {
    position: relative;
    width: 100%;
    height: 350px;
    border-radius: 15px;
    overflow: hidden;
    margin: 30px 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border: 2px solid var(--primary-color);
}

.time-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.time-layer.ancient {
    width: 50%;
    /* Initial split */
    border-right: 3px solid #ffd700;
    z-index: 2;
    overflow: hidden;
    /* Crucial for clipping */
}

.time-layer.ancient img {
    /* To keep image fixed while container shrinks */
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    /* Force full width cover relative to parent's original width */
    max-width: none;
    /* Prevent shrinking */
    object-fit: cover;
    object-position: left center;
}

.time-slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Matches initial width */
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: #ffd700;
    border-radius: 50%;
    z-index: 10;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.time-slider-handle i {
    color: #000;
    font-size: 1.2rem;
}

.time-label {
    position: absolute;
    bottom: 20px;
    padding: 5px 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 5;
    pointer-events: none;
}

.time-label.modern {
    right: 20px;
}

.time-label.ancient {
    left: 20px;
    color: #ffd700;
}

/* Paleo Map Mode Styles - Removed */
/* Make markers look different in Paleo Mode - Removed */

/* Make markers look different in Paleo Mode */
/* Counteract map filter */

/* Paleo Toggle Button */
.paleo-btn {
    background: linear-gradient(135deg, rgba(3, 169, 244, 0.2), rgba(0, 188, 212, 0.1));
    border-color: rgba(3, 169, 244, 0.4);
    color: #03a9f4;
}

.paleo-btn:hover {
    background: linear-gradient(135deg, rgba(3, 169, 244, 0.4), rgba(0, 188, 212, 0.3));
    border-color: #03a9f4;
    box-shadow: 0 0 25px rgba(3, 169, 244, 0.4);
}

/* Print Styles */
@media print {

    .sidebar,
    .dashboard-overlay,
    .map-controls,
    .chat-widget,
    .settings-modal,
    .global-footer,
    .action-bar {
        display: none !important;
    }

    #detail-overlay {
        position: static;
        width: 100%;
        height: auto;
        background: white;
        color: black !important;
    }

    .detail-overlay {
        z-index: 9999;
        visibility: visible;
        opacity: 1;
        background: white;
    }

    body {
        background: white;
        color: black;
    }

    /* Ensure content is visible */
    .hero-content,
    .hero-desc,
    #dt-desc {
        color: black !important;
    }
}

/* Download App Button */
.download-app-btn {
    margin-top: 15px;
    width: 100%;
    padding: 10px;
    background: linear-gradient(90deg, #0078d7, #00bcf2);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 120, 215, 0.4);
    transition: 0.3s;
    font-family: 'Segoe UI', sans-serif;
    /* Windows Font */
    letter-spacing: 1px;
}

.download-app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 120, 215, 0.6);
}

/* Audio Guide */
.audio-guide-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 50px;
    width: fit-content;
}

.audio-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-btn:hover {
    background: white;
    color: var(--primary-color);
    transform: scale(1.1);
}

.audio-btn.primary-audio {
    width: auto;
    padding: 0 20px;
    border-radius: 30px;
    background: var(--primary-color);
    color: #000;
    font-weight: bold;
    gap: 10px;
    border: none;
}

.audio-btn.primary-audio:hover {
    background: #fff;
    box-shadow: 0 0 15px var(--primary-color);
}

.audio-btn.active {
    animation: pulse-audio 1.5s infinite;
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;
}

@keyframes pulse-audio {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 188, 212, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 188, 212, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 188, 212, 0);
    }
}

/* Weather Widget */
.weather-widget {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(10px, 2vw, 20px);
    background: rgba(255, 255, 255, 0.05);
    padding: clamp(10px, 2vw, 15px) clamp(15px, 4vw, 25px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 25px;
    position: relative;
    max-width: 100%;
}

.weather-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    color: #b0bec5;
}

.weather-item i {
    color: var(--accent-color);
}

.weather-label {
    position: absolute;
    bottom: -20px;
    right: 20px;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Stats Row */
.stats-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(20px, 5vw, 50px);
    margin-bottom: clamp(40px, 10vw, 80px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: clamp(15px, 4vw, 30px) 0;
    background: rgba(255, 255, 255, 0.02);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Content Split */
.content-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(300px, 100%, 600px), 1fr));
    gap: clamp(20px, 5vw, 50px);
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 100px;
}

/* AI Insights Box */
.ai-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 188, 212, 0.3);
    border-radius: 15px;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.ai-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.ai-content {
    color: #cfd8dc;
    line-height: 1.8;
}

.ai-content strong {
    color: white;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-grid img:hover {
    transform: scale(1.03);
    border-color: rgba(255, 255, 255, 0.5);
    z-index: 10;
}

/* Custom Marker CSS */
.custom-pin {
    transition: var(--transition);
}

.custom-pin div {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* Dashboard Overlay */
.dashboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.dashboard-overlay.active {
    display: flex;
    opacity: 1;
}

.dashboard-content {
    width: 90%;
    max-width: 850px;
    /* Fixed width box */
    max-height: 85vh;
    /* Fits in screen */
    background: linear-gradient(145deg, #16213e, #0f172a);
    border: 2px solid var(--primary-color);
    border-radius: 30px;
    padding: 40px;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.2);
    animation: dashboardIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes dashboardIn {
    from {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.dashboard-container {
    text-align: center;
}

.dashboard-container h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.chart-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chart-card h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.dashboard-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 20px;
}

.d-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.d-stat span {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.d-stat label {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-top: 10px;
}

/* Biodiversity Section */
.bio-section {
    margin-bottom: 40px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.bio-section h3 {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.bio-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.bio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 80px;
}

.bio-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    transition: 0.3s;
}

.bio-item:hover .bio-icon {
    background: var(--primary-color);
    color: #000;
    transform: scale(1.1);
}

.bio-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Astro Mode (Red Night Vision) */
body.astro-mode {
    --primary-color: #ff0000;
    --text-primary: #ff0000;
    --text-secondary: #cc0000;
    --glass-bg: rgba(0, 0, 0, 0.95);
    --dark-bg: #000000;
    --glass-border: #ff0000;
    --accent-color: #ff0000;
}

body.astro-mode img {
    filter: grayscale(100%) contrast(1.2) brightness(0.8) sepia(1) hue-rotate(-50deg) saturate(5);
}

body.astro-mode .reserve-item:not(.stargazing-spot) {
    opacity: 0.2;
    pointer-events: none;
}

/* Astro Star Marker */
.astro-star {
    animation: twinkle 2s infinite ease-in-out;
    filter: drop-shadow(0 0 10px #e91e63);
}

.astro-star i {
    color: #ffd700;
    font-size: 2rem;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.8);
    }
}

/* Sky Overlay */
.sky-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2500;
    background: #000;
    visibility: hidden;
    opacity: 0;
    transition: var(--transition);
}

.sky-overlay.active {
    visibility: visible;
    opacity: 1;
}

.close-sky {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2600;
    background: rgba(0, 0, 0, 0.8);
    color: #ff0000;
    border: 1px solid #ff0000;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.chat-widget {
    position: fixed;
    bottom: 60px;
    /* Raised to not cover footer */
    right: 30px;
    z-index: 2500;
    /* Higher than footer */
    font-family: 'Cairo', sans-serif;
}

.chat-toggle {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: #0a0e17;
    border: 3px solid #2ecc71;
    /* Emerald Green */
    cursor: pointer;
    box-shadow:
        0 10px 30px rgba(46, 204, 113, 0.4),
        0 0 20px rgba(46, 204, 113, 0.2);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    z-index: 2501;
}

.chat-toggle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    z-index: 3;
    transition: transform 0.5s ease;
}

.chat-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow:
        0 20px 50px rgba(46, 204, 113, 0.6),
        0 0 30px rgba(46, 204, 113, 0.4);
    border-color: #27ae60;
}

.chat-toggle:hover img {
    transform: scale(1.05);
}

.chat-icon-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(102, 187, 106, 0.4);
    animation: chat-pulse 2s infinite;
    z-index: -1;
}

@keyframes chat-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.chat-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 380px;
    height: 600px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 150px);
    background: rgba(10, 15, 25, 0.98);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom right;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    visibility: hidden;
    z-index: 2600;
}

.chat-window.active {
    transform: scale(1);
    visibility: visible;
}

.chat-header {
    background: linear-gradient(135deg, #1b3a21 0%, #0a0e17 100%);
    /* Forest Dark Gradient */
    padding: 18px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-info img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid #2ecc71;
}

.chat-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: 0.5px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 85%;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.message.bot {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.message.user {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #000;
    font-weight: 600;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    align-self: flex-start;
}

.chat-action-chip {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.chat-action-chip:hover {
    background: #2ecc71;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    float: left;
    margin: 0 1px;
    background-color: #2ecc71;
    display: block;
    border-radius: 50%;
    opacity: 0.4;
    animation: typing 1s infinite;
}

.typing-indicator span:nth-of-type(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-of-type(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-of-type(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.4);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.4;
    }
}

.chat-input-area {
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 15px;
    color: #fff;
    font-size: 0.95rem;
}

.chat-input-area input:focus {
    outline: none;
    border-color: #2ecc71;
    background: rgba(255, 255, 255, 0.08);
}

.chat-input-area button {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: #2ecc71;
    border: none;
    color: #000;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input-area button:hover {
    transform: scale(1.05) translate(-2px, -2px);
    box-shadow: 4px 4px 15px rgba(46, 204, 113, 0.4);
}

/* Custom Map Controls */
.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    /* Default LTR */
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

html[dir="rtl"] .map-controls {
    right: auto;
    left: 20px;
    /* Force left for RTL users */
}

.map-controls button {
    width: 45px;
    height: 45px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-controls button:hover {
    background: var(--primary-color);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(255, 215, 0, 0.4);
    border-color: var(--primary-color);
}

.map-controls hr {
    width: 80%;
    margin: 0 auto;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-message::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .sidebar {
        width: 100%;
        height: 60%;
        bottom: 0;
        top: auto;
        border-right: none;
        border-top: 1px solid var(--glass-border);
    }

    .content-split {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .stats-row {
        gap: 20px;
        flex-wrap: wrap;
    }

    .main-header {
        height: auto;
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }

    .header-left,
    .header-nav {
        width: 100%;
        justify-content: center;
    }
}

/* Logo Modal */
.logo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
}

.logo-modal.active {
    display: flex;
}

.logo-expanded {
    width: 80%;
    max-width: 600px;
    border-radius: 50%;
    border: 10px solid var(--primary-color);
    box-shadow: 0 0 100px var(--primary-color);
    animation: logoZoom 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes logoZoom {
    from {
        transform: scale(0.5) rotate(-20deg);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.close-logo-modal {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    background: none;
    border: none;
}

/* Language Selector - Premium Pill Design */
.lang-selector {
    position: relative;
    z-index: 10;
}

.current-lang {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.current-lang:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

.flag-container {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag-container img {
    width: 140%;
    /* Fill circle */
    height: 140%;
    object-fit: cover;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 180px;
    background: rgba(15, 25, 40, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 16px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.lang-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lang-item {
    padding: 10px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-item:hover {
    background: rgba(255, 215, 0, 0.1);
    color: var(--primary-color);
    padding-left: 18px;
    /* Simple slide effect */
}

.lang-item img {
    width: 22px;
    height: 16px;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.lang-item span {
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

/* Chat Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding: 0 10px;
}

.quick-btn {
    background: rgba(0, 188, 212, 0.1);
    border: 1px solid rgba(0, 188, 212, 0.3);
    color: var(--accent-color);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.quick-btn:hover {
    background: var(--accent-color);
    color: #000;
}

/* Global Footer */
.global-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cairo', sans-serif;
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 30px;
}

.copyright-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.copyright-text strong {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.windows-download-btn {
    background: linear-gradient(90deg, #0078d7, #00bcf2);
    color: white !important;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.windows-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 120, 215, 0.4);
    background: linear-gradient(90deg, #0086f1, #1fd1ff);
}

.social-links a:not(.windows-download-btn) {
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:not(.windows-download-btn):hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

/* Adjust floating elements to avoid footer overlap */
.chat-widget,
.map-controls {
    bottom: 50px !important;
}

/* --- NEW FEATURES STYLES --- */

/* AI Lens Overlay */
.ai-lens-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.ai-lens-overlay.active {
    display: flex;
}

.ai-lens-content {
    width: 90%;
    max-width: 500px;
    background: #1a1a1a;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 50px var(--primary-color);
}

.ai-viewfinder {
    width: 100%;
    height: clamp(300px, 60vh, 400px);
    background: #000;
    position: relative;
    overflow: hidden;
}

#ai-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

.ai-controls {
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    background: #111;
}

.capture-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.capture-btn:active {
    transform: scale(0.9);
}

.close-ai {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.ai-results {
    padding: 15px;
    color: #fff;
    text-align: center;
    font-size: 1.1rem;
}

/* Favorites Button */
.fav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ff4757;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.fav-btn.active {
    background: #ff4757;
    color: #fff;
    border-color: #ff4757;
}

.fav-btn.active i {
    font-weight: 900;
}

/* Community Gallery */
.gallery-wrapper {
    margin-top: 30px;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.upload-btn {
    background: var(--primary-color);
    color: #000;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}

.auth-modal.active {
    display: flex;
}

.auth-box {
    background: #1a1a1a;
    padding: clamp(20px, 5vw, 40px);
    border-radius: 25px;
    width: 90%;
    max-width: 350px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-box input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 10px;
    border: none;
    background: #222;
    color: #fff;
}

/* Premium Passport Enhancements */
.passport-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.passport-book {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border: 5px solid #ffd700;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: clamp(15px, 4vw, 30px);
    width: 95%;
    max-width: 400px;
    position: relative;
    color: #fff;
}

.passport-header img {
    width: 60px;
    margin-bottom: 10px;
}

.stamp-slot {
    aspect-ratio: 1;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.stamp-slot.filled {
    border: 2px solid #ffd700;
    background: rgba(255, 215, 0, 0.1);
    animation: stampIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes stampIn {
    0% {
        transform: scale(3);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Virtual Tour Container */
#vr-container {
    transition: opacity 0.5s;
}

/* Modal Positioning Overrides */
.passport-modal,
.auth-modal,
.ai-lens-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 10000 !important;
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(10px) !important;
    display: none;
    align-items: center;
    justify-content: center;
}

.passport-modal.active,
.auth-modal.active,
.ai-lens-overlay.active {
    display: flex !important;
}

#map {
    height: 100%;
    width: 100%;
}



.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 100%, 400px), 1fr));
    gap: clamp(15px, 3vw, 30px);
}

.chart-container {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-container h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* --- Lightbox Modal --- */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 11000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px var(--primary-color);
    border: 3.5px solid var(--primary-color);
    animation: lightboxZoom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes lightboxZoom {
    from {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.close-lightbox {
    position: absolute;
    top: 40px;
    right: 40px;
    color: white;
    font-size: 3.5rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100;
    transition: 0.3s;
}

.close-lightbox:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary-color);
    color: white;
    font-size: 2rem;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-color);
    color: black;
    box-shadow: 0 0 15px var(--primary-color);
}

@media (max-width: 768px) {

    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .close-lightbox {
        top: 20px;
        right: 20px;
        font-size: 2.5rem;
    }
}


/* --- Premium Paywall --- */
.premium-locked {
    position: relative;
    pointer-events: none;
}

.premium-locked::after {
    content: "?? PREMIUM CONTENT";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 215, 0, 0.9);
    color: black;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.2rem;
    z-index: 5;
    white-space: nowrap;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    pointer-events: auto;
}

/* Add a specific hint to click the lock */
.premium-locked::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(12px) grayscale(100%);
    z-index: 4;
    border-radius: inherit;
    background: rgba(0, 0, 0, 0.3);
}

.premium-locked:hover::after {
    transform: translate(-50%, -52%) scale(1.05);
    background: #fff;
}

/* Trigger overlay click to show payment */
.premium-locked::after {
    pointer-events: auto;
}

/* Ensure we can click the overlay to open modal */
.bio-section.premium-locked,
.ai-box.premium-locked {
    cursor: pointer;
}


/* Lightbox Image Fade */
#lightbox-img {
    transition: opacity 0.2s ease-in-out;
}


/* Researcher Blog Post Hover */
.blog-post:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(-10px);
}

/* Header Action Buttons Premium Styling */
.header-nav .header-btn {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-nav .header-btn:hover {
    background: var(--primary-color);
    color: black;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.header-nav .header-btn i.fa-crown {
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
}


/* Compact and elegant header icons */
.header-nav {
    gap: 8px !important;
    /* Tighter gap for many icons */
}

.header-btn,
.passport-trigger {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.1rem !important;
}

.passport-trigger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Leaflet Marker */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

.marker-pin {
    width: 45px;
    height: 45px;
    border-radius: 50% 50% 50% 0;
    background: linear-gradient(135deg, var(--primary-color), #f57f17);
    position: relative;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.5),
        0 0 0 2px rgba(255, 215, 0, 0.3),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: marker-bounce 2s ease-in-out infinite;
}

.marker-pin:hover {
    transform: rotate(-45deg) scale(1.2);
    box-shadow:
        0 12px 30px rgba(255, 215, 0, 0.6),
        0 0 0 3px rgba(255, 215, 0, 0.5),
        0 0 30px rgba(255, 215, 0, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.5);
    z-index: 1000 !important;
}

.marker-pin i {
    transform: rotate(45deg);
    color: white;
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

@keyframes marker-bounce {

    0%,
    100% {
        transform: rotate(-45deg) translateY(0);
    }

    50% {
        transform: rotate(-45deg) translateY(-5px);
    }
}

/* Custom Tooltip */
.custom-tooltip {
    background: linear-gradient(135deg, rgba(10, 14, 23, 0.98), rgba(15, 25, 40, 0.95)) !important;
    border: 2px solid rgba(255, 215, 0, 0.5) !important;
    border-radius: 12px !important;
    padding: 10px 15px !important;
    color: white !important;
    font-family: 'Cairo', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 215, 0, 0.3) !important;
    backdrop-filter: blur(10px);
}

.custom-tooltip::before {
    border-top-color: rgba(255, 215, 0, 0.5) !important;
}


/* --- Enhanced Map Elements --- */
.leaflet-control-scale {
    margin-bottom: 25px !important;
    margin-left: 15px !important;
}

.leaflet-control-scale-line {
    background: rgba(0, 0, 0, 0.5) !important;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important;
    border-top: none !important;
    font-weight: 800 !important;
    text-shadow: 0 0 5px black;
    backdrop-filter: blur(5px);
}

.north-arrow-control {
    margin-bottom: 30px !important;
    margin-right: 20px !important;
    pointer-events: auto;
    background: linear-gradient(135deg, rgba(10, 14, 23, 0.95), rgba(15, 25, 40, 0.9)) !important;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 215, 0, 0.4) !important;
    border-radius: 50% !important;
    padding: 15px !important;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
}

.compass-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.north-compass-icon {
    font-size: 2.2rem;
    color: #ffd700;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    animation: compass-pulse 3s ease-in-out infinite;
}

@keyframes compass-pulse {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

.north-label {
    position: absolute;
    top: -5px;
    font-size: 0.8rem;
    font-weight: 900;
    color: #ff4d4d;
    text-shadow: 0 0 5px black;
}

.north-arrow-control:hover {
    transform: scale(1.1);
    border-color: #ffd700 !important;
}

/* Custom Zoom/Action Controls spacing */
.map-controls hr {
    margin: 5px 10px;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Tactical Mode (NASA/Command Center) --- */
body.tactical-mode {
    --primary-color: #00bcd4;
    /* Tactical Cyan */
    --secondary-color: #0d47a1;
    --dark-bg: #050a0f;
    --glass-bg: rgba(5, 15, 25, 0.9);
    --glass-border: rgba(0, 188, 212, 0.3);
}

body.tactical-mode::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.05), rgba(0, 255, 0, 0.02), rgba(0, 255, 0, 0.05));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.15;
}

body.tactical-mode .main-header {
    background: #050a0f;
    border-bottom: 2px solid var(--primary-color);
}

body.tactical-mode .sidebar {
    border-right: 1px solid var(--primary-color);
}

body.tactical-mode #map {
    filter: invert(100%) hue-rotate(180deg) brightness(0.8) contrast(1.2);
}

/* Tactical Overlay Grid */
.tactical-grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--glass-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.tactical-mode .tactical-grid-overlay {
    opacity: 1;
}

/* Quests UI */
.quest-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    transition: var(--transition);
}

.quest-item.completed {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.05);
}

.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.quest-title {
    font-weight: 800;
    color: var(--primary-color);
}

.quest-status {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.quest-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.quest-progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.5s ease;
}

.quest-reward {
    font-size: 0.8rem;
    color: #ffd700;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* HUD elements for Tactical Mode */
.tactical-hud {
    position: fixed;
    top: 120px;
    right: 20px;
    z-index: 100;
    display: none;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

body.tactical-mode .tactical-hud {
    display: flex;
}

.hud-box {
    background: rgba(5, 15, 25, 0.8);
    border: 1px solid var(--primary-color);
    padding: 10px;
    border-radius: 5px;
    color: var(--primary-color);
    font-family: 'monospace';
    font-size: 0.75rem;
    backdrop-filter: blur(5px);
}

.hud-box h4 {
    margin: 0 0 5px 0;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 3px;
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

.scanline {
    position: absolute;
    width: 100%;
    height: 10px;
    background: rgba(0, 188, 212, 0.1);
    animation: scanline 8s linear infinite;
    z-index: 10;
    pointer-events: none;
    display: none;
}

body.tactical-mode .scanline {
    display: block;
}

/* ==================== AI CHATBOT ENHANCEMENTS ==================== */

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: fit-content;
    margin-bottom: 10px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
    opacity: 0.6;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

/* Chat Actions (Chips) */
.chat-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 5px;
    margin-bottom: 10px;
}

.chat-action-chip {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-action-chip:hover {
    background: var(--primary-color);
    color: #000;
    transform: translateY(-2px);
}

/* Enhanced Message Bubbles */
.message {
    max-width: 85%;
    margin-bottom: 10px;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}

.message.bot {
    background: rgba(30, 41, 59, 0.9);
    border-bottom-right-radius: 4px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-self: flex-start;
}

.message.user {
    background: linear-gradient(135deg, var(--primary-color), #ffb300);
    border-bottom-left-radius: 4px;
    color: #000;
    font-weight: 500;
    align-self: flex-end;
    margin-left: auto;
    /* Ensures user messages are right-aligned */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Input Area Refinement */
.chat-input-area {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-window {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ==================== ULTIMATE CHAT WIDGET STYLING ==================== */
.chat-widget {
    position: fixed;
    bottom: 80px;
    /* Moved up slightly to not overlap footer */
    right: 30px;
    z-index: 9999;
}

/* Floating Action Button (The Icon) */
.chat-toggle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00bcd4, #2196f3);
    /* AI Blue Cyan Gradient */
    border: none;
    box-shadow: 0 10px 25px rgba(33, 150, 243, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: visible;
}

.chat-toggle i {
    font-size: 2rem;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.4s ease;
}

.chat-toggle:hover {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 15px 35px rgba(33, 150, 243, 0.8);
}

.chat-toggle:hover i {
    transform: scale(1.1);
}

/* Pulse Animation for the "Living" AI feel */
.chat-icon-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(0, 188, 212, 0.6);
    animation: chat-pulse 2s infinite;
    z-index: -1;
}

@keyframes chat-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 0;
    }
}

/* Chat Window Container - Modern & Glassmorphism */
.chat-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 350px;
    height: 500px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 188, 212, 0.3);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    display: none;
    /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: openChat 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.chat-window.active {
    display: flex;
}

@keyframes openChat {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Chat Header - Gradient */
.chat-header {
    background: linear-gradient(90deg, #1e3c72, #2a5298);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header h3 {
    color: white;
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header h3::before {
    content: "●";
    color: #00ff00;
    font-size: 0.8rem;
    animation: blink 2s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.5;
    }
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(33, 150, 243, 0.05) 0%, transparent 50%);
    scroll-behavior: smooth;
}

/* Input Area */
.chat-input-area {
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 10px 20px;
    color: white;
    font-family: 'Cairo', sans-serif;
    outline: none;
    transition: all 0.3s;
}

.chat-input-area input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-color);
}

.chat-input-area button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input-area button:hover {
    transform: scale(1.1) rotate(-10deg);
}

/* ==================== COMPREHENSIVE MOBILE RESPONSIVENESS ==================== */
@media (max-width: 991px) {
    .sidebar {
        width: 300px;
    }
}

@media (max-width: 768px) {

    /* Header & Navigation */
    .header {
        padding: 10px 15px;
        flex-direction: column;
        height: auto;
        gap: 10px;
    }

    .nav-buttons {
        width: 100%;
        justify-content: center;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    /* Sidebar - Transform to Bottom Sheet toggle or Drawer */
    .sidebar {
        width: 100%;
        height: 60vh;
        bottom: -60vh;
        top: auto;
        border-radius: 30px 30px 0 0;
        transition: transform 0.5s ease;
        z-index: 2100;
    }

    .sidebar.active {
        transform: translateY(-60vh);
    }

    /* Map - Full screen when sidebar is minimized */
    #cesiumContainer,
    #map {
        height: 100vh;
    }

    /* Chatbot - Full Screen on mobile */
    .chat-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-width: none;
        max-height: none;
        z-index: 10000;
    }

    .chat-toggle {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
    }

    /* Detail Modal - Vertical Stack */
    .modal-content {
        width: 95%;
        margin: 20px auto;
        height: 90vh;
        overflow-y: auto;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .image-gallery {
        height: 300px;
    }

    /* Search Bar */
    .search-container {
        width: 90%;
        top: 80px;
    }
}

@media (max-width: 480px) {
    .app-title h1 {
        font-size: 1.2rem;
    }

    .chat-header-info img {
        width: 30px;
        height: 30px;
    }

    .stat-card {
        padding: 10px;
    }

    .stat-number {
        font-size: 1.2rem;
    }
}

/* RTL Specific Mobile Adjustments */
html[dir="rtl"] .chat-widget {
    right: auto;
    left: 30px;
}

html[dir="rtl"] .chat-window {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

/* --- Egypt Data Integration Styles --- */
.gov-marker {
    background: transparent;
    border: none;
}

.gov-marker-inner {
    width: 30px;
    height: 30px;
    background: var(--secondary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    font-size: 14px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    transition: var(--transition);
}

.gov-marker-inner:hover {
    transform: scale(1.2);
    box-shadow: 0 0 25px var(--primary-color);
    background: var(--primary-color);
    color: var(--secondary-color);
}

.city-marker-inner {
    width: 24px;
    height: 24px;
    background: #00bcd4;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 10px;
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.5);
    transition: var(--transition);
}

.city-marker-inner:hover {
    transform: scale(1.3);
    background: #fff;
    color: #00bcd4;
    border-color: #00bcd4;
}

.gov-popup {
    text-align: center;
    font-family: 'Cairo', sans-serif;
}

.egydata-modal {
    z-index: 10001;
    /* Above almost everything */
}

.egydata-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.egydata-item:hover {
    background: rgba(255, 215, 0, 0.1);
}

.badge {
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.8rem;
}

.data-controls .map-control-btn {
    border-color: rgba(0, 188, 212, 0.4);
    color: #00bcd4;
}

.data-controls .map-control-btn:hover {
    background: rgba(0, 188, 212, 0.1);
    box-shadow: 0 0 15px rgba(0, 188, 212, 0.3);
}

/* --- Unified Layers Panel --- */
.layer-panel-group {
    position: relative;
}

.layers-dropdown {
    position: absolute;
    right: 60px;
    top: 0;
    width: 250px;
    background: linear-gradient(135deg, rgba(10, 14, 23, 0.98), rgba(15, 25, 40, 0.95));
    backdrop-filter: blur(25px);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1001;
}

html[dir="rtl"] .layers-dropdown {
    right: auto;
    left: 60px;
    transform: translateX(-20px);
}

.layers-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.layers-section {
    margin-bottom: 20px;
}

.layers-section:last-child {
    margin-bottom: 0;
}

.layers-section h4 {
    color: var(--primary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    padding-bottom: 8px;
}

.layer-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    font-weight: 500;
}

.layer-option:hover {
    background: rgba(255, 215, 0, 0.1);
    color: var(--primary-color);
}

.layer-toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
}

.layer-toggle-item span {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

/* Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: rgba(255, 215, 0, 0.3);
}

input:checked+.slider:before {
    transform: translateX(20px);
    background-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}