/* Custom dark palette variables */
:root {
    --dark-bg: #1A1A1D;
    --dark-surface: #2C3A47;
    --text-color: #E8EAE6;
    --accent-color: #3E82F7;
    --border-color: #4C596D;
}

/* Ensure full coverage on mobile */
html {
    background: #05060a;
    height: 100%;
}

/* Base Styles */
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, #141824 0, #05060a 55%, #000000 100%);
    color: #f5f5f7;
    padding: 24px 32px 32px;
    padding: max(24px, env(safe-area-inset-top)) max(32px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left));
    box-sizing: border-box;
    min-height: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Slightly bolder, more defined typography for Arabic UI */
html[lang="ar"] body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Cairo', 'Tajawal', sans-serif;
    font-weight: 600;
}

/* Ensure popup text in Arabic also uses the stronger weight */
html[lang="ar"] .leaflet-popup-content {
    font-weight: 600;
}

.geo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.geo-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.geo-title-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.geo-logo-dot {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #4fd1ff, #005eff);
    box-shadow: 0 0 12px rgba(0, 140, 255, 0.8);
}

.geo-title {
    margin: 0;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 18px;
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.geo-title-main {
    font-weight: 700;
}

.geo-title-sub {
    font-weight: 400;
    opacity: 0.8;
    text-transform: none;
    font-size: 16px;
    color: #4fd1ff;
}

.geo-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #a0a4b8;
}

.geo-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.lang-btn {
    background: transparent;
    border: none;
    color: #a0a4b8;
    cursor: pointer;
    padding: 0 4px;
    font-size: 10px;
    text-transform: inherit;
    letter-spacing: inherit;
}

.lang-btn.lang-active {
    color: #4fd1ff;
    font-weight: 600;
}

.lang-separator {
    color: rgba(148, 163, 184, 0.7);
    font-size: 10px;
}

.geo-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #20e38f;
    box-shadow: 0 0 10px rgba(32, 227, 143, 0.9);
}

.geo-tagline {
    margin: 6px 0 10px;
    font-size: 13px;
    color: #b3b8d0;
}

.geo-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.chip {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 4px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: rgba(15, 23, 42, 0.7);
    color: #e5e7eb;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip:hover {
    border-color: rgba(79, 209, 255, 0.6);
}

.chip-active {
    border-color: #4fd1ff;
    background: radial-gradient(circle at top, rgba(79, 209, 255, 0.16), rgba(15, 23, 42, 0.9));
    box-shadow: 0 0 10px rgba(79, 209, 255, 0.5);
}

.filter-separator {
    color: rgba(148, 163, 184, 0.4);
    margin: 0 4px;
    font-size: 14px;
}

/* --- CATEGORY DOT STYLES --- */
.category-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: category-pulse 2s infinite ease-in-out;
}

@keyframes category-pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.5; 
        transform: scale(0.85);
    }
}

/* --- TIME FILTER DROPDOWN STYLES --- */
.time-filter-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.time-dropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 4px 28px 4px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: rgba(15, 23, 42, 0.7);
    color: #e5e7eb;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    font-family: inherit;
}

.time-dropdown:hover {
    border-color: rgba(79, 209, 255, 0.6);
}

.time-dropdown:focus {
    outline: none;
    border-color: #FFCC33;
    box-shadow: 0 0 10px rgba(255, 204, 51, 0.4);
}

.time-dropdown option {
    background: #1A1A1D;
    color: #e5e7eb;
    padding: 8px;
}

.dropdown-arrow {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: #a0a4b8;
    font-size: 10px;
    transition: color 0.2s ease;
}

.time-filter-wrapper:hover .dropdown-arrow {
    color: #4fd1ff;
}

.time-dropdown.time-active {
    border-color: #FFCC33;
    background: radial-gradient(circle at top, rgba(255, 204, 51, 0.16), rgba(15, 23, 42, 0.9));
    box-shadow: 0 0 10px rgba(255, 204, 51, 0.4);
}

/* --- LIVE NEWS FEED BUTTON --- */
.live-feed-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.live-feed-btn:hover {
    border-color: rgba(32, 227, 143, 0.6);
}

.live-feed-btn.active {
    border-color: #20e38f;
    background: radial-gradient(circle at top, rgba(32, 227, 143, 0.2), rgba(15, 23, 42, 0.9));
    box-shadow: 0 0 12px rgba(32, 227, 143, 0.5);
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #20e38f;
    box-shadow: 0 0 6px #20e38f;
    animation: live-pulse 1.5s infinite ease-in-out;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Slow pulse animation for first-time users */
@keyframes first-time-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(32, 227, 143, 0.4);
        border-color: rgba(32, 227, 143, 0.6);
    }
    50% { 
        box-shadow: 0 0 0 4px rgba(32, 227, 143, 0);
        border-color: rgba(32, 227, 143, 1);
    }
}

