* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 50%, #f1f8ff 100%);
    direction: rtl;
    overflow: hidden;
}

#map {
    height: 100vh;
    width: 100%;
    position: relative;
}

/* Smooth fade overlay when panel opens */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.overlay.active {
    background: rgba(0, 0, 0, 0.3);
    pointer-events: all;
    /* no backdrop blur to keep map sharp */
    backdrop-filter: none;
}

/* Top branding bar - glassmorphism */
.top-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 900;
    animation: slideInFromTop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    padding: 12px 20px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08),
                0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12),
                0 4px 12px rgba(0, 0, 0, 0.06);
}

.brand-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    color: #0b7285;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.brand-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    line-height: 1.2;
}

/* Footer signature - enhanced */
.app-footer {
    position: fixed;
    left: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08),
                0 1px 4px rgba(0, 0, 0, 0.04);
    z-index: 900;
    direction: ltr;
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: slideInFromBottom 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #495057;
    font-weight: 500;
}

.footer-icon {
    font-size: 14px;
    opacity: 0.8;
}

/* Enhanced marker hover effects */
.leaflet-marker-icon {
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.leaflet-marker-icon:hover {
    transform: translateY(-8px) scale(1.15);
    filter: drop-shadow(0 12px 24px rgba(11, 114, 133, 0.35));
}

.leaflet-interactive {
    cursor: pointer;
}

/* Side Panel - Modern glassmorphism card */
.panel {
    position: fixed;
    right: -480px;
    top: 0;
    width: 480px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: -12px 0 48px rgba(0, 0, 0, 0.15),
                -4px 0 16px rgba(0, 0, 0, 0.08);
    transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1b2840;
    padding: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    border-left: 1px solid rgba(255, 255, 255, 0.5);
}

/* Custom scrollbar */
.panel::-webkit-scrollbar {
    width: 8px;
}

.panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}

.panel::-webkit-scrollbar-thumb {
    background: rgba(11, 114, 133, 0.2);
    border-radius: 10px;
    transition: background 0.2s;
}

.panel::-webkit-scrollbar-thumb:hover {
    background: rgba(11, 114, 133, 0.35);
}

.panel.active {
    right: 0;
}

.panel-header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 32px 20px 32px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: blur(20px);
    z-index: 10;
    border-bottom: 1px solid rgba(11, 114, 133, 0.1);
}

.panel-header h2 {
    margin: 0;
    color: #0b7285;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    max-width: 360px;
    animation: fadeInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    background: #f1f5ff;
    border: none;
    color: #495057;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.close-btn:hover {
    background: #0b7285;
    color: white;
    transform: rotate(90deg) scale(1.05);
}

.close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

.panel-content {
    padding: 0 32px 32px 32px;
}

/* Image with smooth reveal animation */
.image-container {
    position: relative;
    width: 100%;
    margin-bottom: 24px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(11, 114, 133, 0.15);
    animation: fadeInScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.location-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-container:hover .location-image {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    pointer-events: none;
}

/* Content section */
.content-section {
    animation: fadeInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

.subtitle-badge {
    display: inline-block;
    background: linear-gradient(135deg, #0b7285 0%, #0891b2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(11, 114, 133, 0.25);
}

.description-ar {
    font-size: 16px;
    line-height: 1.9;
    color: #2c3e50;
    margin: 0 0 16px 0;
    text-align: right;
    font-weight: 400;
}

.description-en {
    font-size: 14px;
    line-height: 1.8;
    color: #64748b;
    margin: 0;
    text-align: left;
    direction: ltr;
    padding: 16px;
    background: rgba(241, 245, 255, 0.5);
    border-radius: 12px;
    border-right: 3px solid #0b7285;
}

/* Stats boxes - enhanced */
.stats {
    display: flex;
    gap: 16px;
    margin-top: 28px;
    animation: fadeInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

.stat-box {
    flex: 1;
    background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
    padding: 20px 16px;
    border-radius: 16px;
    text-align: center;
    border: 1.5px solid #e3f2fd;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0b7285, #0891b2);
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(11, 114, 133, 0.15);
    border-color: #0b7285;
}

.stat-box:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.stat-box h3 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #0b7285 0%, #0891b2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-box span {
    display: block;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .top-bar {
        top: 12px;
        right: 12px;
        left: 12px;
    }

    .brand-container {
        padding: 10px 16px;
        width: 100%;
        justify-content: center;
    }

    .brand-icon {
        font-size: 28px;
    }

    .brand-title {
        font-size: 14px;
    }

    .brand-subtitle {
        font-size: 11px;
    }

    .app-footer {
        left: 12px;
        bottom: 12px;
        padding: 10px 14px;
    }

    .footer-line {
        font-size: 11px;
    }

    .panel {
        width: 100%;
        right: 0;
        left: 0;
        top: auto;
        bottom: -70%;
        height: 70vh;
        border-radius: 24px 24px 0 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.5);
    }

    .panel.active {
        bottom: 0;
        right: 0;
    }

    .panel-header {
        padding: 24px 20px 16px 20px;
    }

    .panel-header h2 {
        font-size: 22px;
    }

    .panel-content {
        padding: 0 20px 24px 20px;
    }

    .location-image {
        height: 200px;
    }

    .stats {
        flex-direction: column;
        gap: 12px;
    }

    .stat-box {
        padding: 16px;
    }
}

/* Smooth transitions for all interactive elements */
button, a, .stat-box, .brand-container {
    -webkit-tap-highlight-color: transparent;
}

/* Loading state animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Accessibility helper (screen-reader only) */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus styles for interactive controls */
.close-btn:focus {
    outline: 3px solid rgba(11, 114, 133, 0.25);
    box-shadow: 0 6px 20px rgba(11, 114, 133, 0.18);
}

/* Marker pulse animation for click feedback */
.marker-pulse {
    animation: markerPulse 900ms cubic-bezier(0.2, 0.9, 0.2, 1);
    transform-origin: center center;
}

@keyframes markerPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(11,112,133,0.45);
    }
    60% {
        transform: scale(1.18);
        box-shadow: 0 0 0 18px rgba(11,112,133,0.06);
    }
    100% {
        transform: scale(1);
        box-shadow: none;
    }
}

