/* filepath: styles.css */
/* Dark Dashboard Theme */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Share+Tech+Mono&display=swap');

:root {
    --bg-primary: #0a0e13;
    --bg-secondary: #12181f;
    --bg-tertiary: #1a222c;
    --bg-card: #151c25;
    --accent-red: #c41e3a;
    --accent-red-glow: rgba(196, 30, 58, 0.4);
    --accent-amber: #d4a017;
    --accent-amber-glow: rgba(212, 160, 23, 0.3);
    --accent-green: #2d5a27;
    --accent-cyan: #17a2b8;
    --text-primary: #e8e6e3;
    --text-secondary: #8b9098;
    --text-muted: #5a6270;
    --border-dark: #2a3441;
    --border-glow: rgba(196, 30, 58, 0.2);
    --scanline: rgba(255, 255, 255, 0.03);
}

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

body {
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* View Mode Selector */
.view-mode-selector {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-dark);
    border-radius: 0 0 12px 12px;
    border-top: none;
    box-shadow: 0 4px 30px rgba(0,0,0,0.8);
    overflow: hidden;
}

.view-mode-selector.collapsed .view-mode-buttons {
    max-height: 0;
    padding: 0 8px;
    opacity: 0;
}

.view-mode-toggle {
    width: 100%;
    padding: 10px 24px;
    background: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    color: var(--accent-red);
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.view-mode-toggle:hover {
    background: rgba(196, 30, 58, 0.15);
}

.toggle-icon {
    transition: transform 0.3s ease;
    display: inline-block;
    font-size: 10px;
}

.view-mode-selector:not(.collapsed) .toggle-icon {
    transform: rotate(180deg);
}

.view-mode-buttons {
    display: flex;
    gap: 8px;
    padding: 12px;
    max-height: 100px;
    opacity: 1;
    transition: all 0.3s ease;
    overflow: hidden;
}

.view-mode-divider {
    width: 1px;
    background: var(--border-dark);
    margin: 4px 0;
}

.view-mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 12px;
}

.view-mode-btn:hover {
    background: rgba(196, 30, 58, 0.1);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.view-mode-btn.active {
    background: rgba(196, 30, 58, 0.2);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.view-icon {
    font-size: 20px;
    filter: grayscale(0.5);
}

.view-mode-btn.active .view-icon,
.view-mode-btn:hover .view-icon {
    filter: grayscale(0);
}

.view-mode-btn.disabled,
.view-mode-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.view-mode-btn.disabled:hover,
.view-mode-btn:disabled:hover {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.view-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 10px;
}

/* List View */
.list-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-primary);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 900;
    padding: 20px 20px 80px 20px;
}

.list-view.hidden {
    display: none;
}

.list-header {
    max-width: 1400px;
    margin: 0 auto 30px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-dark);
    border-radius: 8px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.list-header h2 {
    font-size: 28px;
    color: var(--accent-red);
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
}

.list-stats {
    font-size: 16px;
    color: var(--text-secondary);
    font-family: 'Share Tech Mono', monospace;
}

.list-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding-bottom: 20px;
}

.list-item {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--bg-secondary);
    border: 2px solid var(--border-dark);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.list-item:hover {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px var(--accent-red-glow);
    transform: translateY(-2px);
    color: inherit;
    text-decoration: none;
}

.list-item-image-wrapper {
    width: 100%;
    height: 180px;
    background: var(--bg-tertiary);
    overflow: hidden;
    position: relative;
}

.list-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--bg-tertiary);
    transition: transform 0.3s;
}

.list-item:hover .list-item-image {
    transform: scale(1.05);
}