.live-feed-btn.first-time-pulse {
    animation: first-time-pulse 2s infinite ease-in-out;
}

/* Main content container for map and sidebar */
#main-content {
    display: flex;
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    border-radius: 18px;
}

/* Map Container Styling */
#map {
    flex-grow: 1;
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: #0a0a0a;
    transition: margin-right 0.3s ease-out;
    position: relative; /* For fullscreen button positioning */
}

/* When sidebar is open, shrink map */
body.sidebar-open #map {
    margin-right: 320px;
}

/* Hide browser scrollbar when sidebar is open on desktop to prevent map shift/jitter */
body.sidebar-open {
    overflow: hidden !important;
}

/* Hide gray areas outside map bounds */
.leaflet-container {
    background: #0a0a0a;
}

/* --- SIDEBAR STYLES --- */
#sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: rgba(20, 24, 36, 0.95);
    border-left: 1px solid rgba(79, 209, 255, 0.3);
    padding: 16px;
    box-sizing: border-box;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

#sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

#sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

#sidebar h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #4fd1ff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#close-sidebar {
    background: transparent;
    border: none;
    color: #a0a4b8;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

#close-sidebar:hover {
    background: rgba(255, 82, 82, 0.2);
    color: #FF5252;
}

#cluster-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cluster-item {
    padding: 12px;
    background: rgba(44, 58, 71, 0.6);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.cluster-item:hover {
    background: rgba(44, 58, 71, 0.9);
}

.cluster-item.active {
    border-left-color: #FF5252;
    background: rgba(44, 58, 71, 0.9);
}

.cluster-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.cluster-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.cluster-item-category {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a0a4b8;
}

.cluster-item-text {
    font-size: 12px;
    color: #E8EAE6;
    line-height: 1.4;
}

/* Animation for new items in live feed */
@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.new-feed-item {
    animation: slideInFromTop 0.5s ease-out;
    border-left: 3px solid #20e38f;
    background: rgba(32, 227, 143, 0.1) !important;
}

/* Customizing Leaflet Dark Theme Look */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--dark-surface);
    color: var(--text-color);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.leaflet-popup-content-wrapper {
    max-width: 320px;
}

/* Screenshot mode: Scale down popup to 0.75x and ensure full opacity */
body.screenshot-ready .leaflet-popup,
html[data-screenshot-mode="1"] .leaflet-popup {
    transform: scale(0.75);
    transform-origin: center center;
    opacity: 1 !important;
    visibility: visible !important;
}

body.screenshot-ready .leaflet-popup-content-wrapper,
html[data-screenshot-mode="1"] .leaflet-popup-content-wrapper {
    opacity: 1 !important;
    visibility: visible !important;
}

.leaflet-popup-content {
    max-width: 320px;
    max-height: 80vh; /* Prevent popup from exceeding viewport */
    overflow-y: auto; /* Allow scrolling within popup if content is too tall */
    overflow-x: hidden;
    
    /* Styled scrollbar for dark theme */
    scrollbar-width: thin; /* Firefox - thin scrollbar */
    scrollbar-color: rgba(79, 209, 255, 0.5) rgba(20, 24, 36, 0.8); /* Firefox - thumb and track colors */
}

/* Webkit scrollbar styling (Chrome, Safari, Opera) */
.leaflet-popup-content::-webkit-scrollbar {
    width: 8px; /* Width of the scrollbar */
}

.leaflet-popup-content::-webkit-scrollbar-track {
    background: rgba(20, 24, 36, 0.8); /* Dark track background */
    border-radius: 4px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb {
    background: rgba(79, 209, 255, 0.5); /* Light blue thumb */
    border-radius: 4px;
    border: 1px solid rgba(20, 24, 36, 0.3);
}

.leaflet-popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 209, 255, 0.7); /* Brighter on hover */
}

/* Legacy media styles - now handled by .media-container */
.leaflet-popup-content video:not(.media-container video),
.leaflet-popup-content img:not(.media-container img) {
    width: auto;
    height: auto;
    max-width: 220px !important;
    max-height: 280px !important;
    object-fit: contain;
    border-radius: 4px;
}

