/* OSINT Dashboard Styles - Complete Version */

/* CSS Custom Properties / Global Variables */
:root {
    /* Modal Spacing Variables - Change these to adjust ALL modals at once */
    --modal-padding: 15px;
    --modal-header-margin-bottom: 8px;
    --modal-header-padding-bottom: 8px;
    --modal-section-padding: 15px;
    --modal-section-margin-bottom: 15px;
    --modal-section-title-margin-bottom: 8px;
    --modal-section-desc-margin-bottom: 12px;
    --modal-section-desc-line-height: 1.5;
    
    /* Border/Spacing Consistency */
    --border-standard-width: 2px;
    --border-radius-large: 12px;
    --border-radius-standard: 8px;
    --border-radius-small: 6px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #e8eaf0; /* Light gray, no purple */
    color: #333;
    overflow: hidden;
    height: 100vh;
    margin: 0;
    padding: 0;
}

.header {
    background: transparent;
    padding: 10px 15px;
    box-shadow: none;
    z-index: 1000;
    position: fixed;
    top: 0;
    left: 320px;
    right: 360px;
    backdrop-filter: blur(10px);
    transition: left 0.3s ease;
}

.main-container.feed-closed .header {
    left: 0;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: nowrap;
    justify-content: space-between;
}

.stats {
    position: relative;
    min-height: 32px; /* Reserve minimal space for compact processing notification */
}

.dark-mode-btn {
    margin-left: auto;
    padding: 8px 12px !important;
    min-width: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header h1 {
    color: #ffffff;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(102, 126, 234, 0.8);
    font-weight: 700;
    flex-shrink: 1;
    min-width: 0;
}

/* On VERY narrow screens, hide " Sentiment Visualization" to show just "Vasama OSINT" */
@media (max-width: 900px) {
    .viz-full {
        display: none;
    }
}

#headerPodcastContainer {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.vasama-link {
    color: #ffffff;
    text-decoration: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.vasama-link:hover {
    color: #667eea;
    border-bottom-color: #667eea;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.8);
}

/* CRITICAL: Z-index must be above filter button */
.stats {
    display: flex;
    gap: 6px; /* Further reduced to fit all cards on one row */
    flex-wrap: wrap;
    margin-top: 0; /* Reduced from 10px */
    position: relative;
    z-index: 10;
}

.stat-card {
    padding: 8px 10px; /* Reduced horizontal padding to fit all cards on one row */
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    border: 1px solid transparent; /* Reserve space for dark mode border */
    box-sizing: border-box; /* Ensure border doesn't affect size */
}

.stat-card:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* All 8 stat cards with proper gradients */
.stat-card.total { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.stat-card.locations { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; }
.stat-card.entities { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white; }
.stat-card.reports { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); color: white; }
.stat-card.favorites { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); color: white; }
.stat-card.war-crimes { background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%); color: white; }
.stat-card.network { background: linear-gradient(135deg, #9c88ff 0%, #5f27cd 100%); color: white; }
.stat-card.reset { background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%); color: white; }
.stat-card.stat-card-systems { background: linear-gradient(135deg, #667eea 0%, #43e97b 100%); color: white; }
.stat-card.stat-card-units { background: linear-gradient(135deg, #fa709a 0%, #764ba2 100%); color: white; }

.stat-card .label {
    font-size: 9px; /* Reduced from 11px */
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.stat-card .label .date-range {
    font-weight: 600;
    color: #667eea;
    text-transform: none;
    margin-left: 2px;
}

body.dark-mode .stat-card .label .date-range {
    color: #8b96ea;
}

.stat-card .value {
    font-size: 18px; /* Reduced from 24px */
    font-weight: bold;
    margin-top: 2px;
}

.stat-card .value.reports-date-value {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Date Range Display - BELOW stats */
.date-range-display {
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    padding: 12px 20px;
    margin: 10px 0 0 0;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Inline Podcast Player - Next to Daily Reports */
.podcast-player-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 0; /* Allow shrinking */
    max-width: 100%; /* Don't overflow container */
}

/* Label for podcast player */
.podcast-label-inline {
    color: white;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0; /* Don't shrink the label */
}

/* Compact but usable audio player */
.podcast-player-inline audio {
    height: 30px;
    width: 100%; /* Fluid width that responds to container */
    max-width: 200px; /* Max width on large screens */
    min-width: 120px; /* Minimum playable width */
    outline: none;
    flex-shrink: 1; /* Allow shrinking */
    flex-grow: 0; /* Don't grow beyond max-width */
}

.podcast-player-inline audio::-webkit-media-controls-enclosure {
    max-width: 100%; /* Responsive */
}

.podcast-player-inline audio::-webkit-media-controls-panel {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

/* Hide only volume controls to keep it compact */
.podcast-player-inline audio::-webkit-media-controls-volume-slider,
.podcast-player-inline audio::-webkit-media-controls-mute-button {
    display: none !important;
}

/* Dark controls for visibility on light panel background */
.podcast-player-inline audio::-webkit-media-controls-play-button,
.podcast-player-inline audio::-webkit-media-controls-timeline,
.podcast-player-inline audio::-webkit-media-controls-current-time-display,
.podcast-player-inline audio::-webkit-media-controls-time-remaining-display {
    filter: brightness(0) contrast(2); /* Very dark/black controls with high contrast */
    opacity: 0.9;
}

/* Main Layout - Fixed right side panel */
.main-container {
    display: flex;
    height: 100vh;
    width: 100%;
    gap: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding-top: 0;
    background: transparent; /* Use body background */
}

/* Leaflet zoom controls positioning - Dynamic and responsive */
:root {
    --zoom-controls-top: 155px;
    --analysis-section-padding: 0px; /* Global padding control for analysis sections */
}

.leaflet-top.leaflet-left {
    top: var(--zoom-controls-top) !important;
    left: 10px !important; /* 10px from left edge of visible map area */
    transition: top 0.3s ease, left 0.3s ease;
}

.map-container:not(.timeline-hidden) .leaflet-top.leaflet-left {
    top: var(--zoom-controls-top) !important;
}

.map-container.timeline-hidden .leaflet-top.leaflet-left {
    top: var(--zoom-controls-top) !important;
}

.map-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    transition: left 0.3s ease, right 0.3s ease;
    padding-left: 320px; /* Space for feed panel */
    padding-right: 360px; /* Space for right panel */
    box-sizing: border-box;
}

.main-container.feed-closed .map-container {
    padding-left: 0;
}

#map {
    width: 100%;
    height: 100%;
    background: transparent;
    position: relative;
    z-index: 1;
}

/* Map Filter Overlay */
.map-filter-overlay {
    position: fixed; /* Changed from absolute to fixed to escape stacking context */
    bottom: 100px; /* Default fallback - will be dynamically calculated by JavaScript */
    left: 330px; /* Position to the right of the feed when it's open */
    z-index: 100000; /* Extremely high to ensure it's above EVERYTHING including dock */
    pointer-events: none;
    transition: left 0.3s ease, bottom 0.3s ease;
}

/* Move filters to the left when feed is closed */
.feed-panel.closed ~ #map .map-filter-overlay,
.main-container.feed-closed .map-filter-overlay {
    left: 10px;
}

.map-filter-overlay-content {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    padding: 8px 12px;
    max-width: 350px;
}

.map-filter-overlay-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.map-filter-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    gap: 6px;
    pointer-events: auto;
    transition: background 0.2s;
}

.map-filter-chip:hover {
    background: rgba(102, 126, 234, 1);
}

.map-filter-chip-label {
    display: inline-block;
}

.map-filter-chip-remove {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    transition: background 0.2s;
    padding: 0;
    border: none;
    color: white;
}

.map-filter-chip-remove:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Dark mode - make it slightly lighter */
body.dark-mode .map-filter-overlay-content {
    background: rgba(0, 0, 0, 0.6);
}

.side-panel {
    width: 360px; /* Reduced from 420px */
    background: white;
    box-shadow: -4px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 900; /* Below header (1000) but above map */
    position: fixed;
    right: 0;
    top: 0; /* Start at top - header no longer overlaps */
    bottom: 0;
    height: 100vh; /* Full height */
    transition: top 0.3s ease;
}

.side-panel.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px;
    text-align: center;
    padding: 40px;
}

/* Connection Point for Line */
.side-panel::before {
    content: '';
    position: fixed; /* Changed from absolute to fixed */
    left: calc(100vw - 360px); /* Position at left edge of side panel */
    top: 50vh; /* Always at vertical center of viewport */
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    transform: translate(-10px, -10px);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6), 0 0 40px rgba(102, 126, 234, 0.3);
    opacity: 0;
    transition: opacity 0.3s, left 0.3s ease;
    z-index: 1100; /* Above everything including header */
}

.main-container.feed-closed .side-panel::before {
    left: calc(100vw - 360px); /* Stay in same position when feed closes */
}

.side-panel.has-connection::before {
    opacity: 1;
    animation: connectionPulse 2s infinite;
}

@keyframes connectionPulse {
    0%, 100% {
        transform: translate(-10px, -10px) scale(1);
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6), 0 0 40px rgba(102, 126, 234, 0.3);
    }
    50% {
        transform: translate(-10px, -10px) scale(1.2);
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.8), 0 0 60px rgba(102, 126, 234, 0.5);
    }
}

/* Feed Panel (Fixed Position) - FULL HEIGHT */
.feed-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 320px; /* Reduced from 400px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 4px 0 15px rgba(0,0,0,0.3);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 500;
    transform: translateX(0); /* OPEN BY DEFAULT */
    transition: transform 0.3s ease;
    box-sizing: border-box; /* Ensure border doesn't affect width */
    border-right: 2px solid transparent; /* Reserve space for dark mode border */
}

.feed-panel.closed {
    transform: translateX(-100%);
}

.feed-panel.open {
    transform: translateX(0);
}