/* No Image Placeholder */
.list-item-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    color: var(--text-muted);
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.list-item-no-image-marker {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.list-item-no-image-marker .marker-symbol {
    transform: scale(2.5);
}

.list-item-no-image.conflict { color: #ff4757; border-bottom: 3px solid #ff4757; }
.list-item-no-image.protest { color: #ffa502; border-bottom: 3px solid #ffa502; }
.list-item-no-image.disaster { color: #ff6b35; border-bottom: 3px solid #ff6b35; }
.list-item-no-image.diplomatic { color: #3498db; border-bottom: 3px solid #3498db; }
.list-item-no-image.economic { color: #2ecc71; border-bottom: 3px solid #2ecc71; }
.list-item-no-image.other { color: #9b59b6; border-bottom: 3px solid #9b59b6; }

/* Country Flag */
.country-flag {
    width: 16px;
    height: 11px;
    object-fit: cover;
    border-radius: 1px;
    margin-left: 4px;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    display: inline-block;
}

.list-item-content {
    padding: 16px;
}

.list-item-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    font-family: 'Share Tech Mono', monospace;
}

.list-item-category.conflict { background: rgba(220, 53, 69, 0.2); color: #dc3545; }
.list-item-category.protest { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.list-item-category.disaster { background: rgba(253, 126, 20, 0.2); color: #fd7e14; }
.list-item-category.diplomatic { background: rgba(0, 123, 255, 0.2); color: #007bff; }
.list-item-category.economic { background: rgba(40, 167, 69, 0.2); color: #28a745; }
.list-item-category.other { background: rgba(108, 117, 125, 0.2); color: #6c757d; }

.list-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-item-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Share Tech Mono', monospace;
}

.list-item-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item-location {
    color: var(--accent-amber);
    font-weight: 600;
}

.list-item-publisher {
    color: var(--accent-cyan);
}

/* Digest View */
.digest-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 900;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.digest-view.hidden {
    display: none;
}

.digest-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-dark);
    flex-shrink: 0;
}

.digest-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-dark);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.digest-nav-btn:hover:not(:disabled) {
    border-color: var(--accent-red);
    background: rgba(196, 30, 58, 0.1);
    color: var(--accent-red);
}

.digest-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.digest-counter {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-red);
    font-family: 'Share Tech Mono', monospace;
}

.digest-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.digest-content * {
    box-sizing: border-box;
}

.digest-article-image {
    width: 100%;
    max-width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid var(--border-dark);
    display: block;
}

.digest-article-header {
    margin-bottom: 20px;
}

.digest-article-category {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    font-family: 'Share Tech Mono', monospace;
}

.digest-article-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.3;
}

.digest-article-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-dark);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.digest-meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.digest-meta-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.digest-meta-value {
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
}

.digest-article-actions {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
}

/* Digest No Image Placeholder */
.digest-no-image {
    width: 100%;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 2px solid var(--border-dark);
    border-radius: 8px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.digest-no-image-marker {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.digest-no-image-marker .marker-symbol {
    transform: scale(3);
}

.digest-no-image.conflict { color: #ff4757; border-color: #ff4757; }
.digest-no-image.protest { color: #ffa502; border-color: #ffa502; }
.digest-no-image.disaster { color: #ff6b35; border-color: #ff6b35; }
.digest-no-image.diplomatic { color: #3498db; border-color: #3498db; }
.digest-no-image.economic { color: #2ecc71; border-color: #2ecc71; }
.digest-no-image.other { color: #9b59b6; border-color: #9b59b6; }

/* Digest Modal Card - Reuses modal styling */
.digest-modal-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-dark);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 600px;
    flex-shrink: 0;
}

.digest-modal-header {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.digest-modal-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.digest-modal-header .modal-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    color: var(--text-muted);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.digest-modal-header .placeholder-marker {
    transform: scale(3);
    opacity: 0.6;
}

.digest-modal-body {
    padding: 24px;
}

.digest-modal-body .event-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.3;
}

.digest-modal-body .event-source-highlight {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.digest-modal-body .publisher-badge,
.digest-modal-body .country-badge {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
}

.digest-modal-body .badge-label {
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}

.digest-modal-body .event-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border-dark);
}

.digest-modal-body .event-meta-item {
    font-size: 13px;
    color: var(--text-secondary);
}

.digest-modal-body .event-meta-item strong {
    display: block;
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    font-weight: 600;
}

.digest-modal-body .event-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.digest-map-preview {
    height: 200px;
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-dark);
    position: relative;
    flex-shrink: 0;
}

/* Scanline overlay effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        var(--scanline) 2px,
        var(--scanline) 4px
    );
}

/* Hamburger Button - Moves with sidebar */
.hamburger {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 1100;
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-red);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    box-shadow: 
        0 0 20px var(--accent-red-glow),
        inset 0 0 20px rgba(0,0,0,0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
}

/* When sidebar is open, move hamburger with it */
.sidebar:not(.collapsed) ~ .hamburger {
    left: 356px;
}

/* Mobile: Larger touch target */
@media (max-width: 768px) {
    .hamburger {
        width: 56px;
        height: 56px;
        left: 12px;
        top: 12px;
        gap: 6px;
    }
    
    .hamburger span {
        width: 24px;
        height: 2.5px;
    }
}

.hamburger:hover {
    background: var(--accent-red);
    box-shadow: 
        0 0 30px var(--accent-red-glow),
        0 0 60px var(--accent-red-glow);
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--accent-red);
    transition: all 0.3s ease;
}

.hamburger:hover span {
    background: var(--text-primary);
}

/* Backdrop overlay */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 340px;
    height: 100%;
    background: var(--bg-secondary);
    border-right: 2px solid var(--border-dark);
    z-index: 1050;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 4px 0 30px rgba(0,0,0,0.5);
    -webkit-overflow-scrolling: touch;
}

/* Mobile: Full-width or narrower sidebar */
@media (max-width: 768px) {
    #sidebar {
        width: 85vw;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    #sidebar {
        width: 100vw;
        max-width: none;
    }
}

#sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent,
        var(--accent-red),
        var(--accent-amber),
        var(--accent-red),
        transparent
    );
    opacity: 0.5;
}

#sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border-bottom: 2px solid var(--border-dark);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header h2::before {
    content: '◉';
    color: var(--accent-red);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.close-sidebar {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-sidebar:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: rgba(196, 30, 58, 0.1);
}

.sidebar-content {
    padding: 20px;
}

/* Donate Section in Sidebar */
.donate-section {
    margin-bottom: 24px;
}

.donate-section h3 {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.donate-section h3::before {
    content: '//';
    color: var(--accent-red);
    font-family: 'Share Tech Mono', monospace;
}

.donate-button-wrapper {
    width: 100%;
}

.donate-button-wrapper form {
    width: 100%;
}

.donate-btn-sidebar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid rgba(196, 30, 58, 0.3);
    border-radius: 4px;
    color: var(--accent-red);
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.donate-btn-sidebar:hover {
    background: rgba(196, 30, 58, 0.1);
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.2);
}

.donate-btn-sidebar .paypal-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.donate-btn-sidebar:hover .paypal-icon {
    transform: scale(1.1);
}

.filter-section,
.stats-section,
.cache-status-section,
.info-section {
    margin-bottom: 24px;
}

.search-section h3,
.filter-section h3,
.cache-status-section h3,
.stats-section h3 {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-section h3::before,
.filter-section h3::before,
.cache-status-section h3::before,
.stats-section h3::before {
    content: '//';
    color: var(--accent-red);
    font-family: 'Share Tech Mono', monospace;
}

/* Cache Status Section */
.cache-info-box {
    background: rgba(196, 30, 58, 0.05);
    padding: 16px;
    border-radius: 4px;
    border: 1px solid rgba(196, 30, 58, 0.2);
    border-left: 3px solid var(--accent-red);
}

.cache-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-dark);
}

.cache-status-item:last-of-type {
    border-bottom: none;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.status-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.status-value {
    font-size: 13px;
    color: var(--text-primary);
    font-family: 'Share Tech Mono', monospace;
    font-weight: 600;
}

.status-value.countdown {
    color: var(--accent-red);
    font-size: 16px;
}

.refresh-schedule {
    padding-top: 12px;
    border-top: 1px solid var(--border-dark);
    font-size: 12px;
}

.refresh-schedule strong {
    display: block;
    color: var(--accent-red);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.schedule-time {
    color: var(--text-secondary);
    font-family: 'Share Tech Mono', monospace;
    padding-left: 8px;
}

.clear-cache-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid rgba(196, 30, 58, 0.3);
    color: var(--accent-red);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'Rajdhani', sans-serif;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.clear-cache-btn:hover {
    background: rgba(196, 30, 58, 0.1);
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.2);
}

.clear-cache-btn:active {
    transform: scale(0.98);
}

.cache-icon {
    font-size: 14px;
    filter: grayscale(0.3);
}

#countrySearch {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Share Tech Mono', monospace;
    color: var(--text-primary);
    transition: all 0.2s;
}

@media (max-width: 480px) {
    #countrySearch {
        font-size: 16px;
        padding: 14px 12px;
    }
}

#countrySearch::placeholder {
    color: var(--text-muted);
}

#countrySearch:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 20px var(--accent-red-glow);
}