/* Share button in popups */
.share-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    background: #303a46;
    color: white;
    border: 1px solid #3a4552;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.share-button:hover {
    background: #3b4654;
}

.share-button:active {
    background: #2a3440;
}

.share-button svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.share-button.copied {
    background: #20e38f;
    border-color: #20e38f;
}

.share-telegram-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    background: #0088cc;
    color: white;
    border: 1px solid #0088cc;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s;
}

.share-telegram-button:hover {
    background: #0099dd;
    border-color: #0099dd;
}

.share-telegram-button:active {
    background: #0077aa;
}

.share-telegram-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Media container styling */
.leaflet-popup-content .media-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #3a4552;
    background: black;
    margin-top: 12px;
    box-sizing: border-box;
}

.leaflet-popup-content .media-container video,
.leaflet-popup-content .media-container img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-sizing: border-box;
}

.leaflet-popup-content .media-container.horizontal video,
.leaflet-popup-content .media-container.horizontal img {
    aspect-ratio: 16 / 9;
    object-fit: contain;
}

.leaflet-popup-content .media-container.vertical {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: black;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.leaflet-popup-content .media-container.vertical video,
.leaflet-popup-content .media-container.vertical img {
    max-width: 260px;
    max-height: 40vh; /* Use viewport height instead of fixed pixels - prevents screen shift */
    width: auto;
    height: auto;
    border: 1px solid #444;
    border-radius: 12px;
    box-sizing: border-box;
}

/* On mobile, make media even smaller to prevent screen shift */
@media (max-width: 768px) {
    .leaflet-popup-content .media-container.vertical video,
    .leaflet-popup-content .media-container.vertical img {
        max-height: 35vh; /* Smaller on mobile to ensure popup fits */
    }
    
    .leaflet-popup-content .media-container.horizontal video,
    .leaflet-popup-content .media-container.horizontal img {
        max-height: 25vh; /* Constrain horizontal media too */
    }
}

/* --- ACCESS CODE MODAL --- */
.access-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 6, 10, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.access-modal.hidden {
    display: none;
}

.access-modal-content {
    background: rgba(20, 24, 36, 0.95);
    border: 1px solid rgba(79, 209, 255, 0.3);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.access-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4fd1ff, #005eff);
    box-shadow: 0 0 20px rgba(0, 140, 255, 0.6);
    margin: 0 auto 20px;
}

.access-modal-content h2 {
    margin: 0 0 8px;
    font-size: 20px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #f5f5f7;
}

.access-modal-content p {
    margin: 0 0 24px;
    color: #a0a4b8;
    font-size: 14px;
}

#access-code-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 8px;
    color: #f5f5f7;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

#access-code-input:focus {
    border-color: #4fd1ff;
    box-shadow: 0 0 10px rgba(79, 209, 255, 0.3);
}

#access-submit-btn {
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, #4fd1ff, #005eff);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

#access-submit-btn:hover {
    box-shadow: 0 0 20px rgba(79, 209, 255, 0.5);
    transform: translateY(-1px);
}

#access-submit-btn:active {
    transform: translateY(0);
}

.access-error {
    color: #ff4444 !important;
    margin-top: 16px !important;
    margin-bottom: 0 !important;
    min-height: 20px;
}

/* Telegram Share Modal - Popup Overlay */
.telegram-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 6, 10, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(1px);
}

.telegram-share-modal.hidden {
    display: none;
}

.telegram-share-modal-content {
    background: rgba(20, 24, 36, 0.98);
    border: 1px solid rgba(79, 209, 255, 0.3);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    position: relative;
}

.telegram-share-modal-content h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #f5f5f7;
}

#telegram-share-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

#telegram-share-close:hover {
    opacity: 1;
}

#telegram-screenshot-img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #3a4552;
    display: block;
    margin: 0 auto;
}

#telegram-screenshot-loading {
    padding: 40px 20px;
    color: #a0a4b8;
}

.video-placeholder {
    width: 100%;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 20%, rgba(79, 209, 255, 0.3), rgba(15, 23, 42, 0.95));
    border-radius: 12px;
    border: 1px solid #3a4552;
}

.video-placeholder-icon {
    font-size: 32px;
    color: #4fd1ff;
    margin-bottom: 8px;
}

.video-placeholder-text {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #e5e7eb;
}

#telegram-share-post-btn,
#telegram-copy-link-btn,
#telegram-copy-img-btn,
#telegram-download-img-btn {
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
}

#telegram-share-post-btn {
    background: #0088cc;
    color: white;
}

#telegram-share-post-btn:hover {
    background: #0099dd;
}