.feed-header {
    background: transparent;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.feed-header h2 {
    color: white;
    font-size: 18px;
    margin: 0;
}

.feed-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.feed-close-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.feed-search-container {
    padding: 10px 15px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 5px;
}

.feed-search-input {
    flex: 1;
    padding: 8px;
    height: 38px;
    border: 1px solid #3a3d52;
    border-radius: 4px;
    background: #252836;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.feed-search-input:focus {
    border-color: #667eea;
}

.feed-search-input::placeholder {
    color: #666;
}

.feed-search-map-btn {
    background: #3a3d52;
    border: 1px solid #3a3d52;
    color: #999;
    padding: 0;
    width: 38px;
    height: 38px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.feed-search-map-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.feed-search-map-btn.active {
    background: #43e97b;
    border-color: #43e97b;
    color: #1a1d2e;
}

.feed-search-map-btn:disabled {
    background: #2a2d3f;
    border-color: #2a2d3f;
    color: #555;
    cursor: not-allowed;
    opacity: 0.5;
}

.clear-feed-search-btn {
    background: #3a3d52;
    border: 1px solid #3a3d52;
    color: #999;
    padding: 0;
    width: 38px;
    height: 38px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-feed-search-btn:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

.feed-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #1a1d2e;
}

.feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 16px;
    text-align: center;
    padding: 60px 40px;
}

.feed-item {
    background: #252836;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid transparent;
    border-bottom: 1px solid transparent; /* Reserve space for dark mode border */
    box-sizing: border-box; /* Ensure borders don't affect dimensions */
    transition: all 0.3s;
    cursor: pointer;
}

.feed-item:hover {
    background: #2d3045;
    border-left-color: #43e97b;
    transform: translateX(5px);
}

.feed-item.active {
    border-left-color: #667eea;
    background: #3a3d52; /* Brighter background */
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    transform: translateX(5px);
}

.feed-item.keyboard-selected {
    border-left-color: #ffd700;
    background: #3a3d52;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    transform: translateX(5px);
}

/* Flash animation when feed item is selected from map */
@keyframes feedFlash {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
        border-left-color: #667eea;
    }
    25% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.9), 0 0 20px rgba(102, 126, 234, 0.6);
        border-left-color: #43e97b;
        transform: translateX(8px) scale(1.02);
    }
    50% {
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
        border-left-color: #667eea;
    }
    75% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.9), 0 0 20px rgba(102, 126, 234, 0.6);
        border-left-color: #43e97b;
        transform: translateX(8px) scale(1.02);
    }
}

.feed-item.flash {
    animation: feedFlash 1.5s ease-in-out;
}

.feed-item-date {
    color: #43e97b;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.feed-item-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.feed-item-description {
    color: #aaa;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* Expand/Collapse button for feed text */
.feed-expand-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    margin-top: 5px;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.feed-expand-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #43e97b;
}

.feed-expand-btn span {
    font-size: 10px;
}

.feed-text-preview,
.feed-text-full {
    display: inline;
}

.feed-item-location {
    color: #e74c3c;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: nowrap; /* Prevent wrapping within flex container */
    white-space: nowrap; /* Keep text on one line */
    overflow: hidden; /* Handle overflow gracefully */
    text-overflow: ellipsis; /* Show ... if text is too long */
}

.feed-match-indicator {
    font-size: 11px;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 6px;
    border-left: 3px solid #667eea;
}

.feed-item-icons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #3a3d4f;
}

.feed-item-icon {
    color: #667eea;
    font-size: 12px;
    opacity: 0.7;
}

/* Feed Item Buttons - SMALLER SIZE */
.feed-item-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #3a3d4f;
}

.feed-btn-map {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    white-space: nowrap;
}

.feed-btn-map:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.feed-btn-telegram {
    background: #252836;
    color: #43e97b;
    border: 1px solid #43e97b;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
    flex: 1;
    white-space: nowrap;
}

.feed-btn-telegram:hover {
    background: #43e97b;
    color: #1a1d2e;
}

/* Event Detail Panel */
.event-detail {
    padding: 20px 15px 15px; /* Extra top padding to prevent overlap with header */
    height: 100%; /* Fill the side panel */
    overflow-y: auto;
}

.event-detail-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
}

.event-title-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.favorite-star {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.3s;
    filter: grayscale(100%);
    flex-shrink: 0;
    opacity: 0.6; /* Lighter in light mode */
}

body.dark-mode .favorite-star {
    opacity: 1; /* Full brightness in dark mode */
    filter: grayscale(100%) brightness(1.5); /* Brighter star in dark mode */
}

body.dark-mode .favorite-star.active {
    filter: grayscale(0%) brightness(1.2);
}

.favorite-star:hover {
    transform: scale(1.2);
    filter: grayscale(0%);
}

.favorite-star.active {
    filter: grayscale(0%);
}

.event-date {
    color: #667eea;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
}

.event-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    flex: 1;
    margin-bottom: 12px;
    line-height: 1.3;
}

.event-location {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: #e74c3c;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
}

.event-source {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: #667eea;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
}

.event-source a {
    color: #667eea;
    text-decoration: underline;
    padding: 0 2px;
    vertical-align: baseline;
}

.event-field-label {
    display: inline-block;
    min-width: 75px;
}

/* Coordinate Links */
.coordinate-link {
    color: #43e97b;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px dotted transparent;
    transition: all 0.3s;
    padding: 0 2px;
    border-radius: 3px;
    cursor: pointer;
}

.coordinate-link:hover {
    background: rgba(67, 233, 123, 0.15);
    border-bottom: 2px dotted #38f9d7;
}

body.dark-mode .coordinate-link {
    color: #5fffa7;
}

body.dark-mode .coordinate-link:hover {
    background: rgba(95, 255, 167, 0.2);
    border-bottom-color: #6bffe5;
}