#countryList {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.country-item {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Share Tech Mono', monospace;
    color: var(--text-secondary);
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.country-item:hover {
    background: var(--bg-tertiary);
    border-left-color: var(--accent-red);
    color: var(--text-primary);
}

/* Filter Items */
.filter-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 4px;
    cursor: pointer;
    background: var(--bg-primary);
    border: 1px solid var(--border-dark);
    transition: all 0.2s;
    min-height: 44px;
}

@media (max-width: 480px) {
    .filter-item {
        padding: 14px 12px;
        min-height: 48px;
    }
}

.filter-item:hover {
    border-color: var(--text-muted);
    background: var(--bg-tertiary);
}

.filter-item input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-dark);
    border-radius: 3px;
    margin-right: 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    min-width: 18px;
}

@media (max-width: 480px) {
    .filter-item input[type="checkbox"] {
        width: 20px;
        height: 20px;
        min-width: 20px;
    }
}

.filter-item input[type="checkbox"]:checked {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.filter-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.filter-icon {
    font-size: 18px;
    margin-right: 10px;
    filter: grayscale(0.3);
}

/* Category symbols using CSS shapes */
.filter-icon.category-symbol {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: none;
}

.filter-item.conflict .category-symbol::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid #ff4757;
}

.filter-item.protest .category-symbol::before {
    content: '';
    width: 14px;
    height: 14px;
    background: #ffa502;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 165, 2, 0.5);
}