/* Gentle map parallax transition */
#map {
    transition: transform 220ms cubic-bezier(0.2,0.8,0.2,1);
    will-change: transform;
}

/* Fallback blur when overlay/backdrop-filter isn't effective */
.map-blurred {
    filter: blur(6px) brightness(0.92);
    transition: filter 320ms cubic-bezier(0.2,0.9,0.2,1);
    -webkit-backdrop-filter: blur(6px);
}

/* Left contextual card styles */
.left-card {
    position: fixed;
    left: 20px;
    top: 120px;
    width: 320px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(14px) saturate(140%);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.12);
    padding: 12px;
    z-index: 910;
    border: 1px solid rgba(255,255,255,0.6);
    transition: transform 300ms cubic-bezier(0.2,0.9,0.2,1), opacity 220ms;
}

.left-card-inner { padding: 8px 6px; }
.left-card-header { display:flex; justify-content:space-between; gap:8px; align-items:center; }
.left-card-close { background:transparent; border:none; font-size:16px; cursor:pointer; color:#495057; border-radius:8px; padding:6px; }
.left-card-close:focus { outline:3px solid rgba(11,114,133,0.2); }
.left-card-text { margin:8px 0 6px 0; color:#213547; font-size:14px; line-height:1.5; text-align:right; }
.left-card-text-en { margin:0; color:#64748b; font-size:13px; line-height:1.4; direction:ltr; text-align:left; background: rgba(241,245,255,0.6); padding:8px; border-radius:8px; border-right:3px solid #0b7285; }

/* Hide on very small screens and make accessible toggle available */
@media (max-width: 520px) {
    .left-card { display:none; }
}

/* Oman slider styles */
.om-slider {
    position: fixed;
    left: 20px;
    top: 120px;
    width: 360px;
    height: 220px;
    z-index: 915;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px) saturate(140%);
    box-shadow: 0 14px 40px rgba(0,0,0,0.12);
    border: 1px solid rgba(255,255,255,0.6);
}

.om-slider-track { width:100%; height:100%; position:relative; }
.om-slide { position:absolute; inset:0; opacity:0; transition: opacity 420ms cubic-bezier(0.2,0.9,0.2,1); display:flex; align-items:flex-end; }
.om-slide.active { opacity:1; z-index:2; }
.om-slide img { width:100%; height:100%; object-fit:cover; display:block; }

.om-slide-info { position:absolute; right:0; left:0; bottom:0; padding:12px 14px; background:linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.18) 40%, rgba(0,0,0,0.45) 100%); backdrop-filter: blur(6px); }
.om-slide-title { font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-weight:800; color:#ffffff; font-size:16px; margin:0 0 6px 0; text-align:right; text-shadow: 0 1px 3px rgba(0,0,0,0.6); -webkit-font-smoothing:antialiased; }
.om-slide-sub { font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size:13px; color:rgba(255,255,255,0.95); opacity:0.95; margin:0; text-align:right; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }

.om-slider-controls { display: none; }

.om-slider-dots { position:absolute; left:12px; bottom:10px; display:flex; gap:8px; z-index:4; }
.om-slider-dots button { width:10px; height:10px; border-radius:50%; border:none; background:rgba(11,114,133,0.22); cursor:pointer; }
.om-slider-dots button.active { background:linear-gradient(90deg,#0b7285,#0891b2); box-shadow:0 6px 18px rgba(11,114,133,0.14); }

@media (max-width:768px) {
    .om-slider { left:12px; top:100px; width:300px; height:200px; }
}

@media (max-width:520px) {
    .om-slider { display:none; }
}