.wc-badge {
    background: #e74c3c;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

.event-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* Entity links - clickable entities in descriptions */
.entity-link {
    color: #667eea;
    cursor: pointer;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
    background: rgba(102, 126, 234, 0.1);
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.entity-link:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #5568d3;
}

.entity-link:active {
    /* No transform needed */
}

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

.event-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.event-btn.primary { background: #667eea; color: white; }
.event-btn.primary:hover { background: #5568d3; }
.event-btn.secondary { background: #f0f0f0; color: #333; }
.event-btn.secondary:hover { background: #e0e0e0; }
.event-btn.favorite { background: #fa709a; color: white; }
.event-btn.favorite:hover { background: #e9608a; }
.event-btn.favorite.active { background: #fee140; color: #333; }

/* Analysis Search */
.analysis-search-container {
    position: relative;
    margin: 8px 0 5px 0; /* Reduced: 8px top, 5px bottom (less space before OSINT Analysis) */
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 5px;
}

.analysis-search-input {
    flex: 1;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s;
    box-sizing: border-box;
    display: block;
    min-width: 0;
    height: 38px;
}

.analysis-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.analysis-search-map-btn {
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 10px;
    line-height: 1;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analysis-search-map-btn:hover {
    background: #e0e0e0;
    border-color: #667eea;
}

.analysis-search-map-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.analysis-search-clear {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    flex-shrink: 0;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
}

.analysis-search-clear:hover {
    color: #667eea;
}

.analysis-open-all-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analysis-open-all-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.analysis-open-all-btn:active {
    /* No transform needed */
}

.search-highlight {
    background: #fff59d;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Analysis Sections */
.analysis-section {
    margin-top: 15px;
}

.analysis-toggle {
    background: #f0f0f0;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #333;
    margin-bottom: 0; /* No margin when closed */
    transition: background 0.3s;
}

.analysis-toggle:hover {
    background: #e0e0e0;
}

/* Add margin only when content is shown */
.analysis-content.show + .analysis-toggle,
.analysis-section:has(.analysis-content.show) .analysis-toggle {
    margin-bottom: 10px;
}

.analysis-content {
    display: none;
    padding: var(--analysis-section-padding) 15px 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    line-height: 1.6;
    color: #555;
    max-height: 300px;
    overflow-y: auto;
}

.analysis-content.show {
    display: block;
}

.analysis-content ul {
    margin-left: 20px;
    margin-top: 10px;
}

.analysis-content li {
    margin-bottom: 8px;
}

.analysis-content strong {
    color: #667eea;
}

.analysis-loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
    font-size: 14px;
}

/* Bottom Control Buttons - Adjust position with feed */
.bottom-controls {
    position: fixed;
    bottom: 15px;
    left: 340px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px; /* Reduced gap between buttons for tighter layout */
    z-index: 1001;
    transition: left 0.3s ease;
    max-width: calc(100vw - 680px - 60px);
}

.main-container.feed-closed ~ .bottom-controls,
body.feed-closed .bottom-controls {
    left: 15px; /* Move to left when feed is closed */
}

.ctrl-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 6px 10px; /* Tightened for more compact buttons */
    border: 2px solid #667eea;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px; /* Reduced gap between emoji and text */
    box-sizing: border-box;
    white-space: nowrap; /* Prevent text wrapping */
}

.ctrl-btn span {
    font-size: 14px; /* Emoji size */
}

.ctrl-btn:hover {
    background: #667eea;
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Danger/Reset button styling */
.ctrl-btn-danger {
    background: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

.ctrl-btn-danger:hover {
    background: #c82333 !important;
    border-color: #bd2130 !important;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5) !important;
}

.ctrl-btn.feed-active {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border-color: #43e97b;
}

.ctrl-btn.active {
    background: #667eea;
    color: white;
}

/* Time Slider Container - Redesigned with Toggle */
.time-slider-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 15px;
    margin: 0;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: fixed;
    top: 145px;
    left: 0;
    right: 0;
    z-index: 400;
    transition: all 0.3s ease;
}

/* Dark mode timeline */
body.dark-mode .time-slider-container {
    background: rgba(42, 42, 62, 0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode .time-slider-container input[type="date"] {
    background: #2a2a3e;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode .time-slider-container .ctrl-btn {
    background: #2a2a3e;
    color: #e0e0e0;
}

body.dark-mode .time-slider-container .ctrl-btn:hover {
    background: #3a3a4e;
}

.time-slider-container.collapsed {
    display: none;
}

.time-controls-row {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
}

.time-control-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.time-manual-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.time-input-group label {
    font-weight: 600;
    color: #555;
    font-size: 12px;
    white-space: nowrap;
}

.time-date-input {
    padding: 6px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    width: 140px;
    font-family: monospace;
    transition: border-color 0.3s;
}

.time-date-input:focus {
    outline: none;
    border-color: #667eea;
}

.time-date-input::placeholder {
    color: #999;
}

.time-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-slider-row label {
    font-weight: 600;
    color: #555;
    font-size: 12px;
    white-space: nowrap;
}

.time-control-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 4px 10px; /* Reduced from 6px 14px */
    border-radius: 4px; /* Reduced from 6px */
    font-weight: 600;
    font-size: 11px; /* Reduced from 13px */
    cursor: pointer;
    transition: all 0.3s;
}

.time-control-btn:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.time-control-btn.apply-btn {
    background: #43e97b;
}

.time-control-btn.apply-btn:hover {
    background: #38d169;
}

.time-slider {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.time-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.time-slider-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
    white-space: nowrap;
}


.bottom-filter-panel {
    position: fixed;
    bottom: 70px; /* Default fallback - will be updated dynamically */
    left: 320px;
    right: 360px;
    background: white;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    z-index: 8;
    transform: translateY(calc(100% + 70px)); /* Will be updated dynamically */
    transition: transform 0.3s, left 0.3s ease, right 0.3s ease, visibility 0s 0.3s;
    visibility: hidden;
}

.main-container.feed-closed ~ .bottom-filter-panel,
body.feed-closed .bottom-filter-panel {
    left: 0; /* Full width when feed is closed */
}

.bottom-filter-panel.open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.3s, left 0.3s ease, right 0.3s ease, visibility 0s 0s;
}

.filter-panel-content {
    padding: 10px 20px; /* Reduced top/bottom padding from 20px to 10px */
}

.filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px; /* Reduced from 15px to 8px */
    align-items: center;
}

.filter-group {
    flex: 1;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

/* Fix date input to use same font as text inputs (not monospace) */
.filter-group input[type="date"] {
    font-family: inherit;
    font-size: 14px;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
}

.search-options {
    margin-top: 3px; /* Reduced from 8px to 3px - less space between search field and checkbox */
}

.search-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    padding: 6px 0;
}

.search-checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    margin: 0;
}

.search-checkbox-label:hover {
    color: #667eea;
}

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

/* Make buttons in filter-actions fill width dynamically */
.filter-actions .btn {
    flex: 1; /* Equal width for all buttons */
    min-width: 0; /* Allow shrinking below content width */
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

/* Disabled button states */
.btn:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
    background: #ccc !important;
    color: #888 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none !important;
}

/* Dark mode disabled buttons */
body.dark-mode .btn:disabled,
body.dark-mode .btn-primary:disabled,
body.dark-mode .btn-secondary:disabled {
    background: #3a3a4e !important;
    color: #666 !important;
    opacity: 0.5;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Darker backdrop */
    animation: fadeIn 0.3s;
    overflow: hidden; /* Prevent page scrolling behind modal */
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 25px; /* Reduced from 30px */
    max-width: 1040px; /* 30% wider for better readability */
    width: 90%;
    max-height: 85vh; /* Increased from 80vh */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--modal-header-margin-bottom);
    padding-bottom: var(--modal-header-padding-bottom);
    border-bottom: var(--border-standard-width) solid #e0e0e0;
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
}

.modal-search {
    margin-bottom: 10px;
}

.modal-search input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.modal-search input:focus {
    outline: none;
    border-color: #667eea;
}

.modal-selection-count {
    text-align: center;
    margin: 15px 0;
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
}

.modal-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 0;
}

.modal-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    margin: 4px; /* Add margin to ensure hover border is fully visible */
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.modal-item:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.modal-item input[type="checkbox"],
.modal-item input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #667eea;
}

.modal-item-label {
    flex: 1;
    font-size: 15px;
    color: #333;
    cursor: pointer;
}

.modal-item-count {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.day-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.day-item {
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-weight: 600;
}

.day-item:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Report Content Styling - Outer container (no scrolling) */
.report-content {
    /* Container for report - no scrolling here, inner wrapper handles it */
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Network Graph Container */
#networkGraph {
    width: 100%;
    height: 600px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
}

.modal-actions {
    display: flex;
    gap: 10px;
    padding: 12px 0 0 0;
    border-top: 2px solid #e0e0e0;
    margin: 8px -25px 0 -25px;
}

/* ULTRA Compact modal actions for keyboard shortcuts */
.keyboard-shortcuts-modal-content .modal-actions {
    padding: 0 !important; /* MATCH shortcuts-grid 0px! */
    margin: 0;
    border-top: none;
}

.keyboard-shortcuts-modal-content .modal-header {
    padding: 8px 8px 4px 8px; /* Proper spacing for readability */
    margin: 0;
}

.keyboard-shortcuts-modal-content .modal-title {
    font-size: 16px;
    margin: 0;
    padding: 0;
    user-select: none; /* Disable text selection on title */
}

.keyboard-shortcuts-modal-content .modal-close {
    margin: 0;
    padding: 0;
    width: 30px;
    height: 30px;
}

.keyboard-shortcuts-modal-content .modal-btn {
    padding: 7px;
    font-size: 13px;
    width: 100%;
    margin: 0;
    border-radius: 0 !important; /* Remove rounding from Close button */
}

/* Remove padding from modal-list for keyboard shortcuts */
.keyboard-shortcuts-modal-content .modal-list {
    padding: 0 !important;
    margin: 0 !important;
}

.modal-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn-apply {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-btn-apply:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.modal-btn-apply:disabled {
    background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Units and Systems modals: full-width button without border-radius */
#unitsModal .modal-btn-apply,
#systemsModal .modal-btn-apply {
    border-radius: 0;
}

.modal-btn-clear {
    background: #f0f0f0;
    color: #333;
}

.modal-btn-clear:hover {
    background: #e0e0e0;
}

/* Keyboard Shortcuts Modal Styles - ULTRA Compact! */
.keyboard-shortcuts-modal-content {
    max-width: 300px !important; /* Half of previous 600px */
    width: calc(100% - 40px) !important; /* 20px margin on EACH side - SAME for ALL widths */
    max-height: 400px !important; /* Max height cap */
    height: auto !important; /* Let content determine height */
    margin: 20px !important; /* Consistent margin all around */
    padding: 0 !important;
    border-radius: 15px !important; /* Rounded corners at ALL widths */
}

/* Force ZERO padding on keyboard shortcuts modal content */
#keyboardShortcutsModal .modal-content {
    padding: 0 !important;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr; /* ONE column at ALL widths */
    gap: 4px;
    padding: 4px !important; /* Minimal padding */
    margin: 0;
    user-select: none; /* Disable text selection */
}

.shortcut-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    user-select: none; /* Disable text selection */
    /* No hover effect - rows are not clickable */
}

.shortcut-key {
    min-width: 45px; /* 50px → 45px */
    padding: 3px 8px; /* 4px/10px → 3px/8px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 12px; /* 13px → 12px */
    text-align: center;
    border-radius: 3px; /* 4px → 3px */
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.shortcut-description {
    flex: 1;
    font-size: 12px; /* 13px → 12px */
    color: #333;
}

/* Dark mode styles for keyboard shortcuts */
body.dark-mode .shortcut-row {
    background: #2a2a3e;
    /* No hover effect - rows are not clickable */
}

body.dark-mode .shortcut-description {
    color: #e0e0e0;
}

/* Responsive: Single column on smaller screens */
/* Removed 768px media query - using ONE column at ALL widths */

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Marker Cluster Styles - WITH !important to override defaults */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(102, 126, 234, 0.6) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: rgba(102, 126, 234, 0.8) !important;
    color: white !important;
    font-weight: bold !important;
}

/* Animation */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

.pulse-marker {
    animation: pulse 2s infinite;
}

/* ====== ENTITY MARKER ICONS ====== */

/* Base entity icon styling */
.entity-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    font-weight: bold;
}

/* Side-based backgrounds for entity markers */
.ent-ua {
    background: linear-gradient(135deg, #0057b7 0%, #ffd700 100%);
}

.ent-ru {
    background: linear-gradient(135deg, #ffffff 0%, #d52b1e 50%, #0039a6 100%);
}

.ent-unk {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

/* Flag marker styling (small rectangular flags) */
.flag-marker {
    width: 20px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.flag-ua {
    background: linear-gradient(180deg, #0057b7 0%, #0057b7 50%, #ffd700 50%, #ffd700 100%);
}

.flag-ru {
    background: linear-gradient(180deg, #ffffff 0%, #ffffff 33%, #0039a6 33%, #0039a6 66%, #d52b1e 66%, #d52b1e 100%);
}

/* System icon specific styling */
.system-icon {
    width: 26px;
    height: 26px;
}

/* Unit icon specific styling */
.unit-icon {
    width: 24px;
    height: 24px;
}

/* Filter tag buttons styling */
.filter-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.filter-tag {
    background: #f0f0f0;
    color: #333;
    border: 2px solid transparent;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-tag:hover {
    background: #e0e0e0;
}

.filter-tag.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.filter-tag .count {
    background: rgba(0,0,0,0.15);
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    font-size: 11px;
}

.filter-controls {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    margin: 0;
    border-bottom: 2px solid #e0e0e0;
}

.filter-controls button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-controls .select-all {
    background: #667eea;
    color: white;
}

.filter-controls .clear-all {
    background: #f0f0f0;
    color: #333;
}

.filter-controls .select-all:hover {
    background: #5568d3;
}

.filter-controls .clear-all:hover {
    background: #e0e0e0;
}

.filter-search-box {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 8px;
}

.filter-search-box:focus {
    outline: none;
    border-color: #667eea;
}
/* Performance optimizations for map panning (especially Brave browser) */
/* Disable expensive effects during map movement */
body.map-moving .header {
    backdrop-filter: none;
    transition: none;
}

body.map-moving .stat-card {
    box-shadow: none;
    transition: none;
}

body.map-moving .podcast-player-inline {
    box-shadow: none;
}

body.map-moving .leaflet-marker-icon {
    will-change: transform;
}

body.map-moving .entity-icon,
body.map-moving .flag-marker {
    filter: none;
}

/* Enable hardware acceleration for frequently moved elements */
.leaflet-map-pane {
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.leaflet-marker-icon,
.leaflet-marker-shadow {
    will-change: transform;
}

/* Optimize marker rendering */
.entity-marker,
.flag-marker-icon {
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Map Legend Panel */
.legend-panel {
    position: fixed;
    /* bottom dynamically set by JS based on dock height */
    left: 340px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    max-width: 350px;
    z-index: 999;
    display: none;
    transition: left 0.3s ease, bottom 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.main-container.feed-closed ~ .legend-panel {
    left: 20px;
}

.legend-panel.show {
    display: block;
}

.legend-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legend-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.legend-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}

.legend-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.legend-content {
    padding: 10px 10px 5px 10px; /* Reduced bottom padding to minimize empty space */
    max-height: 400px;
    overflow-y: auto;
    user-select: none;
    cursor: default;
}

.legend-section {
    margin-bottom: 10px; /* Reduced from 12px for tighter spacing */
}

.legend-section:last-child {
    margin-bottom: 0;
}

.legend-section h4 {
    font-size: 11px;
    color: #667eea;
    margin: 0 0 6px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px; /* Reduced from 5px for tighter vertical spacing */
    font-size: 12px;
    color: #333;
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.legend-flag {
    width: 20px;
    height: 14px;
    border: 1px solid #ccc;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-note {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin-top: 5px;
    padding-left: 34px;
}

/* Search Tabs */
.search-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px; /* Reduced from 20px to 10px */
    border-bottom: 2px solid #e0e0e0;
    align-items: center;
}

.search-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.search-tab:hover {
    color: #667eea;
}

.search-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.search-advanced-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
    margin-bottom: -2px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.search-advanced-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.search-advanced-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

body.dark-mode .search-advanced-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.5);
}

body.dark-mode .search-advanced-btn:hover {
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.6);
}

.search-section {
    animation: fadeIn 0.3s ease-in;
}

/* Search Results */
.search-results {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateX(5px);
}

.search-result-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.search-result-item.selected .search-result-name,
.search-result-item.selected .search-result-details {
    color: white;
}

.search-result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.search-result-details {
    font-size: 12px;
    color: #666;
}

/* ========================================
   DAILY REPORT BEAUTIFUL STYLING
   ======================================== */

/* Report Container */
.report-container {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.report-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 25px;
    color: white;
    flex-shrink: 0;
}

.report-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.report-content-wrapper {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
    line-height: 1.6;
    color: #333;
    min-height: 0;
}

/* Report Headings */
.report-h1 {
    font-size: 28px;
    color: #667eea;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    font-weight: 700;
}

.report-h2 {
    font-size: 22px;
    color: #667eea;
    margin: 25px 0 15px 0;
    font-weight: 600;
}

.report-h3 {
    font-size: 18px;
    color: #764ba2;
    margin: 20px 0 12px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

.report-h4 {
    font-size: 16px;
    color: #333;
    margin: 15px 0 10px 0;
    font-weight: 600;
}

/* Report Paragraphs */
.report-paragraph {
    margin: 0 0 8px 0;
    line-height: 1.6;
    color: #444;
    max-width: 100%;
}

.report-paragraph:last-child {
    margin-bottom: 0;
}

/* Report Tables */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.report-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.report-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.report-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #444;
    vertical-align: top;
}

.report-table tbody tr:last-child td {
    border-bottom: none;
}

.report-table tbody tr:hover {
    background: #f8f9fa;
}

/* Report Lists */
.report-list {
    margin: 10px 0;
    padding-left: 25px;
    list-style: none;
}

.report-list-item {
    margin: 3px 0;
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
    color: #444;
}

.report-list-item:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* Report Dividers */
.report-divider {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #667eea, transparent);
    margin: 30px 0;
}

/* Strong and Emphasis */
.report-content-wrapper strong {
    color: #667eea;
    font-weight: 600;
}

.report-content-wrapper em {
    color: #764ba2;
    font-style: italic;
}

/* Scrollbar styling for report content */
.report-content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.report-content-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.report-content-wrapper::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.report-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Reports Modal - Wider */
.reports-modal-wide {
    max-width: 1400px !important;
    max-height: 95vh !important;
    height: 95vh;
}

/* Reports Container Layout */
.reports-container-flex {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.report-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.report-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.report-calendar-container {
    background: white;
    border-radius: 4px;
    padding: 6px;
    margin-bottom: 12px;
}

.report-calendar-header {
    text-align: center;
    margin-bottom: 4px;
}

.report-calendar-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 11px;
    font-weight: 600;
}

.report-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day-label {
    text-align: center;
    font-weight: 600;
    color: #667eea;
    font-size: 7px;
    padding: 2px 0;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: default;
    background: #f8f9fa;
    user-select: none;
    color: #999;
    min-height: 20px;
}

.report-actions-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-day.empty {
    background: transparent;
}

.calendar-day.has-report {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
    pointer-events: all;
}

.calendar-day.has-report:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.calendar-day.selected {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.6);
    transform: scale(1.15);
}

.calendar-month-header {
    grid-column: 1 / -1;
    text-align: center;
    font-weight: 600;
    color: #667eea;
    font-size: 10px;
    padding: 8px 0 4px 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 4px;
}

.calendar-month-header:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.no-reports {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 12px;
}

.report-nav-arrows {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.report-nav-btn {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-nav-btn:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.report-nav-btn:disabled {
    cursor: not-allowed;
    background: #ccc;
}

body.dark-mode .report-nav-arrows {
    border-top-color: #3a3a4e;
}

body.dark-mode .report-nav-btn:disabled {
    background: #444;
}

.report-actions-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* Report Buttons */
.report-btn {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.report-btn:hover:not(:disabled) {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.report-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(60%);
}

.report-btn-map {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.report-btn-map:hover {
    background: linear-gradient(135deg, #5568d3 0%, #65408b 100%);
}

.report-btn-share {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.report-btn-share:hover {
    background: linear-gradient(135deg, #32d86a 0%, #27e8c6 100%);
}

.report-btn-analytics {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
    color: white;
}

.report-btn-analytics:hover {
    background: linear-gradient(135deg, #feb236 0%, #f78fb3 100%);
}

.report-btn-video {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.report-btn-video:hover {
    background: linear-gradient(135deg, #df7fe9 0%, #e4465a 100%);
}

/* Report Disclaimer */
.report-disclaimer {
    font-size: 11px;
    color: #999;
    font-style: italic;
    padding: 10px 0;
    text-align: left;
}

/* Report Placeholder */
.report-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #999;
}

.report-placeholder-icon {
    font-size: 64px;
    opacity: 0.3;
}

.report-placeholder-text {
    font-size: 16px;
    color: #999;
    text-align: center;
}

/* ========================================
   ABOUT MODAL TEXT STYLING
   ======================================== */

.about-disclaimer-text {
    font-size: 18px;
    color: #333;
    margin-bottom: calc(var(--modal-section-margin-bottom) * 2);
    line-height: 1.6;
}

.about-description-text {
    font-size: 14px;
    color: #666;
    margin-bottom: var(--modal-section-margin-bottom);
    line-height: 1.8;
}

.about-description-text:last-of-type {
    margin-bottom: calc(var(--modal-section-margin-bottom) * 2);
}

/* ========================================
   CHANGELOG STYLING
   ======================================== */

.changelog-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    text-align: left;
}

.changelog-entry {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.changelog-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.changelog-date-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.changelog-date-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.changelog-date {
    font-size: 11px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
}

.changelog-messages {
    padding-left: 15px;
}

.changelog-message {
    font-size: 12px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 4px;
    position: relative;
    padding-left: 12px;
}

.changelog-message:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.changelog-message:last-child {
    margin-bottom: 0;
}

/* Scrollbar for changelog */

/* ==========================================
   LIGHT MODE - FEED PANEL STYLES
   ========================================== */

/* Light mode feed panel */
body:not(.dark-mode) .feed-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-right: 2px solid #e0e0e0;
}

body:not(.dark-mode) .feed-content {
    background: #f8f9fa;
}

body:not(.dark-mode) .feed-header {
    background: transparent;
    border-bottom: none;
}

body:not(.dark-mode) .feed-search-container {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

body:not(.dark-mode) .feed-search-input {
    background: #ffffff;
    color: #333;
    border: 1px solid #d0d0d0;
    padding: 8px 30px 8px 8px;
}

body:not(.dark-mode) .feed-search-input::placeholder {
    color: #999;
}

body:not(.dark-mode) .feed-search-input:focus {
    border-color: #667eea;
}

body:not(.dark-mode) .feed-search-map-btn {
    background: #ffffff;
    border: 1px solid #d0d0d0;
    color: #666;
}

body:not(.dark-mode) .feed-search-map-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

body:not(.dark-mode) .feed-search-map-btn.active {
    background: #43e97b;
    border-color: #43e97b;
    color: #fff;
}

body:not(.dark-mode) .feed-search-map-btn:disabled {
    background: #e0e0e0;
    border-color: #d0d0d0;
    color: #999;
    cursor: not-allowed;
    opacity: 0.5;
}

body:not(.dark-mode) .clear-feed-search-btn {
    background: #ffffff;
    border: 1px solid #d0d0d0;
    color: #666;
}

body:not(.dark-mode) .clear-feed-search-btn:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

body:not(.dark-mode) .feed-empty {
    color: #999;
}

body:not(.dark-mode) .feed-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid transparent;
}

body:not(.dark-mode) .feed-item:hover {
    background: #f0f4ff;
    border-left-color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body:not(.dark-mode) .feed-item.active {
    border-left-color: #667eea;
    background: #e8f0ff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

body:not(.dark-mode) .feed-item.keyboard-selected {
    border-left-color: #ffd700;
    background: #fffaed;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

body:not(.dark-mode) .feed-item-date {
    color: #43e97b;
}

body:not(.dark-mode) .feed-item-title {
    color: #1a1d2e;
}

body:not(.dark-mode) .feed-item-description {
    color: #555;
}

body:not(.dark-mode) .feed-item-location {
    color: #e74c3c;
}

body:not(.dark-mode) .feed-expand-btn {
    color: #667eea;
}

body:not(.dark-mode) .feed-expand-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #764ba2;
}

body:not(.dark-mode) .feed-match-indicator {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
}

body:not(.dark-mode) .feed-item-buttons {
    border-top: 1px solid #e0e0e0;
}

body:not(.dark-mode) .feed-btn-map {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body:not(.dark-mode) .feed-btn-telegram {
    background: #ffffff;
    color: #43e97b;
    border: 1px solid #43e97b;
}

body:not(.dark-mode) .feed-btn-telegram:hover {
    background: #43e97b;
    color: #ffffff;
}

/* ========================================
   DARK MODE
   ======================================== */

body.dark-mode {
    background: #1a1a2e;
    color: #e0e0e0;
}

body.dark-mode .header {
    background: transparent; /* Match light mode - no background rectangle */
}

body.dark-mode .header h1 {
    color: #e0e0e0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(102, 126, 234, 0.6);
}

body.dark-mode .vasama-link {
    color: #e0e0e0;
    border-bottom-color: rgba(224, 224, 224, 0.3);
}

body.dark-mode .vasama-link:hover {
    color: #667eea;
    border-bottom-color: #667eea;
}

body.dark-mode .stats {
    background: rgba(30, 30, 46, 0.7);
}

body.dark-mode .stat-card {
    background: linear-gradient(135deg, #2a2a3e 0%, #1e1e2e 100%);
    color: #e0e0e0;
    border: 1px solid #3a3a4e;
}

body.dark-mode .stat-card .label {
    color: #a0a0b0;
}

body.dark-mode .stat-card .value {
    color: #e0e0e0;
}

body.dark-mode .stat-card:hover {
    background: linear-gradient(135deg, #3a3a4e 0%, #2a2a3e 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

body.dark-mode .ctrl-btn {
    background: #2a2a3e;
    color: #e0e0e0;
    border: 2px solid #3a3a4e; /* Changed from 1px to match light mode */
}

body.dark-mode .ctrl-btn:hover {
    background: #3a3a4e;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

body.dark-mode .ctrl-btn.active,
body.dark-mode .ctrl-btn.feed-active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.dark-mode .ctrl-btn-danger {
    background: #e74c3c !important;
    border-color: #e74c3c !important;
}

body.dark-mode .ctrl-btn-danger:hover {
    background: #c0392b !important;
    border-color: #c0392b !important;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6) !important;
}

body.dark-mode .bottom-filter-panel {
    background: #1e1e2e;
    border-top: 2px solid #3a3a4e;
}

body.dark-mode .filter-group label {
    color: #a0a0b0;
}

body.dark-mode .filter-group input[type="text"],
body.dark-mode .filter-group input[type="date"] {
    background: #2a2a3e;
    color: #e0e0e0;
    border: 2px solid #3a3a4e;
    font-family: inherit;
}

/* Dark mode for ALL select/dropdown elements */
body.dark-mode select,
body.dark-mode .filter-group select,
body.dark-mode #sentimentTypeSelect,
body.dark-mode #wcFilterSelect {
    background: #2a2a3e;
    color: #e0e0e0;
    border: 2px solid #3a3a4e;
    font-family: inherit;
}

body.dark-mode select option {
    background: #2a2a3e;
    color: #e0e0e0;
}

/* Slide-up animation for reset confirmation */
@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(30px);
        opacity: 0;
    }
}

/* Dark mode for reset confirmation */
/* Removed - reset confirmation colors now handled in main.js for better dynamic control */

body.dark-mode .modal-content {
    background: #1e1e2e;
    color: #e0e0e0;
}

body.dark-mode .modal-header {
    border-bottom: 2px solid #3a3a4e;
}

body.dark-mode .modal-title {
    color: #e0e0e0;
}

body.dark-mode .modal-list {
    background: #2a2a3e;
}

body.dark-mode .modal-item {
    background: #2a2a3e;
    border-bottom: 1px solid #3a3a4e;
}

body.dark-mode .modal-item:hover {
    background: #3a3a4e;
}

body.dark-mode .modal-item-label {
    color: #e0e0e0;
}

body.dark-mode .modal-item-label small {
    color: #a0a0b0;
}

body.dark-mode .feed-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-right: 2px solid #3a3a4e;
}

body.dark-mode .feed-content {
    background: #1e1e2e;
}

body.dark-mode .feed-header {
    background: transparent;
    border-bottom: none;
}

body.dark-mode .feed-item {
    background: #2a2a3e;
    border-bottom: 1px solid #3a3a4e;
}

body.dark-mode .feed-item:hover {
    background: #3a3a4e;
}

body.dark-mode .feed-item-title {
    color: #e0e0e0;
}

body.dark-mode .feed-item-description {
    color: #b0b0c0;
}

body.dark-mode .feed-item-date,
body.dark-mode .feed-item-location {
    color: #a0a0b0;
}

body.dark-mode .feed-match-indicator {
    color: #9ba9ff;
    background: rgba(102, 126, 234, 0.2);
    border-left-color: #667eea;
}

body.dark-mode .search-checkbox-label {
    color: #b0b0c0;
}

body.dark-mode .search-checkbox-label:hover {
    color: #667eea;
}

body.dark-mode .side-panel {
    background: #1e1e2e;
    border-left: 2px solid #3a3a4e;
}

body.dark-mode .event-detail {
    background: #2a2a3e;
    color: #e0e0e0;
}

body.dark-mode .event-title {
    color: #e0e0e0;
}

body.dark-mode .event-description {
    color: #b0b0c0;
    background: #2a2a3e;
    border-left-color: #667eea;
}

body.dark-mode .entity-link {
    color: #8b9ff5;
    background: rgba(139, 159, 245, 0.15);
}

body.dark-mode .entity-link:hover {
    background: rgba(139, 159, 245, 0.25);
    color: #a5b8ff;
}

body.dark-mode .event-btn.primary {
    background: #667eea;
    color: white;
}

body.dark-mode .event-btn.primary:hover {
    background: #5568d3;
}

body.dark-mode .event-btn.secondary {
    background: #3a3a4e;
    color: #e0e0e0;
}

body.dark-mode .event-btn.secondary:hover {
    background: #4a4a5e;
}

body.dark-mode .event-btn.favorite {
    background: #8b7ba8;
    color: white;
}

body.dark-mode .event-btn.favorite:hover {
    background: #9d8cba;
}

body.dark-mode .event-btn.favorite.active {
    background: #b8956a;
    color: #1a1a2e;
}

body.dark-mode .analysis-search-input {
    background: #2a2a3e;
    border-color: #3a3a4e;
    color: #e0e0e0;
}

body.dark-mode .analysis-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

body.dark-mode .analysis-search-map-btn {
    background: #2a2a3e;
    border-color: #3a3a4e;
}

body.dark-mode .analysis-search-map-btn:hover {
    background: #3a3a4e;
    border-color: #667eea;
}

body.dark-mode .analysis-search-map-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.6);
}

body.dark-mode .analysis-search-clear {
    color: #999;
}

body.dark-mode .analysis-search-clear:hover {
    color: #667eea;
}

body.dark-mode .analysis-open-all-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body.dark-mode .analysis-open-all-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.6);
}

body.dark-mode .search-highlight {
    background: #b8956a;
    color: #1a1a2e;
}

/* Report buttons dark mode */
body.dark-mode .report-btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .report-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .report-btn-map {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.dark-mode .report-btn-map:hover {
    background: linear-gradient(135deg, #5568d3 0%, #65408b 100%);
}

body.dark-mode .report-btn-share {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

body.dark-mode .report-btn-share:hover {
    background: linear-gradient(135deg, #32d86a 0%, #27e8c6 100%);
}

body.dark-mode .report-btn-analytics {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
}

body.dark-mode .report-btn-analytics:hover {
    background: linear-gradient(135deg, #feb236 0%, #f78fb3 100%);
}

body.dark-mode .report-btn-video {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body.dark-mode .report-btn-video:hover {
    background: linear-gradient(135deg, #df7fe9 0%, #e4465a 100%);
}

body.dark-mode .analysis-section {
    background: #2a2a3e;
    border: 1px solid #3a3a4e;
}

body.dark-mode .analysis-toggle {
    background: #3a3a4e;
    color: #e0e0e0;
}

body.dark-mode .analysis-content {
    background: #2a2a3e;
    color: #b0b0c0;
}

body.dark-mode .legend-panel {
    background: #1e1e2e;
    border: 2px solid #3a3a4e;
}

body.dark-mode .legend-header {
    border-bottom: 2px solid #3a3a4e;
}

body.dark-mode .legend-item span {
    color: #e0e0e0;
}

body.dark-mode .report-selector {
    background: linear-gradient(135deg, #2a2a3e 0%, #1e1e2e 100%);
    border: 2px solid #3a3a4e;
}

body.dark-mode .report-calendar-container {
    background: #1e1e2e;
    max-width: 180px;
}

body.dark-mode .report-calendar-header h3 {
    color: #8b96ea;
}

body.dark-mode .calendar-day-label {
    color: #8b96ea;
}

body.dark-mode .calendar-day {
    background: #2a2a3e;
    color: #666;
}

body.dark-mode .calendar-day.has-report {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body.dark-mode .calendar-day.selected {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

body.dark-mode .calendar-month-header {
    color: #8b96ea;
    border-top-color: #3a3a4e;
}

body.dark-mode .no-reports {
    color: #666;
}

body.dark-mode .report-container {
    background: #2a2a3e;
}

body.dark-mode .report-content-wrapper {
    background: #2a2a3e;
    color: #e0e0e0;
}

body.dark-mode .report-h1 {
    color: #667eea;
    border-bottom-color: #667eea;
}

body.dark-mode .report-h2 {
    color: #667eea;
}

body.dark-mode .report-h3 {
    color: #f093fb;
}

body.dark-mode .report-h4 {
    color: #e0e0e0;
}

body.dark-mode .report-paragraph {
    color: #d0d0e0;
}

body.dark-mode .report-list-item {
    color: #d0d0e0;
}

body.dark-mode .report-list-item:before {
    color: #667eea;
}

body.dark-mode .report-table {
    background: #1e1e2e;
    border: 1px solid #3a3a4e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .report-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.dark-mode .report-table th {
    color: white;
}

body.dark-mode .report-table td {
    border-bottom: 1px solid #3a3a4e;
    color: #d0d0e0;
}

body.dark-mode .report-table tbody tr:hover {
    background: #2a2a3e;
}

body.dark-mode .report-content-wrapper strong {
    color: #667eea;
}

body.dark-mode .report-content-wrapper em {
    color: #f093fb;
}

body.dark-mode .report-selector {
    background: #2a2a3e;
    border-color: #3a3a4e;
}

body.dark-mode .report-selector label {
    color: #667eea;
}

body.dark-mode .report-selector select {
    background: #1e1e2e;
    border-color: #667eea;
    color: #e0e0e0;
}

body.dark-mode .report-content-wrapper::-webkit-scrollbar-track {
    background: #1e1e2e;
}

body.dark-mode .report-content-wrapper::-webkit-scrollbar-thumb {
    background: #667eea;
}

body.dark-mode .report-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

body.dark-mode .report-placeholder-text {
    color: #666;
}

body.dark-mode .about-disclaimer-text {
    color: #e0e0f0;
}

body.dark-mode .about-description-text {
    color: #b0b0c0;
}

body.dark-mode .changelog-container {
    background: #2a2a3e;
}

body.dark-mode .changelog-entry {
    border-bottom: 1px solid #3a3a4e;
}

body.dark-mode .changelog-date-group {
    border-bottom: 1px solid #3a3a4e;
}

body.dark-mode .changelog-message {
    color: #b0b0c0;
}

body.dark-mode .feed-btn-map {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.dark-mode .feed-btn-telegram {
    background: #2a2a3e;
    border: 1px solid #43e97b;
    color: #43e97b;
}

body.dark-mode .feed-btn-telegram:hover {
    background: #43e97b;
    color: #1a1a2e;
}

body.dark-mode .podcast-player-inline {
    background: linear-gradient(135deg, #2a4a3e 0%, #2a4a4e 100%);
}

body.dark-mode .podcast-label-inline {
    color: #43e97b;
}

/* ===========================================
   RESPONSIVE PODCAST PLAYER
   Simplification on narrow screens
   =========================================== */

/* Hide "Timeline Podcast" text when dark mode button starts touching podcast box */
/* Only hide on truly narrow screens - keep full text when there's space */
@media (max-width: 1100px) {
    .timeline-word,
    .podcast-word {
        display: none;
    }
    
    .podcast-player-inline {
        gap: 6px;
        padding: 6px 10px;
    }
    
    .podcast-player-inline audio {
        max-width: 150px;
        min-width: 100px;
    }
}

/* ===========================================
   HYPERLINK STYLES
   Interactive links for sources, entities, and locations
   =========================================== */

/* Source Links (Telegram channels) */
.source-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    padding: 2px 0;
}

.source-link:hover {
    color: #764ba2;
    border-bottom: 2px solid #764ba2;
}

.source-link::before {
    content: "📱 ";
    font-size: 0.9em;
}

/* Entity Links (Systems and Units) */
.entity-link {
    color: #f093fb;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px dashed transparent;
    transition: all 0.3s;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
}

.entity-link:hover {
    background: rgba(240, 147, 251, 0.15);
    border-bottom: 2px dashed #f5576c;
}

.entity-system::before {
    content: "🔧 ";
    font-size: 0.9em;
}

.entity-unit::before {
    content: "⚔️ ";
    font-size: 0.9em;
}

/* Location Links */
.location-link {
    color: #43e97b;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px dotted transparent;
    transition: all 0.3s;
    padding: 0 2px;
    border-radius: 3px;
    cursor: pointer;
    vertical-align: baseline;
}

.location-link:hover {
    background: rgba(67, 233, 123, 0.15);
    border-bottom: 2px dotted #38f9d7;
}

.event-location .location-link::before {
    content: "";
}

/* Dark Mode Hyperlink Styles */
body.dark-mode .source-link {
    color: #9aa5ff;
}

body.dark-mode .source-link:hover {
    color: #b4a0ff;
    border-bottom-color: #b4a0ff;
}

body.dark-mode .entity-link {
    color: #ff9fff;
}

body.dark-mode .entity-link:hover {
    background: rgba(255, 159, 255, 0.2);
    border-bottom-color: #ff85a1;
}

body.dark-mode .location-link {
    color: #5fffa7;
}

body.dark-mode .location-link:hover {
    background: rgba(95, 255, 167, 0.2);
    border-bottom-color: #6bffe5;
}

body.dark-mode .event-source a {
    color: #9aa5ff;
}

/* Link hover animation */
.source-link, .entity-link, .location-link {
    position: relative;
}

.source-link:active, .entity-link:active, .location-link:active {
    transform: scale(0.98);
}

/* ===========================================
   ANALYTICS DASHBOARD STYLES
   =========================================== */

/* Active Filters Display */
.active-filters-container {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0 20px 20px 20px;
}

.active-filters-header {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    background: #667eea;
    color: white;
    padding: 6px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    gap: 6px;
}

.filter-chip-label {
    display: inline-block;
}

.filter-chip-remove {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s;
}

.filter-chip-remove:hover {
    background: rgba(255, 255, 255, 0.5);
}

.analytics-container {
    padding: var(--modal-section-padding);
    max-height: 70vh;
    overflow-y: auto;
    margin-bottom: 0;
}

.analytics-tabs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.analytics-tab {
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    border-radius: 4px 4px 0 0;
}

.analytics-tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.analytics-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

body.dark-mode .analytics-tab {
    color: #b0b0b0;
}

body.dark-mode .analytics-tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

body.dark-mode .analytics-tab.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.15);
}

.analytics-chart-container {
    background: white;
    padding: var(--modal-section-padding);
    border-radius: var(--border-radius-large);
    margin-bottom: var(--modal-section-margin-bottom);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.analytics-chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: var(--modal-section-margin-bottom);
    padding-bottom: calc(var(--modal-header-padding-bottom) - 2px);
    border-bottom: 2px solid #e0e0e0;
}

.analytics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Dark mode analytics styles */
body.dark-mode .analytics-container {
    background: #1a1a2e;
}

body.dark-mode .analytics-chart-container {
    background: #2a2a3e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .analytics-chart-title {
    color: #e0e0e0;
    border-bottom-color: #3a3a4e;
}

body.dark-mode .active-filters-container {
    background: #2a2a3e;
    border-color: #3a3a4e;
}

body.dark-mode .active-filters-header {
    color: #b0b0c0;
}

/* ===========================
   MOBILE MENU STYLES
   =========================== */

/* Mobile menu toggle button (hidden on desktop) */
.mobile-menu-toggle {
    display: none;
}

/* Mobile slide-out menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px; /* Hidden off-screen initially */
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0; /* Slide in from right */
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-menu-header h3 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.mobile-menu-content {
    padding: 10px;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-4px);
}

.mobile-menu-item:active {
    transform: translateX(-4px) scale(0.98);
}

/* Mobile menu overlay (darkens background) */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Desktop-only controls (hidden on mobile) */
.desktop-only {
    display: inline-flex;
}

/* Dark mode support for mobile menu */
body.dark-mode .mobile-menu {
    background: linear-gradient(135deg, #1a1a2e 0%, #2a2a3e 100%);
}

body.dark-mode .mobile-menu-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .mobile-menu-item {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Responsive adjustments */
@media (max-width: 1000px) {
    .analytics-row {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar styling for analytics container */
.analytics-container::-webkit-scrollbar {
    width: 8px;
}

.analytics-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.analytics-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.analytics-container::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

body.dark-mode .analytics-container::-webkit-scrollbar-track {
    background: #2a2a3e;
}

body.dark-mode .analytics-container::-webkit-scrollbar-thumb {
    background: #667eea;
}

/* ===========================================
   EXPORT & SHARE MODAL STYLES
   =========================================== */

.export-container {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    margin-bottom: 0;
}

.export-section {
    background: white;
    padding: var(--modal-section-padding);
    border-radius: var(--border-radius-large);
    margin-bottom: var(--modal-section-margin-bottom);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.export-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.export-section-info {
    flex: 1;
    min-width: 0;
}

.export-section-header-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.export-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-top: 0;
    margin-bottom: 8px;
}

.export-section-header .export-section-title,
.export-section-header-inline .export-section-title {
    margin-bottom: 0;
}

.export-section-desc {
    color: #666;
    margin-bottom: var(--modal-section-desc-margin-bottom);
    line-height: var(--modal-section-desc-line-height);
}

.export-section-header .export-section-desc {
    margin-bottom: 0;
}

.export-section-desc-inline {
    color: #666;
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

.export-action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
    white-space: nowrap;
}

.export-action-btn:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.export-action-btn:active {
    /* No transform needed */
}

.export-action-btn-secondary {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 2px 8px rgba(67, 233, 123, 0.3);
}

.export-action-btn-secondary:hover {
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.4);
}

.export-url-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    background: #f8f9fa;
    margin-bottom: 15px;
}

.export-button-row {
    display: flex;
    gap: 10px;
}

/* Filter Presets List */
.presets-list {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.preset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

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

.preset-item:hover {
    background: #f8f9fa;
}

.preset-info {
    flex: 1;
}

.preset-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.preset-meta {
    font-size: 12px;
    color: #999;
}

.preset-actions {
    display: flex;
    gap: 8px;
}

.preset-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn-apply {
    background: #667eea;
    color: white;
}

.preset-btn-apply:hover {
    background: #764ba2;
}

.preset-btn-delete {
    background: #f44336;
    color: white;
    padding: 8px 12px;
}

.preset-btn-delete:hover {
    background: #d32f2f;
}

/* My Views Styles */
.my-views-save-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: var(--modal-section-padding);
    border-radius: var(--border-radius-large);
    margin-bottom: var(--modal-section-margin-bottom);
    border: var(--border-standard-width) solid #e0e0e0;
}

.my-views-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: var(--modal-section-title-margin-bottom);
    margin-top: 0;
}

.my-views-section-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: var(--modal-section-desc-margin-bottom);
}

.my-views-save-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.my-views-input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.my-views-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.my-views-textarea {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s;
}

.my-views-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.my-views-save-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.my-views-save-btn:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.my-views-save-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.my-views-list-section {
    margin-top: 25px;
}

.my-views-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.my-views-empty {
    text-align: center;
    padding: 60px 20px;
}

.my-views-empty-icon {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 15px;
}

.my-views-empty-text {
    font-size: 16px;
    color: #999;
    margin-bottom: 8px;
}

.my-views-empty-hint {
    font-size: 13px;
    color: #bbb;
}

.my-view-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 18px;
    transition: all 0.3s;
}

.my-view-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.my-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.my-view-info {
    flex: 1;
    min-width: 0;
}

.my-view-title {
    font-size: 17px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.my-view-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #999;
}

.my-view-date,
.my-view-filters {
    display: flex;
    align-items: center;
    gap: 4px;
}

.my-view-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-top: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.my-view-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.my-view-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.my-view-btn-load {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.my-view-btn-load:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.my-view-btn-delete {
    background: #f44336;
    color: white;
}

.my-view-btn-delete:hover {
    background: #d32f2f;
}

/* Dark Mode Export Styles */
body.dark-mode .export-container {
    background: #1a1a2e;
}

body.dark-mode .export-section {
    background: #2a2a3e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .export-section-title {
    color: #e0e0e0;
}

body.dark-mode .export-section-desc,
body.dark-mode .export-section-desc-inline {
    color: #b0b0c0;
}

body.dark-mode .export-url-input {
    background: #1a1a2e;
    border-color: #667eea;
    color: #e0e0e0;
}

body.dark-mode .presets-list {
    border-color: #3a3a4e;
}

body.dark-mode .preset-item {
    border-bottom-color: #3a3a4e;
}

body.dark-mode .preset-item:hover {
    background: #1a1a2e;
}

body.dark-mode .preset-name {
    color: #e0e0e0;
}

body.dark-mode .preset-meta {
    color: #888;
}

/* Dark Mode My Views Styles */
body.dark-mode .my-views-save-section {
    background: linear-gradient(135deg, rgba(42, 42, 62, 0.6) 0%, rgba(26, 26, 46, 0.6) 100%);
    border-color: #3a3a4e;
}

body.dark-mode .my-views-list-section {
    border-color: #3a3a4e;
}

body.dark-mode .my-views-section-title {
    color: #e0e0e0;
}

body.dark-mode .my-views-section-desc {
    color: #b0b0c0;
}

body.dark-mode .my-views-input,
body.dark-mode .my-views-textarea {
    background: #1a1a2e;
    border-color: #667eea;
    color: #e0e0e0;
}

body.dark-mode .my-views-input::placeholder,
body.dark-mode .my-views-textarea::placeholder {
    color: #666;
}

body.dark-mode .my-views-input:focus,
body.dark-mode .my-views-textarea:focus {
    background: #2a2a3e;
    border-color: #764ba2;
}

body.dark-mode .my-view-card {
    background: #2a2a3e;
    border-color: #3a3a4e;
}

body.dark-mode .my-view-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

body.dark-mode .my-view-title {
    color: #e0e0e0;
}

body.dark-mode .my-view-meta {
    color: #888;
}

body.dark-mode .my-view-description {
    background: rgba(26, 26, 46, 0.5);
    border-left-color: #667eea;
    color: #b0b0c0;
}

body.dark-mode .my-views-empty-text {
    color: #888;
}

body.dark-mode .my-views-empty-hint {
    color: #666;
}

body.dark-mode .my-views-save-btn:disabled {
    background: #3a3a4e;
    color: #666;
    opacity: 0.5;
}

body.dark-mode .my-view-btn {
    background: #2a2a3e;
    color: #e0e0e0;
    border-color: #3a3a4e;
}

body.dark-mode .my-view-btn:hover {
    background: #3a3a4e;
    border-color: #667eea;
}

body.dark-mode .my-view-btn-load:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

body.dark-mode .my-view-btn-delete:hover {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border-color: #e74c3c;
}

/* Scrollbar styling for export container */
.export-container::-webkit-scrollbar {
    width: 8px;
}

.export-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.export-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.export-container::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

body.dark-mode .export-container::-webkit-scrollbar-track {
    background: #2a2a3e;
}

body.dark-mode .export-container::-webkit-scrollbar-thumb {
    background: #667eea;
}

/* ===========================================
   SEARCH ENHANCEMENT STYLES
   Date range presets and boolean search
   =========================================== */

/* Date Range Presets */
.date-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 8px 0; /* Reduced from 15px to 8px */
    padding: 8px; /* Reduced from 15px to 8px */
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.date-presets-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-right: 10px;
}

.date-preset-btn {
    padding: 6px 12px;
    border: 1px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.date-preset-btn:hover {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.date-preset-btn:active {
    /* No transform needed */
}

/* Search Help Button */
.search-help-btn {
    background: #000000;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-help-btn:hover {
    background: #333333;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.search-help-btn:active {
    transform: scale(1);
}

/* Dark Mode Styles */
body.dark-mode .date-presets {
    background: #2a2a3e;
    border-color: #3a3a4e;
}

body.dark-mode .date-presets-label {
    color: #b0b0c0;
}

body.dark-mode .date-preset-btn {
    background: #1a1a2e;
    border-color: #667eea;
    color: #667eea;
}

body.dark-mode .date-preset-btn:hover {
    background: #667eea;
    color: white;
}

body.dark-mode .search-help-btn {
    background: white;
    color: #000000;
}

body.dark-mode .search-help-btn:hover {
    background: #e0e0e0;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.4);
}

/* ===========================================
   PERFORMANCE OPTIMIZATION STYLES
   Loading indicators and optimizations
   =========================================== */

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 10000;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1.05);
    }
}

/* Dark mode loading indicator */
body.dark-mode .loading-indicator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.6);
}

/* ===========================================
   DATA UPDATE NOTIFICATION
   Shows when new data is available on server
   =========================================== */

.update-notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    transition: top 0.4s ease-out;
}

.update-notification.show {
    top: 80px;
}

.update-notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.4);
    animation: notificationPulse 2s ease-in-out infinite;
}

@keyframes notificationPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(40, 167, 69, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(40, 167, 69, 0.6); }
}

.update-notification-icon {
    font-size: 18px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.update-notification-text {
    white-space: nowrap;
}

.update-notification-btn {
    background: white;
    color: #28a745;
    border: none;
    padding: 6px 16px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.update-notification-btn:hover {
    background: #f0fff4;
    transform: scale(1.05);
}

.update-notification-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.update-notification-close:hover {
    opacity: 1;
}

body.dark-mode .update-notification-content {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
    box-shadow: 0 4px 20px rgba(32, 201, 151, 0.5);
}

body.dark-mode .update-notification-btn {
    background: #1a1a2e;
    color: #20c997;
}

body.dark-mode .update-notification-btn:hover {
    background: #252545;
}

/* ===========================================
   MOBILE OPTIMIZATIONS
   Responsive design for phones and tablets
   =========================================== */

/* Tablet and smaller (< 1024px) */
@media (max-width: 1024px) {
    /* Adjust header */
    .header h1 {
        font-size: 20px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-card .label {
        font-size: 10px;
    }

    .stat-card .value {
        font-size: 20px;
    }

    /* Bottom controls - wrap on smaller screens */
    .bottom-controls {
        flex-wrap: wrap;
        gap: 5px;
        padding: 8px;
    }

    .ctrl-btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    /* Modals take more screen space */
    .modal-content {
        max-width: 95vw;
        max-height: 90vh;
        margin: 20px;
    }

    .reports-modal-wide {
        max-width: 95vw !important;
    }

    /* Analytics charts stack vertically */
    .analytics-row {
        grid-template-columns: 1fr;
    }
}

/* Mobile phones (< 768px) */
@media (max-width: 768px) {
    /* Header adjustments */
    .header {
        padding: 10px;
    }

    .header h1 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .stat-card {
        padding: 10px 8px;
        min-height: auto;
    }

    .stat-card .label {
        font-size: 9px;
        margin-bottom: 4px;
    }

    .stat-card .value {
        font-size: 18px;
    }

    /* Podcast player smaller */
    .podcast-player-inline {
        padding: 8px;
        flex-wrap: wrap; /* Stack on very small screens */
        gap: 6px;
    }

    .podcast-label-inline {
        font-size: 11px;
    }
    
    .podcast-player-inline audio {
        min-width: 100px; /* Smaller min width on mobile */
        max-width: 180px; /* Smaller max on mobile */
    }

    /* Bottom controls stack */
    .bottom-controls {
        padding: 6px;
        gap: 4px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .ctrl-btn {
        font-size: 11px;
        padding: 10px 14px;
        min-height: 44px; /* Touch-friendly minimum */
        white-space: nowrap;
    }

    /* Mobile menu toggle - show on mobile */
    .mobile-menu-toggle {
        display: inline-flex !important;
    }

    /* Desktop-only buttons - hide on mobile */
    .desktop-only {
        display: none !important;
    }

    /* Map takes full width */
    .main-container {
        flex-direction: column;
    }

    .map-container {
        height: 50vh;
        min-height: 400px;
    }

    .side-panel {
        position: relative;
        width: 100%;
        height: 300px;
        left: 0;
        transform: none;
    }

    /* Feed panel keeps normal width at tablet size - no fullscreen */
    .feed-panel {
        width: 320px;
    }

    .feed-panel.closed {
        transform: translateX(-100%);
    }

    /* Modals full screen on mobile */
    .modal-content {
        max-width: 100vw;
        max-height: 95vh;
        margin: 10px 0;
        border-radius: 12px 12px 0 0;
    }

    .reports-modal-wide {
        max-width: 100vw !important;
    }

    /* Modal headers */
    .modal-header {
        padding: 15px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 28px;
    }

    /* Report content */
    .report-content-wrapper {
        padding: 15px;
        height: 60vh;
    }

    .report-h1 {
        font-size: 20px;
    }

    .report-h2 {
        font-size: 18px;
    }

    .report-h3 {
        font-size: 16px;
    }

    .report-h4 {
        font-size: 14px;
    }

    /* Date presets wrap on mobile */
    .date-presets {
        flex-wrap: wrap;
    }

    .date-preset-btn {
        font-size: 11px;
        padding: 8px 12px;
        min-height: 40px;
    }

    /* Search panel */
    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        max-width: 100% !important;
    }

    /* Analytics */
    .analytics-container {
        padding: 10px;
    }

    .analytics-chart-container {
        padding: 15px;
    }

    /* Export modal */
    .export-section {
        padding: 15px;
    }

    .export-button-row {
        flex-direction: column;
    }

    .export-section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .export-action-btn {
        width: 100%;
    }

    /* Preset items stack better */
    .preset-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .preset-actions {
        width: 100%;
        justify-content: space-between;
    }

    /* Feed items */
    .feed-item {
        padding: 12px;
    }

    .feed-item-title {
        font-size: 14px;
    }

    .feed-item-location {
        font-size: 12px;
    }

    /* Legend panel */
    .legend-panel {
        max-width: 90vw;
    }

    /* Time slider container */
    .time-slider-container {
        padding: 10px;
    }

    .time-controls-row {
        flex-direction: column;
        gap: 10px;
    }

    .time-manual-inputs {
        width: 100%;
    }

    /* Bottom search panel */
    .bottom-filter-panel {
        max-height: 70vh;
    }

    .search-tabs {
        gap: 5px;
    }

    .search-tab {
        font-size: 12px;
        padding: 10px 15px;
        min-height: 44px;
    }
}

/* Small phones (< 480px) */
@media (max-width: 480px) {
    .header h1 {
        font-size: 16px;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        padding: 8px 6px;
    }

    .stat-card .label {
        font-size: 8px;
    }

    .stat-card .value {
        font-size: 16px;
    }

    .ctrl-btn {
        padding: 8px 10px;
        font-size: 10px;
    }

    .ctrl-btn span {
        font-size: 14px !important;
    }

    .modal-title {
        font-size: 16px;
    }

    .report-h1 {
        font-size: 18px;
    }

    .report-h2 {
        font-size: 16px;
    }

    .report-h3 {
        font-size: 14px;
    }

    .analytics-chart-title {
        font-size: 14px;
    }

    .export-section-title {
        font-size: 16px;
    }

    .preset-name {
        font-size: 14px;
    }
}

/* Touch-friendly improvements for all mobile */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets */
    button,
    .ctrl-btn,
    .stat-card,
    .feed-item,
    .modal-close,
    .search-tab,
    .date-preset-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* More padding for easier tapping */
    .event-btn {
        padding: 12px 20px;
    }

    .report-btn {
        padding: 14px 24px;
    }

    /* Remove hover effects on touch devices */
    .ctrl-btn:hover,
    .stat-card:hover,
    .feed-item:hover {
        transform: none;
    }

    /* Use active states instead */
    .ctrl-btn:active {
        transform: scale(0.95);
    }

    .stat-card:active {
        transform: scale(0.98);
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .map-container {
        height: 70vh;
    }

    .modal-content {
        max-height: 85vh;
    }

    .report-content-wrapper {
        height: 50vh;
    }
}

/* Prevent text selection on touch devices for better UX */
@media (hover: none) {
    .ctrl-btn,
    .stat-card .label,
    .stat-card .value,
    .search-tab {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
}

/* iOS safe areas */
@supports (padding: env(safe-area-inset-bottom)) {
    .bottom-controls {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .feed-panel {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Loading Spinner Overlay - Now appears inside modals only */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

/* ===========================================
   USER TOUR / WALKTHROUGH STYLES
   First-time user onboarding
   =========================================== */

/* Tour Overlay */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    animation: tourFadeIn 0.3s ease-out;
}

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

/* Tour Highlight */
.tour-highlight {
    border: 3px solid #667eea;
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3),
                0 0 0 9999px rgba(0, 0, 0, 0.5);
    animation: tourPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes tourPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3),
                    0 0 0 9999px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.5),
                    0 0 0 9999px rgba(0, 0, 0, 0.5);
    }
}

/* Tour Tooltip */
.tour-tooltip {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 10002;
    max-width: 400px;
    min-width: 320px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.tour-tooltip-visible {
    opacity: 1;
    transform: scale(1);
}

.tour-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 8px 20px;
    border-bottom: 2px solid #f0f0f0;
}

.tour-tooltip-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}

.tour-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.tour-close-btn:hover {
    background: #f0f0f0;
    color: #2c3e50;
}

.tour-tooltip-content {
    padding: 12px 20px;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
}

.tour-do-not-show {
    padding: 8px 20px;
    border-top: 2px solid #f0f0f0;
    border-bottom: 2px solid #f0f0f0;
    background: #f8f9fa;
}

.tour-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    user-select: none;
}

.tour-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.tour-tooltip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px 12px 20px;
    border-top: 2px solid #f0f0f0;
}

.tour-progress {
    font-size: 13px;
    font-weight: 600;
    color: #888;
}

.tour-tooltip-actions {
    display: flex;
    gap: 10px;
}

.tour-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tour-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tour-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.tour-btn-secondary {
    background: #f0f0f0;
    color: #555;
}

.tour-btn-secondary:hover {
    background: #e0e0e0;
}

/* Dark Mode Tour Styles */
body.dark-mode .tour-overlay {
    background: rgba(0, 0, 0, 0.5);
}

body.dark-mode .tour-tooltip {
    background: #2a2a3e;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

body.dark-mode .tour-tooltip-header {
    border-bottom-color: #3a3a4e;
}

body.dark-mode .tour-tooltip-title {
    color: #e0e0e0;
}

body.dark-mode .tour-close-btn {
    color: #888;
}

body.dark-mode .tour-close-btn:hover {
    background: #3a3a4e;
    color: #e0e0e0;
}

body.dark-mode .tour-tooltip-content {
    color: #b0b0c0;
}

body.dark-mode .tour-tooltip-footer {
    border-top-color: #3a3a4e;
}

body.dark-mode .tour-btn-secondary {
    background: #3a3a4e;
    color: #e0e0e0;
}

body.dark-mode .tour-btn-secondary:hover {
    background: #4a4a5e;
}

body.dark-mode .tour-do-not-show {
    background: rgba(26, 26, 46, 0.5);
    border-top-color: #3a3a4e;
    border-bottom-color: #3a3a4e;
}

body.dark-mode .tour-checkbox-label {
    color: #b0b0c0;
}

/* ===========================================
   TOOLTIP SYSTEM STYLES
   Rich, customizable tooltips for UI elements
   =========================================== */

.custom-tooltip {
    position: fixed;
    background: white;
    color: #2c3e50;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 300px;
    z-index: 10003;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.custom-tooltip-visible {
    opacity: 1;
    transform: scale(1);
}

/* Tooltip arrow */
.custom-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 6px solid transparent;
}

.custom-tooltip[data-position="top"]::before {
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: white;
    border-bottom: none;
}

.custom-tooltip[data-position="bottom"]::before {
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: white;
    border-top: none;
}

.custom-tooltip[data-position="left"]::before {
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: white;
    border-right: none;
}

.custom-tooltip[data-position="right"]::before {
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: white;
    border-left: none;
}

/* Dark mode tooltips */
body.dark-mode .custom-tooltip {
    background: #2a2a3e;
    color: #e0e0e0;
    border-color: #3a3a4e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .custom-tooltip[data-position="top"]::before {
    border-top-color: #2a2a3e;
}

body.dark-mode .custom-tooltip[data-position="bottom"]::before {
    border-bottom-color: #2a2a3e;
}

body.dark-mode .custom-tooltip[data-position="left"]::before {
    border-left-color: #2a2a3e;
}

body.dark-mode .custom-tooltip[data-position="right"]::before {
    border-right-color: #2a2a3e;
}

/* Enhance native tooltips for elements that use title attribute */
[title] {
    position: relative;
}

/* Remove default browser tooltip for elements with data-tooltip */
[data-tooltip] {
    cursor: help;
}

/* ============================================
   UMBRELLA GROUPING MARKERS
   ============================================ */

/* Umbrella marker container */
.umbrella-marker-container {
    background: transparent !important;
    border: none !important;
}

/* Umbrella marker main icon */
.umbrella-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.umbrella-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 3px solid white;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.umbrella-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Count badge */
.umbrella-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    min-width: 20px;
    text-align: center;
    z-index: 10;
}

/* Umbrella expanded view in side panel */
.umbrella-expanded-container {
    margin: 20px 0;
}

.umbrella-expanded-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px 10px 0 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.umbrella-expanded-header .umbrella-emoji {
    font-size: 24px;
}

.umbrella-expanded-list {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 400px;
    overflow-y: auto;
}

.umbrella-event-item {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.umbrella-event-item:hover {
    background: #e8eaf0;
}

.umbrella-event-item.active {
    background: #d3d7e8;
}

.umbrella-event-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.umbrella-event-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.umbrella-event-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Dark mode support for umbrella markers */
.dark-mode .umbrella-expanded-list {
    background: #2a2a3e;
    border-color: #3a3a4e;
}

.dark-mode .umbrella-event-item {
    border-bottom-color: #3a3a4e;
}

.dark-mode .umbrella-event-item:hover {
    background: #333348;
}

.dark-mode .umbrella-event-item.active {
    background: #3d3d58;
}

.dark-mode .umbrella-event-title {
    color: #e0e0e0;
}

.dark-mode .umbrella-event-meta {
    color: #999;
}

/* Umbrella toggle button active state */
#umbrellaToggleBtn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ======================
   Advanced Search Builder Styles
   ====================== */

/* Search Builder Sections */
.search-builder-section {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark-mode .search-builder-section {
    background: #2d2d3d;
}

/* Filter Palette */
.filter-palette {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-block {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #667eea;
    color: white;
    border-radius: 6px;
    cursor: grab;
    user-select: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-block:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.filter-block:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.filter-icon {
    font-size: 18px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
}

/* Query Builder Area */
.query-builder-area {
    flex: 1;
    background: white;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    min-height: 400px;
}

.dark-mode .query-builder-area {
    background: #2d2d3d;
    border-color: #444;
}

.query-builder-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
}

.query-builder-hint {
    font-size: 13px;
    margin-top: 10px;
    color: #bbb;
}

/* Query Nodes */
.query-node {
    margin-bottom: 10px;
    position: relative;
}

.query-filter {
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark-mode .query-filter {
    background: #3d3d4d;
    border-color: #667eea;
}

.query-operator {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark-mode .query-operator {
    background: #3d3d4d;
    border-color: #444;
}

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

.operator-label {
    font-weight: 700;
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 4px;
    color: white;
}

.operator-label.and {
    background: #4caf50;
}

.operator-label.or {
    background: #2196f3;
}

.operator-label.not {
    background: #f44336;
}

.operator-children {
    padding: 15px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    border: 1px dashed #ddd;
    min-height: 60px;
}

.dark-mode .operator-children {
    background: rgba(0, 0, 0, 0.3);
    border-color: #444;
}

.drop-zone-hint {
    color: #999;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

.node-icon {
    font-size: 18px;
}

.node-label {
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
    min-width: 120px;
    display: inline-block;
}

.dark-mode .node-label {
    color: #8899ff;
}

.node-remove-btn {
    background: #f44336;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
    margin-left: auto;
}

.node-remove-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

/* Filter Configuration */
.filter-config {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.filter-config input,
.filter-config select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    flex: 1;
    min-width: 120px;
}

.dark-mode .filter-config input,
.dark-mode .filter-config select {
    background: #2d2d3d;
    border-color: #444;
    color: #e0e0e0;
}

.filter-note {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* Saved Searches & History Lists */
.saved-searches-list,
.search-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.saved-search-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dark-mode .saved-search-item {
    background: #3d3d4d;
    border-color: #444;
}

.saved-search-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.saved-search-info strong {
    font-size: 13px;
    color: #333;
}

.dark-mode .saved-search-info strong {
    color: #e0e0e0;
}

.saved-search-info small {
    font-size: 11px;
    color: #888;
}

.saved-search-actions {
    display: flex;
    gap: 5px;
}

.history-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark-mode .history-item {
    background: #3d3d4d;
    border-color: #444;
}

.history-item:hover {
    background: #f5f5f5;
    border-color: #667eea;
}

.dark-mode .history-item:hover {
    background: #4d4d5d;
}

.history-summary {
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.dark-mode .history-summary {
    color: #e0e0e0;
}

.history-item small {
    font-size: 11px;
    color: #888;
}

.empty-list {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Button Styles */
.btn-small {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    background: #667eea;
    color: white;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.btn-small:hover {
    background: #5568d3;
}

.btn-small.btn-danger {
    background: #f44336;
}

.btn-small.btn-danger:hover {
    background: #d32f2f;
}

.modal-btn-secondary {
    background: #999;
}

.modal-btn-secondary:hover {
    background: #777;
}

/* Disabled Button States - NO hover, NO pointer */
button[disabled],
button:disabled,
.modal-btn[disabled],
.modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Drag and Drop States */
.query-builder-area.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.operator-children.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}