.filter-item.disaster .category-symbol::before {
    content: '';
    width: 14px;
    height: 14px;
    background: #ff6b35;
    transform: rotate(45deg);
}

.filter-item.diplomatic .category-symbol::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 3px solid #3498db;
    border-radius: 50%;
    box-sizing: border-box;
}

.filter-item.economic .category-symbol::before {
    content: '';
    width: 12px;
    height: 12px;
    background: #2ecc71;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.filter-item.other .category-symbol::before {
    content: '';
    width: 14px;
    height: 14px;
    background: transparent;
    border: 3px solid #9b59b6;
    box-sizing: border-box;
}

.filter-label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.filter-count {
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Share Tech Mono', monospace;
    color: var(--accent-amber);
    border: 1px solid var(--border-dark);
}

/* Category-specific colors */
.filter-item.conflict .filter-count { color: #ff4757; border-color: rgba(255, 71, 87, 0.3); }
.filter-item.protest .filter-count { color: #ffa502; border-color: rgba(255, 165, 2, 0.3); }
.filter-item.disaster .filter-count { color: #ff6b35; border-color: rgba(255, 107, 53, 0.3); }
.filter-item.diplomatic .filter-count { color: #3498db; border-color: rgba(52, 152, 219, 0.3); }
.filter-item.economic .filter-count { color: #2ecc71; border-color: rgba(46, 204, 113, 0.3); }
.filter-item.other .filter-count { color: #9b59b6; border-color: rgba(155, 89, 182, 0.3); }

.filter-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'Rajdhani', sans-serif;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: rgba(196, 30, 58, 0.1);
}

/* Heatmap Toggle Section */
.heatmap-toggle-section {
    margin-bottom: 20px;
}

.heatmap-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.heatmap-btn.active {
    background: rgba(196, 30, 58, 0.2);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.heatmap-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    background: linear-gradient(90deg, 
        #004e92 0%, 
        #f39c12 50%, 
        #e74c3c 100%
    );
    border-radius: 2px;
}

/* Stats Section */
.stats-section {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: 4px;
    border: 1px solid var(--border-dark);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: 'STATS';
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-family: 'Share Tech Mono', monospace;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-dark);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item span:first-child {
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 11px;
}

.stat-item span:last-child {
    font-weight: 700;
    font-family: 'Share Tech Mono', monospace;
    color: var(--accent-amber);
    font-size: 16px;
}

/* Info Section */
.info-section {
    background: rgba(212, 160, 23, 0.1);
    padding: 14px;
    border-radius: 4px;
    border: 1px solid rgba(212, 160, 23, 0.3);
    border-left: 3px solid var(--accent-amber);
}

.info-box {
    display: flex;
    gap: 12px;
}

.info-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: var(--accent-amber);
    color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Share Tech Mono', monospace;
}

.info-text {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.info-text strong {
    color: var(--accent-amber);
}

/* Map Container */
#map {
    width: 100%;
    height: 100%;
    margin-left: 0;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: saturate(0.7) contrast(1.1);
}

/* Dark map tiles override */
.leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) saturate(0.5) brightness(0.8);
}

.leaflet-container {
    background: var(--bg-primary);
}

/* Event Icons - Map Markers */
.custom-icon {
    background: none !important;
    border: none !important;
}

.event-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: none;
    border: none;
    box-shadow: none;
}

/* Remove ping animation for cleaner look */
.event-icon::before {
    display: none;
}

.event-icon:hover {
    transform: scale(1.3);
    z-index: 1000 !important;
    filter: drop-shadow(0 0 8px currentColor);
}

/* Category colors matching sidebar exactly */
.event-icon.conflict { 
    color: #ff4757;
}
.event-icon.protest { 
    color: #ffa502;
}
.event-icon.disaster { 
    color: #ff6b35;
}
.event-icon.diplomatic { 
    color: #3498db;
}
.event-icon.economic { 
    color: #2ecc71;
}
.event-icon.other { 
    color: #9b59b6;
}

/* Marker symbols - CSS shapes for map markers */
.marker-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.conflict-symbol::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid currentColor;
}