#telegram-copy-link-btn,
#telegram-copy-img-btn,
#telegram-download-img-btn {
    background: var(--dark-surface);
    color: var(--text-color);
    border: 1px solid #3a4552;
}

#telegram-copy-link-btn:hover,
#telegram-copy-img-btn:hover,
#telegram-download-img-btn:hover {
    background: #2a3440;
    border-color: #4a5568;
}

@media (max-width: 768px) {
    .telegram-share-modal-content {
        max-width: 95%;
        padding: 20px;
        max-height: 85vh;
    }
    
    .telegram-share-modal-content h2 {
        font-size: 16px;
        margin-bottom: 16px;
    }
    
    #telegram-share-post-btn,
    #telegram-copy-link-btn,
    #telegram-copy-img-btn,
    #telegram-download-img-btn {
        padding: 8px 16px;
        font-size: 12px;
        flex: 1;
        min-width: 100px;
    }
}

/* Fullscreen button - shown on all devices */
.fullscreen-btn {
    display: flex; /* Show on all devices */
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(20, 24, 36, 0.9);
    border: 1px solid rgba(79, 209, 255, 0.4);
    color: #4fd1ff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.fullscreen-btn:hover {
    background: rgba(20, 24, 36, 0.95);
    border-color: rgba(79, 209, 255, 0.6);
    box-shadow: 0 4px 12px rgba(79, 209, 255, 0.3);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

.fullscreen-btn svg {
    width: 20px;
    height: 20px;
}

/* Fullscreen mode styles */
body.fullscreen-mode {
    padding: 0 !important;
    overflow: hidden;
}

body.fullscreen-mode .geo-header,
body.fullscreen-mode .geo-tagline,
body.fullscreen-mode .geo-filters {
    display: none;
}

body.fullscreen-mode #main-content {
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
}

body.fullscreen-mode #map {
    border-radius: 0;
    border: none;
    height: 100%;
}

body.fullscreen-mode .fullscreen-btn {
    background: rgba(20, 24, 36, 0.95);
}

/* Map watermark */
.map-watermark {
    position: absolute;
    bottom: 30px;
    left: 20px;
    color: #4a4a4a;
    font-family: 'Arial', sans-serif;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: 0.05em;
    z-index: 1000;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.7;
}

@media (max-width: 768px) {
    .map-watermark {
        font-size: 21px; /* 1.5x instead of 2x on mobile (14px * 1.5 = 21px) */
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    .geo-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .geo-header-right {
        width: 100%;
        justify-content: space-between;
    }
    .geo-title {
        font-size: 16px;
    }
    .geo-filters {
        gap: 6px;
    }
    .chip {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    /* Sidebar below map on mobile */
    #main-content {
        flex-direction: column;
        overflow: visible;
    }
    
    body.sidebar-open #map {
        margin-right: 0;
    }
    
    /* On mobile, keep overflow visible for the body because sidebar is fixed to bottom */
    body.sidebar-open {
        overflow: visible !important; /* Keep mobile scrolling functional */
    }
    
    #sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 45vh;
        max-height: 45vh;
        transform: translateY(100%);
        border-left: none;
        border-top: 1px solid rgba(79, 209, 255, 0.3);
        border-radius: 16px 16px 0 0;
    }
    
    #sidebar.open {
        transform: translateY(0);
    }
    
    #map {
        border-radius: 12px;
        position: relative; /* For fullscreen button positioning */
    }
}

/* --- PULSING MARKER STYLES --- */

/* Pulse animation using opacity only - NO transforms to prevent position shifts */
@keyframes pulse {
    0% {
        opacity: 0.9;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.9;
    }
}

.pulsing-marker-container {
    width: 4px;
    height: 4px;
    position: relative;
}

.pulse-marker-ring {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    animation: pulse 1.5s infinite ease-in-out;
    /* background-color is set inline via style attribute */
}

.pulse-marker-dot {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    position: absolute;
    top: 1px;
    left: 1px;
    z-index: 10;
    /* background-color is set inline via style attribute */
}

/* Pulsing animation for newly added events - opacity only */
@keyframes newPing {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        opacity: 1;
    }
}

.new-ping-pulse {
    position: absolute;
    pointer-events: none;
    z-index: 5;
    animation: newPing 0.33s ease-out 3;
}

/* --- MAP MARKERS (exact replica of category-dot) --- */
.map-marker-wrapper {
    background: transparent !important;
    border: none !important;
}

.map-marker-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: category-pulse 2s infinite ease-in-out;
}