.protest-symbol::before {
    content: '';
    width: 14px;
    height: 14px;
    background: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
}

.disaster-symbol::before {
    content: '';
    width: 14px;
    height: 14px;
    background: currentColor;
    transform: rotate(45deg);
}

.diplomatic-symbol::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 3px solid currentColor;
    border-radius: 50%;
    box-sizing: border-box;
}

.economic-symbol::before {
    content: '';
    width: 14px;
    height: 14px;
    background: currentColor;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.other-symbol::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 3px solid currentColor;
    box-sizing: border-box;
}

/* Loading Screen */ */
#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 24px 48px;
    border-radius: 4px;
    z-index: 2000;
    font-size: 14px;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 2px solid var(--accent-red);
    box-shadow: 
        0 0 40px var(--accent-red-glow),
        inset 0 0 40px rgba(0,0,0,0.5);
}

#loading::before {
    content: '◉ ';
    color: var(--accent-red);
    animation: pulse-dot 1s infinite;
}

.loading-hidden {
    display: none !important;
}

/* Modal - Event Details */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* Rope-line modal - no dark overlay, positioned to the side */
.modal.random-mode {
    background-color: transparent;
    pointer-events: none;
    justify-content: center;
    align-items: center;
    padding-right: 80px;
    padding-bottom: 60px;
}

.modal.random-mode .modal-content {
    pointer-events: auto;
    position: relative;
    margin-left: auto;
    max-width: 420px;
    width: 420px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    transform: none;
    top: auto;
    right: auto;
}

/* Random modal content adjustments for narrower width */
.modal.random-mode #modalBody {
    padding: 20px 24px 24px 24px;
    margin-top: -40px;
}

.modal.random-mode .event-title {
    font-size: 18px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.modal.random-mode .event-source-highlight {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.modal.random-mode .publisher-badge,
.modal.random-mode .country-badge {
    padding: 8px 12px;
    font-size: 11px;
    min-width: auto;
    flex: none;
}

.modal.random-mode .event-meta {
    gap: 12px 20px;
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.modal.random-mode .event-meta-item {
    font-size: 12px;
}

.modal.random-mode .event-actions {
    gap: 8px;
    margin: 16px 0;
}

.modal.random-mode .action-btn {
    padding: 10px 16px;
    font-size: 11px;
}

.modal.random-mode #modalHeader {
    max-height: 200px;
}

.modal.random-mode .modal-content::before {
    font-size: 9px;
    padding: 3px 8px;
    top: 12px;
    left: 12px;
}

/* Connection line from marker to modal */
.modal-connection-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2999;
}

.modal-connection-line .connection-path {
    stroke-width: 2.5;
    stroke-dasharray: 8, 4;
    animation: dashMove 0.5s linear infinite;
    stroke-linecap: round;
}

.modal-connection-line .connection-dot {
    filter: url(#glow);
}

@keyframes dashMove {
    to {
        stroke-dashoffset: -12;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 4px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 
        0 0 40px rgba(0,0,0,0.6),
        0 0 60px var(--accent-red-glow);
    animation: slideUp 0.3s ease;
    position: relative;
    border: 1px solid var(--border-dark);
}

.modal-content::before {
    display: none;
}

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

.close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    background: var(--bg-primary);
    z-index: 100;
    border-radius: 4px;
    border: 1px solid var(--border-dark);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

#modalHeader {
    display: block;
    width: 100%;
    max-height: 350px;
    overflow: hidden;
    background: var(--bg-primary);
    position: relative;
}

#modalHeader::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(transparent, var(--bg-secondary));
    pointer-events: none;
}

#modalHeader img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
    filter: saturate(0.7) contrast(1.1);
}

.modal-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 350px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
    color: var(--text-muted);
    font-size: 48px;
    border-bottom: 1px solid var(--border-dark);
}

.modal-loading {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 20px;
    text-align: center;
    font-family: 'Share Tech Mono', monospace;
}

#modalBody {
    padding: 30px 40px 40px 40px;
    margin-top: -60px;
    background: var(--bg-secondary);
    position: relative;
    z-index: 2;
    border-top: 1px solid var(--border-dark);
}

.event-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    line-height: 1.4;
    letter-spacing: 0.5px;
}

/* Source Badges */
.event-source-highlight {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-dark);
}

.publisher-badge,
.country-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.publisher-badge {
    background: var(--bg-primary);
    color: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
    flex: 1;
    min-width: 180px;
}

.country-badge {
    background: var(--bg-primary);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
    flex: 1;
    min-width: 140px;
}

.badge-label {
    color: var(--text-muted);
    font-weight: 400;
    margin-right: 4px;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-dark);
}

.event-meta-item {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-meta-item strong {
    font-size: 14px;
    color: var(--text-muted);
}

.event-actions {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'Rajdhani', sans-serif;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.source-btn {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 0 20px var(--accent-red-glow);
}

.source-btn:hover {
    background: #a01830;
    box-shadow: 0 0 40px var(--accent-red-glow);
    transform: translateY(-2px);
}

.translate-btn {
    background: transparent;
    color: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
}

.translate-btn:hover {
    background: rgba(23, 162, 184, 0.1);
    box-shadow: 0 0 20px rgba(23, 162, 184, 0.3);
    transform: translateY(-2px);
}

.reroll-btn {
    background: transparent;
    color: var(--accent-orange, #ff9800);
    border: 1px solid var(--accent-orange, #ff9800);
}

.reroll-btn:hover {
    background: rgba(255, 152, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.3);
    transform: translateY(-2px);
}

.translation-result {
    margin-top: 16px;
    padding: 16px;
    border-radius: 4px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
    font-family: 'Share Tech Mono', monospace;
}

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

.translation-loading {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-dark);
}

.translation-success {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
    line-height: 1.6;
}

.translation-error {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Related Articles */
.related-articles {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-dark);
}

.related-articles strong {
    display: block;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.related-articles strong::before {
    content: '// ';
    color: var(--accent-red);
}

.related-articles ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.related-articles li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-dark);
    font-size: 13px;
}

.related-articles li:last-child {
    border-bottom: none;
}

.related-articles li strong {
    display: inline;
    color: var(--accent-amber);
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: 0;
}

.related-articles li strong::before {
    content: none;
}

.related-articles a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.related-articles a:hover {
    color: var(--accent-cyan);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Leaflet Zoom Controls */
.leaflet-top.leaflet-right {
    top: 20px;
    right: 20px;
}

.leaflet-control-zoom {
    border: 2px solid var(--border-dark) !important;
    border-radius: 4px !important;
    background: var(--bg-secondary) !important;
    box-shadow: 0 0 20px rgba(0,0,0,0.5) !important;
}

.leaflet-control-zoom a {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-dark) !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-tertiary) !important;
    color: var(--accent-red) !important;
}

.leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}

/* Map Legend - Bottom bar style */
.map-legend {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 25, 0.9);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    padding: 8px 16px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(8px);
}

.legend-header {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-red);
    font-family: 'Share Tech Mono', monospace;
    white-space: nowrap;
    padding-right: 12px;
    border-right: 1px solid var(--border-dark);
    margin: 0;
}

.legend-header::before {
    content: '// ';
    color: var(--accent-red);
}

.legend-items {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: center;
}

/* Mobile Responsive for View Modes */
@media (max-width: 768px) {
    .view-mode-toggle {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .view-mode-buttons {
        gap: 4px;
        padding: 8px;
    }
    
    .view-mode-btn {
        padding: 8px 12px;
        font-size: 10px;
    }
    
    .view-icon {
        font-size: 16px;
    }
    
    .view-label {
        font-size: 9px;
    }
    
    .list-view {
        padding: 10px 10px 60px 10px;
    }
    
    .list-header {
        padding: 12px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .list-header h2 {
        font-size: 20px;
    }
    
    .list-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .digest-content {
        padding: 20px 12px;
    }
    
    .digest-article-title {
        font-size: 22px;
    }
    
    .digest-article-image {
        max-height: 200px;
    }
    
    .digest-navigation {
        padding: 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .digest-nav-btn {
        padding: 8px 14px;
        font-size: 11px;
        flex: 1;
    }
    
    .digest-counter {
        font-size: 14px;
        width: 100%;
        text-align: center;
        order: -1;
    }
    
    .digest-map-preview {
        height: 150px;
    }
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-symbol {
    width: 14px;
    height: 14px;
    min-width: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Legend symbols matching map marker symbols */
.legend-symbol.conflict-symbol::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #ff4757;
}

.legend-symbol.protest-symbol::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #ffa502;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255, 165, 2, 0.5);
}

.legend-symbol.disaster-symbol::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #ff6b35;
    transform: rotate(45deg);
}

.legend-symbol.diplomatic-symbol::before {
    content: '';
    width: 10px;
    height: 10px;
    border: 2px solid #3498db;
    border-radius: 50%;
    box-sizing: border-box;
}

.legend-symbol.economic-symbol::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #2ecc71;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.legend-symbol.other-symbol::before {
    content: '';
    width: 10px;
    height: 10px;
    background: transparent;
    border: 2px solid #9b59b6;
    box-sizing: border-box;
}

.legend-label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    font-size: 10px;
}

/* Responsive - Tablet (768px and below) */
@media (max-width: 768px) {
    .sidebar:not(.collapsed) ~ .hamburger {
        left: 296px;
    }
    
    .cache-status-section {
        margin-bottom: 20px;
    }
    
    .cache-info-box {
        padding: 12px;
    }
    
    .status-label {
        font-size: 10px;
    }
    
    .status-value {
        font-size: 12px;
    }
    
    .status-value.countdown {
        font-size: 14px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    #modalHeader img {
        height: 200px;
    }
    
    #modalBody {
        padding: 20px;
        margin-top: -40px;
    }
    
    .event-title {
        font-size: 20px;
    }
    
    .event-source-highlight {
        flex-direction: column;
        gap: 12px;
    }
    
    .publisher-badge,
    .country-badge {
        width: 100%;
    }
    
    .map-legend {
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        padding: 6px 12px;
        width: auto;
        max-width: calc(100% - 24px);
    }
    
    .legend-header {
        font-size: 9px;
        display: none; /* Hide header on tablet to save space */
    }
    
    .legend-item {
        font-size: 10px;
        gap: 4px;
    }
    
    .legend-symbol {
        width: 12px;
        height: 12px;
        min-width: 12px;
    }
}

/* Responsive - Small phones (480px and below) */
@media (max-width: 480px) {
    .sidebar:not(.collapsed) ~ .hamburger {
        left: 12px;
    }
    
    .modal {
        padding: 12px;
    }
    
    .modal-content {
        width: 100%;
        max-height: 95vh;
        border-radius: 8px;
        border-width: 1px;
    }
    
    #modalHeader {
        padding: 0;
    }
    
    #modalHeader img {
        height: 180px;
        width: 100%;
        border-radius: 6px 6px 0 0;
        object-fit: cover;
    }
    
    #modalBody {
        padding: 16px;
        margin-top: 0;
        max-height: calc(95vh - 220px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .event-title {
        font-size: 18px;
        line-height: 1.3;
        margin-bottom: 12px;
    }
    
    .event-source-highlight {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 14px;
    }
    
    .publisher-badge,
    .country-badge {
        width: 100%;
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .event-details {
        margin-top: 14px;
    }
    
    .event-detail-item {
        padding: 10px 0;
        border-bottom: 1px solid var(--border-dark);
        font-size: 13px;
    }
    
    .event-detail-label {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .event-articles-list {
        margin-top: 14px;
    }
    
    .event-article-item {
        padding: 12px;
        margin-bottom: 10px;
        font-size: 12px;
    }
    
    .event-article-title {
        font-size: 12px;
        line-height: 1.4;
        margin-bottom: 6px;
    }
    
    .event-article-link {
        font-size: 11px;
    }
    
    .map-legend {
        bottom: 6px;
        left: 50%;
        transform: translateX(-50%);
        padding: 5px 10px;
        width: auto;
        max-width: calc(100% - 16px);
    }
    
    .legend-header {
        display: none;
    }
    
    .legend-items {
        gap: 8px;
    }
    
    .legend-item {
        font-size: 9px;
        gap: 3px;
        padding: 0;
    }
    
    .legend-label {
        display: none; /* Hide labels on small screens, show only symbols */
    }
    
    .legend-symbol {
        width: 12px;
        height: 12px;
        min-width: 12px;
    }
    
    .legend-symbol.conflict-symbol::before {
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-bottom: 8px solid #ff4757;
    }
    
    .legend-symbol.protest-symbol::before,
    .legend-symbol.disaster-symbol::before {
        width: 9px;
        height: 9px;
    }
    
    .legend-symbol.diplomatic-symbol::before,
    .legend-symbol.other-symbol::before {
        width: 9px;
        height: 9px;
        border-width: 2px;
    }
    
    .legend-symbol.economic-symbol::before {
        width: 8px;
        height: 8px;
    }
}

/* Creator Attribution - Bottom Left */
.creator-attribution {
    position: fixed;
    bottom: 8px;
    left: 8px;
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    font-family: 'Share Tech Mono', monospace;
    z-index: 900;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.creator-attribution:hover {
    opacity: 1;
}

.creator-attribution a {
    color: inherit;
    text-decoration: none;
}

.creator-attribution a:hover {
    color: var(--accent-red);
}

/* Mobile Notice Banner */
.mobile-notice {
    display: none;
    max-width: 1400px;
    margin: 0 auto 20px auto;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-red);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mobile-notice-icon {
    font-size: 18px;
}

.mobile-notice-text {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Moves with sidebar when open */
#sidebar:not(.collapsed) ~ .creator-attribution {
    left: 356px;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    .donate-button-container {
        top: 12px;
        right: 12px;
    }
    
    .donate-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .donate-btn .paypal-icon {
        width: 18px;
        height: 18px;
    }
    
    #sidebar:not(.collapsed) ~ .creator-attribution {
        left: 296px;
    }
    
    /* Hide legend and creator attribution on mobile */
    .map-legend {
        display: none !important;
    }
    
    .creator-attribution {
        display: none !important;
    }
    
    /* Hide entire view mode menu on mobile */
    .view-mode-selector {
        display: none !important;
    }
    
    /* Hide zoom controls on mobile */
    .leaflet-control-zoom {
        display: none !important;
    }
    
    /* Show mobile notice banner */
    .mobile-notice {
        display: flex !important;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .donate-button-container {
        top: 10px;
        right: 10px;
    }
    
    .donate-btn {
        padding: 8px 12px;
        font-size: 12px;
        gap: 6px;
    }
    
    .donate-btn span {
        display: none;
    }
    
    .donate-btn .paypal-icon {
        width: 20px;
        height: 20px;
    }
}
