        /* Dark Theme (Default) */
        :root {
            --primary: #3b82f6;
            --primary-dark: #2563eb;
            --secondary: #10b981;
            --danger: #ef4444;
            --warning: #f59e0b;
            --dark: #0f172a;
            --dark-panel: rgba(15, 23, 42, 0.95);
            --glass: rgba(255, 255, 255, 0.1);
            --glass-border: rgba(255, 255, 255, 0.2);
            --text-primary: #ffffff;
            --text-secondary: #94a3b8;
            --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
            --body-bg: #0f172a;
            --panel-bg: rgba(15, 23, 42, 0.95);
            --input-bg: rgba(255, 255, 255, 0.05);
            --input-border: rgba(255, 255, 255, 0.1);
            --chip-bg: rgba(255, 255, 255, 0.1);
            --chip-active-bg: var(--primary);
            --list-item-bg: rgba(255, 255, 255, 0.05);
            --list-item-hover: rgba(255, 255, 255, 0.1);
            --stat-card-bg: rgba(255, 255, 255, 0.05);
            --filter: none;
        }
        
        /* Light Theme */
        [data-theme="light"] {
            --primary: #3b82f6;
            --primary-dark: #2563eb;
            --secondary: #10b981;
            --danger: #dc2626;
            --warning: #f59e0b;
            --dark: #ffffff;
            --dark-panel: rgba(255, 255, 255, 0.98);
            --glass: rgba(0, 0, 0, 0.05);
            --glass-border: rgba(0, 0, 0, 0.1);
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
            --body-bg: #f8fafc;
            --panel-bg: rgba(255, 255, 255, 0.98);
            --input-bg: rgba(0, 0, 0, 0.04);
            --input-border: rgba(0, 0, 0, 0.1);
            --chip-bg: rgba(0, 0, 0, 0.05);
            --chip-active-bg: var(--primary);
            --list-item-bg: rgba(0, 0, 0, 0.02);
            --list-item-hover: rgba(0, 0, 0, 0.05);
            --stat-card-bg: rgba(0, 0, 0, 0.03);
            --filter: brightness(1.1);
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Inter', sans-serif;
            background: var(--body-bg);
            color: var(--text-primary);
            overflow: hidden;
            height: 100vh;
            transition: background-color 0.3s ease, color 0.3s ease;
        }
        
        .app-container {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100vw;
            height: 100vh;
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            align-items: stretch;
            overflow: hidden;
            gap: 0; /* Ensure no gap between panels and map */
        }
        
        /* Left Panel */
        .left-panel {
            width: 320px;
            height: 100vh;
            background: var(--panel-bg);
            backdrop-filter: blur(20px);
            border-right: 1px solid var(--glass-border);
            display: flex;
            flex-direction: column;
            z-index: 1000;
            transition: transform 0.3s ease, background-color 0.3s ease;
            flex-shrink: 0;
            position: relative;
        }
        
        .left-panel.collapsed {
            transform: translateX(-320px); /* Hide panel completely */
            margin-right: -320px; /* Prevent map from shifting */
        }
        
        /* When collapsed, show toggle button on left edge */
        .left-panel.collapsed .left-toggle {
            position: absolute;
            left: 320px; /* Position at the edge of the collapsed panel */
            top: 50%;
            transform: translateY(-50%);
            right: auto;
            width: 35px;
            height: 60px;
            background: var(--primary);
            box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
            border-radius: 0 8px 8px 0;
            z-index: 1002;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .left-panel.collapsed .left-toggle span {
            transform: rotate(180deg);
            display: inline-block;
        }

        /* Hide mobile panel close buttons on desktop */
        .panel-close-btn {
            display: none;
        }

        /* Desktop-specific overrides to prevent mobile styles bleeding through */
        @media (min-width: 1025px) {
            .earthquake-item {
                padding: 4px !important;
                margin-bottom: 4px !important;
                width: auto !important;
                min-height: auto !important;
                display: flex !important;
                flex-direction: row !important;
                align-items: stretch !important;
                gap: 6px !important;
            }

            .earthquake-header {
                display: flex !important;
                flex-direction: column !important;
                justify-content: center !important;
                align-items: center !important;
                margin-bottom: 0 !important;
                flex-shrink: 0 !important;
            }

            .earthquake-magnitude {
                font-size: 16px !important;
                font-weight: 700 !important;
                padding: 0 !important;
                min-width: 44px !important;
                width: 44px !important;
                height: 44px !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                border-radius: 7px !important;
            }

            .earthquake-time {
                display: none !important;
            }

            .earthquake-body {
                display: flex !important;
                flex-direction: column !important;
                justify-content: center !important;
                gap: 1px !important;
                flex: 1 !important;
                min-width: 0 !important;
            }

            .earthquake-location {
                font-size: 12px !important;
                font-weight: 600 !important;
                margin-bottom: 0 !important;
                line-height: 1.15 !important;
                white-space: nowrap !important;
                overflow: hidden !important;
                text-overflow: ellipsis !important;
            }

            .earthquake-details {
                display: flex !important;
                flex-direction: row !important;
                gap: 5px !important;
                font-size: 10px !important;
                margin-top: 0 !important;
                flex-wrap: wrap !important;
                line-height: 1.15 !important;
            }

            .detail-item {
                display: flex !important;
                align-items: center !important;
                gap: 2px !important;
                white-space: nowrap !important;
            }

            .detail-item i {
                font-size: 9px !important;
            }

            /* Desktop: Ensure all source badges have uniform sizing */
            .source-badge {
                font-size: 9px !important;
                padding: 4px 8px !important;
                font-weight: 600 !important;
                min-height: 24px !important;
                display: inline-flex !important;
                align-items: center !important;
                justify-content: center !important;
                white-space: nowrap !important;
            }

            .multi-source-indicator {
                font-size: 7px !important;
                padding: 1px 3px !important;
                margin-left: 3px !important;
            }
        }

        /* Ensure Leaflet controls stay in place when panel is collapsed */
        .leaflet-control-zoom {
            position: absolute !important;
            left: 10px !important;
            top: 10px !important;
            z-index: 1000 !important;
        }
        
        .panel-header {
            padding: 20px;
            border-bottom: 1px solid var(--glass-border);
            display: flex;
            align-items: center;
        }
        
        
        .brand-text {
            flex: 1;
        }
        
        .brand-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
        }
        
        .brand-subtitle {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 2px;
        }
        
        /* Search Box */
        .search-section {
            padding: 15px;
            border-bottom: 1px solid var(--glass-border);
        }
        
        .search-box {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 10px 40px 10px 15px;
            background: var(--glass);
            border: 1px solid var(--glass-border);
            border-radius: 10px;
            color: var(--text-primary);
            font-size: 14px;
            transition: all 0.3s ease;
        }
        
        .search-input:focus {
            outline: none;
            background: rgba(255, 255, 255, 0.15);
            border-color: var(--primary);
        }
        
        .search-icon {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
        }
        
        /* Filter Section */
        .filter-section {
            padding: 15px;
            flex: 1;
            overflow-y: auto;
        }
        
        .filter-group {
            margin-bottom: 20px;
        }
        
        .historical-presets {
            width: 100%;
            overflow-x: hidden;
        }
        
        .filter-label {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            margin-bottom: 10px;
            display: block;
        }
        
        .filter-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .chip {
            padding: 6px 12px;
            background: var(--glass);
            border: 1px solid var(--glass-border);
            border-radius: 20px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .chip:hover {
            background: rgba(255, 255, 255, 0.2);
        }
        
        .chip.active {
            background: var(--primary);
            border-color: var(--primary);
        }
        
        /* Layer Chips */
        .layer-chips {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }
        
        .layer-chip {
            padding: 8px 12px;
            background: var(--glass);
            border: 1px solid var(--glass-border);
            border-radius: 20px;
            color: var(--text-primary);
            font-size: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .layer-chip:hover {
            background: rgba(255, 255, 255, 0.2);
        }
        
        .layer-chip.active {
            background: var(--success);
            border-color: var(--success);
        }
        
        .layer-chip i {
            font-size: 14px;
        }
        
        /* Toggle Switch */
        .toggle-switch {
            display: flex;
            align-items: center;
            cursor: pointer;
            user-select: none;
            padding: 8px 12px;
            background: var(--glass);
            border-radius: 10px;
            border: 1px solid var(--glass-border);
            transition: all 0.3s ease;
        }
        
        .toggle-switch:hover {
            background: rgba(255, 255, 255, 0.1);
        }
        
        .toggle-switch input[type="checkbox"] {
            display: none;
        }
        
        .toggle-slider {
            position: relative;
            display: inline-block;
            width: 48px;
            height: 26px;
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.5), rgba(239, 68, 68, 0.3));
            border: 1px solid rgba(239, 68, 68, 0.4);
            border-radius: 13px;
            transition: all 0.3s ease;
            margin-right: 12px;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
            overflow: hidden; /* Ensure content stays within bounds */
            transform: translateZ(0); /* Force GPU acceleration for stable rendering */
        }
        
        .toggle-slider::before {
            content: '✕';
            position: absolute;
            color: rgba(255, 255, 255, 0.5);
            font-size: 10px;
            font-weight: bold;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            transition: opacity 0.3s ease;
        }
        
        .toggle-slider::after {
            content: '';
            position: absolute;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: linear-gradient(135deg, #ffffff, #f3f4f6);
            top: 1px;
            left: 2px;
            transition: left 0.3s ease, background 0.3s ease;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            will-change: left; /* Optimize for animation */
        }
        
        .toggle-switch input[type="checkbox"]:checked + .toggle-slider {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.5), rgba(34, 197, 94, 0.3));
            border-color: rgba(34, 197, 94, 0.4);
        }
        
        .toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
            content: '✓';
            left: 8px;
            right: auto;
            opacity: 1;
            color: rgba(255, 255, 255, 0.7);
        }
        
        .toggle-switch input[type="checkbox"]:checked + .toggle-slider::after {
            left: 24px; /* Use left position instead of transform for more stable rendering */
            background: linear-gradient(135deg, #ffffff, #f0fdf4);
        }
        
        .toggle-label {
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .toggle-label::before {
            content: '🎬';
            font-size: 16px;
        }
        
        /* Volcano Marker */
        .volcano-marker {
            background: transparent;
            border: none;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .volcano-marker i {
            font-size: 20px;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
        }
        
        /* Earthquake Clusters */
        .earthquake-cluster {
            background: var(--primary);
            border: 3px solid rgba(255, 255, 255, 0.8);
            border-radius: 50%;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            color: white;
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
        }
        
        .earthquake-cluster-small {
            width: 40px;
            height: 40px;
            font-size: 14px;
        }
        
        .earthquake-cluster-medium {
            width: 50px;
            height: 50px;
            font-size: 16px;
            background: var(--warning);
        }
        
        .earthquake-cluster-large {
            width: 60px;
            height: 60px;
            font-size: 18px;
            background: var(--danger);
        }
        
        .earthquake-cluster div {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
        }
        
        .range-slider {
            margin-top: 10px;
        }
        
        .range-input {
            width: 100%;
            height: 6px;
            border-radius: 3px;
            background: var(--glass);
            outline: none;
            -webkit-appearance: none;
            appearance: none;
            cursor: pointer;
            transition: opacity 0.2s ease;
        }
        
        .range-input:hover {
            opacity: 0.9;
        }
        
        .range-input::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: var(--primary);
            cursor: pointer;
            border: 2px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
            transition: all 0.2s ease;
        }
        
        .range-input::-moz-range-thumb {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: var(--primary);
            cursor: pointer;
            border: 2px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
            transition: all 0.2s ease;
            border: none;
        }
        
        .range-input::-webkit-slider-thumb:hover {
            transform: scale(1.15);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.7);
        }
        
        .range-input::-moz-range-thumb:hover {
            transform: scale(1.15);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.7);
        }
        
        .range-value {
            display: flex;
            justify-content: space-between;
            margin-top: 5px;
            font-size: 12px;
            color: var(--text-secondary);
        }
        
        .range-value span:nth-child(2) {
            font-weight: 600;
            color: var(--primary);
        }
        
        /* Stats Section */
        .stats-section {
            padding: 15px;
            border-top: 1px solid var(--glass-border);
        }
        
        .stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }
        
        .stat-card {
            padding: 10px;
            background: var(--glass);
            border-radius: 10px;
            border: 1px solid var(--glass-border);
        }
        
        .stat-value {
            font-size: 20px;
            font-weight: 600;
            color: var(--primary);
        }
        
        .stat-label {
            font-size: 11px;
            color: var(--text-secondary);
            margin-top: 2px;
        }
        
        /* Map Container */
        .map-container {
            flex: 1;
            position: relative;
            overflow: hidden;
            height: 100vh;
            min-width: 0; /* Important: Allow flexbox to shrink properly */
        }
        
        #map {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100%;
            height: 100%;
            background: #0a0f1c;
            z-index: 1;
        }
        
        /* Top Controls */
        .top-controls {
            position: absolute;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 10px;
            z-index: 1000;
            background: var(--dark-panel);
            padding: 8px;
            border-radius: 12px;
            backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
        }
        
        .control-btn {
            padding: 10px 20px;
            background: var(--glass);
            border: 1px solid var(--glass-border);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            position: relative;
        }
        
        .control-btn:hover {
            background: rgba(255, 255, 255, 0.2);
        }
        
        .control-btn.active {
            background: var(--primary);
            border-color: var(--primary);
        }
        
        .control-btn i {
            font-size: 16px;
        }

        /* Live indicator dot */
        .live-dot {
            width: 8px;
            height: 8px;
            background: #ff4444;
            border-radius: 50%;
            display: none;
            animation: live-pulse 1.5s ease-in-out infinite;
            box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
        }

        #btnLive.active .live-dot {
            display: inline-block;
        }

        @keyframes live-pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
            }
            70% {
                box-shadow: 0 0 0 8px rgba(255, 68, 68, 0);
            }
            100% {
                box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
            }
        }

        /* Live status indicator on map */
        .live-status-indicator {
            position: absolute;
            bottom: 25px;
            right: 10px;
            background: var(--panel-bg);
            backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            padding: 8px 12px;
            z-index: 999;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 11px;
            color: var(--text-secondary);
            opacity: 0;
            animation: fadeIn 0.5s ease forwards;
            transition: all 0.3s ease;
        }

        .live-status-indicator.hidden {
            display: none;
        }

        .live-status-indicator:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .live-status-indicator .status-dot {
            width: 6px;
            height: 6px;
            background: #22c55e;
            border-radius: 50%;
            animation: status-blink 2s ease-in-out infinite;
        }

        .live-status-indicator .status-sources {
            display: flex;
            gap: 4px;
            align-items: center;
            flex-wrap: wrap;
        }

        .live-status-indicator .source-tag {
            background: var(--glass);
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 9px;
            font-weight: 600;
            color: var(--primary);
            border: 1px solid var(--glass-border);
        }

        @keyframes status-blink {
            0%, 100% {
                opacity: 1;
            }
            50% {
                opacity: 0.3;
            }
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        /* Theme Toggle Switch */
        .theme-toggle {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 4px;
            background: var(--glass);
            border-radius: 25px;
            border: 1px solid var(--glass-border);
        }
        
        .theme-toggle-switch {
            position: relative;
            width: 50px;
            height: 26px;
            background: var(--glass);
            border-radius: 25px;
            cursor: pointer;
            transition: background-color 0.3s ease;
            border: 1px solid var(--glass-border);
        }
        
        .theme-toggle-switch.active {
            background: var(--primary);
        }
        
        .theme-toggle-slider {
            position: absolute;
            top: 2px;
            left: 2px;
            width: 20px;
            height: 20px;
            background: white;
            border-radius: 50%;
            transition: transform 0.3s ease;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }
        
        .theme-toggle-switch.active .theme-toggle-slider {
            transform: translateX(24px);
        }
        
        .theme-icon {
            font-size: 16px;
            color: var(--text-secondary);
            transition: color 0.3s ease;
        }
        
        .theme-icon.active {
            color: var(--primary);
        }
        
        /* Right Panel */
        .right-panel {
            width: 350px;
            height: 100vh;
            background: var(--panel-bg);
            backdrop-filter: blur(20px);
            border-left: 1px solid var(--glass-border);
            display: flex;
            flex-direction: column;
            z-index: 1000;
            transition: transform 0.3s ease, background-color 0.3s ease;
            flex-shrink: 0;
            position: relative;
        }
        
        
        
        /* Graph Modal Styles */
        .graph-modal {
            display: none;
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--panel-bg);
            border: 1px solid var(--glass-border);
            border-radius: 16px;
            padding: 30px;
            z-index: 10000;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
            width: 95%;
            max-width: 1200px;
            height: 85vh;
            max-height: 800px;
        }
        
        .graph-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 2px solid var(--glass-border);
        }
        
        .graph-modal-title {
            font-size: 20px;
            font-weight: 700;
            color: var(--text-primary);
            line-height: 1.4;
        }
        
        .graph-modal-subtitle {
            font-size: 14px;
            color: var(--text-secondary);
            margin-top: 6px;
            display: flex;
            gap: 20px;
            flex-wrap: wrap;
        }
        
        .graph-modal-stat {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        
        .graph-modal-stat i {
            font-size: 16px;
            opacity: 0.7;
        }
        
        .graph-modal-close {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 24px;
            cursor: pointer;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            transition: all 0.2s ease;
        }
        
        .graph-modal-close:hover {
            background: rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
        }
        
        .graph-container {
            width: 100%;
            height: calc(100% - 80px);
            position: relative;
            padding: 10px;
            background: rgba(0, 0, 0, 0.2);
            border-radius: 12px;
        }
        
        .graph-canvas {
            width: 100%;
            height: 100%;
        }
        
        .graph-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            z-index: 9999;
        }
        
        .toolbox-separator {
            height: 1px;
            background: var(--glass-border);
            margin: 4px 0;
        }
        
        /* Distance measurement display */
        .measurement-display {
            position: absolute;
            background: var(--primary);
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 20px;
            padding: 6px 16px;
            font-size: 12px;
            font-weight: 600;
            color: white;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
            pointer-events: none;
            z-index: 1000;
            white-space: nowrap;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(10px);
            text-align: center;
            line-height: 1;
            letter-spacing: 0.5px;
        }
        
        .measurement-display div {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
        }
        
        .right-panel.collapsed {
            transform: translateX(350px);
            margin-left: -350px;
        }
        
        .right-panel.collapsed .right-toggle {
            position: absolute;
            right: 350px;
            left: auto;
            background: var(--primary);
            box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
        }
        
        .earthquake-list {
            flex: 1;
            overflow-y: auto;
            padding: 15px;
        }
        
        .earthquake-item {
            padding: 15px;
            background: var(--glass);
            border-radius: 10px;
            margin-bottom: 10px;
            border: 1px solid var(--glass-border);
            cursor: pointer;
            transition: all 0.3s ease;
            width: auto;
            min-height: auto;
        }
        
        .earthquake-item:hover {
            background: rgba(255, 255, 255, 0.15);
            transform: translateX(-5px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            border-color: rgba(255, 255, 255, 0.3);
        }
        
        .earthquake-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }
        
        .earthquake-magnitude {
            font-size: 24px;
            font-weight: 700;
            padding: 5px 10px;
            border-radius: 8px;
            min-width: 50px;
            text-align: center;
        }
        
        .magnitude-low {
            background: rgba(16, 185, 129, 0.2);
            color: #10b981;
        }
        
        .magnitude-medium {
            background: rgba(245, 158, 11, 0.2);
            color: #f59e0b;
        }
        
        .magnitude-high {
            background: rgba(239, 68, 68, 0.2);
            color: #ef4444;
        }
        
        .earthquake-time {
            font-size: 12px;
            color: var(--text-secondary);
        }
        
        .earthquake-location {
            font-size: 14px;
            font-weight: 500;
            margin-bottom: 5px;
        }
        
        .earthquake-details {
            display: flex;
            flex-direction: column;
            gap: 8px;
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 8px;
        }
        
        .detail-item {
            display: flex;
            align-items: flex-start;
            gap: 5px;
        }
        
        /* Multi-source indicator */
        .multi-source-indicator {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 10px;
            color: #fbbf24;
            margin-left: 8px;
            padding: 1px 4px;
            background: rgba(251, 191, 36, 0.1);
            border-radius: 3px;
            border: 1px solid rgba(251, 191, 36, 0.3);
        }
        
        .detail-item i {
            font-size: 14px;
        }
        
        /* Toggle Buttons - Sleek Design */
        .panel-toggle {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 24px;
            height: 48px;
            background: rgba(30, 41, 59, 0.95);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 1001;
            overflow: hidden;
        }
        
        .panel-toggle:hover {
            background: var(--primary);
            width: 28px;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
        }
        
        .panel-toggle span {
            font-size: 16px;
            color: rgba(255, 255, 255, 0.8);
            transition: transform 0.3s ease;
            display: inline-block;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        .panel-toggle:hover span {
            color: white;
            transform: scale(1.2);
        }
        
        .left-toggle {
            right: -24px;
            border-radius: 0 6px 6px 0;
            border-left: none;
        }
        
        .right-toggle {
            left: -24px;
            border-radius: 6px 0 0 6px;
            border-right: none;
        }
        
        /* Loading */
        .loading-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--dark-panel);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 2000;
        }
        
        .loading-spinner {
            width: 50px;
            height: 50px;
            border: 3px solid var(--glass);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        .la-spin {
            animation: spin 1s linear infinite;
        }
        
        /* Date Range Picker Styles */
        .date-input {
            width: 100%;
            padding: 8px 12px;
            background: var(--glass);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 13px;
            transition: all 0.3s ease;
        }
        
        .date-input:focus {
            outline: none;
            border-color: var(--primary);
            background: rgba(59, 130, 246, 0.1);
        }
        
        .date-input::-webkit-calendar-picker-indicator {
            filter: invert(0.8);
            cursor: pointer;
        }
        
        .preset-btn {
            padding: 4px 6px;
            background: var(--glass);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text-secondary);
            font-size: 10px;
            line-height: 1.2;
            cursor: pointer;
            transition: all 0.2s ease;
            white-space: normal;
            text-align: center;
            min-height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
        }
        
        .preset-btn:hover {
            background: rgba(59, 130, 246, 0.2);
            border-color: var(--primary);
            color: var(--text-primary);
            transform: translateY(-1px);
        }
        
        .preset-btn:active {
            transform: translateY(0);
        }
        
        .preset-btn.active {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
        }
        
        .apply-btn, .cancel-btn {
            flex: 1;
            padding: 8px 16px;
            border-radius: 8px;
            border: 1px solid var(--border);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        
        .apply-btn {
            background: linear-gradient(135deg, var(--primary), rgba(59, 130, 246, 0.8));
            color: white;
            border-color: var(--primary);
        }
        
        .apply-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
        }
        
        .cancel-btn {
            background: var(--glass);
            color: var(--text-secondary);
        }
        
        .cancel-btn:hover {
            background: rgba(239, 68, 68, 0.1);
            border-color: rgba(239, 68, 68, 0.5);
            color: #f87171;
        }
        
        #customDateRange {
            padding: 15px;
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid var(--border);
            border-radius: 12px;
            backdrop-filter: blur(10px);
        }
        
        .historical-presets {
            padding-top: 10px;
            border-top: 1px solid var(--border);
        }
        
        /* Source badges - uniform sizing for all contexts */
        .source-badge {
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            padding: 4px 8px !important;
            border-radius: 6px;
            font-size: 9px !important;
            font-weight: 600 !important;
            margin-right: 6px;
            margin-bottom: 4px;
            transition: all 0.2s ease;
            box-sizing: border-box;
            min-height: 24px !important;
            white-space: nowrap;
        }
        
        .sources-container {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin-top: 6px;
        }

        /* Multi-source container specific adjustments only */
        .sources-container .source-badge {
            flex: 0 0 auto;
            margin: 0;
            margin-right: 0;
            letter-spacing: -0.2px;
        }

        /* Ensure consistent colors for all source badges in container */
        .sources-container .source-kandilli,
        .sources-container .source-kandilli.primary,
        .sources-container .source-kandilli.secondary {
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(59, 130, 246, 0.25)) !important;
        }

        .sources-container .source-afad,
        .sources-container .source-afad.primary,
        .sources-container .source-afad.secondary {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.35), rgba(239, 68, 68, 0.25)) !important;
        }

        .sources-container .source-usgs,
        .sources-container .source-usgs.primary,
        .sources-container .source-usgs.secondary {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.35), rgba(34, 197, 94, 0.25)) !important;
        }

        /* Primary/secondary for standalone badges only */
        .source-badge.primary {
            font-weight: 700;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.3);
        }

        .source-badge.secondary {
            border: 1px solid rgba(255, 255, 255, 0.15);
        }
        
        .source-badge:hover {
            opacity: 1;
            transform: scale(1.05);
        }
        
        .source-kandilli {
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.2));
            color: #60a5fa;
            border-color: rgba(59, 130, 246, 0.4);
        }
        
        .source-kandilli.primary {
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.5), rgba(59, 130, 246, 0.3));
        }
        
        .source-afad {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.2));
            color: #f87171;
            border-color: rgba(239, 68, 68, 0.4);
        }
        
        .source-afad.primary {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.5), rgba(239, 68, 68, 0.3));
        }
        
        .source-usgs {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.2));
            color: #4ade80;
            border-color: rgba(34, 197, 94, 0.4);
        }
        
        .source-usgs.primary {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.5), rgba(34, 197, 94, 0.3));
        }
        
        .source-emsc {
            background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(236, 72, 153, 0.2));
            color: #f472b6;
            border-color: rgba(236, 72, 153, 0.4);
        }
        
        .source-turhec_historical,
        .source-historical_catalog,
        .source-historical {
            background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(251, 191, 36, 0.2));
            color: #fde047;
            border-color: rgba(251, 191, 36, 0.4);
        }
        
        /* Historical earthquake indicator */
        .historical-indicator {
            display: inline-block;
            padding: 2px 6px;
            background: linear-gradient(135deg, rgba(251, 191, 36, 0.4), rgba(251, 191, 36, 0.2));
            border: 1px solid rgba(251, 191, 36, 0.5);
            border-radius: 4px;
            font-size: 10px;
            font-weight: 600;
            color: #fde047;
            margin-left: 6px;
            text-transform: uppercase;
        }
        
        /* Volcano animations */
        @keyframes volcano-pulse {
            0%, 100% {
                transform: scale(1);
                filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
            }
            50% {
                transform: scale(1.2);
                filter: drop-shadow(0 4px 8px rgba(255,68,68,0.6)) brightness(1.2);
            }
        }
        
        /* Legend Box - Attached to left panel */
        .legend-box {
            position: fixed;
            left: 320px; /* Attached to right edge of left panel */
            bottom: 0; /* No gap at bottom */
            width: auto;
            max-width: 600px; /* Increased to fit depth items in one row */
            background: var(--dark-panel);
            border: 1px solid var(--glass-border);
            border-left: 2px solid var(--primary);
            border-radius: 0 12px 0 0; /* Rounded on top-right only */
            box-shadow: 4px 0 16px rgba(0, 0, 0, 0.5);
            z-index: 999;
            overflow: hidden;
            transition: all 0.3s ease;
        }
        
        .legend-box.collapsed {
            width: 40px;
            overflow: visible;
        }
        
        .legend-box.collapsed .legend-header {
            padding: 10px 5px;
            writing-mode: vertical-rl;
            text-orientation: mixed;
            height: auto;
            flex-direction: column-reverse;
            align-items: center;
        }
        
        .legend-box.collapsed .legend-header span {
            font-size: 11px;
            letter-spacing: 0.5px;
            margin: 0;
        }
        
        .legend-box.collapsed .legend-content {
            display: none;
        }
        
        .legend-container {
            padding: 15px;
            background: var(--glass);
        }
        
        .legend-header {
            font-size: 14px;
            font-weight: 600;
            color: white;
            padding: 12px 15px;
            background: var(--glass);
            border-bottom: 1px solid var(--glass-border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
        }
        
        .legend-toggle {
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 4px;
            cursor: pointer;
            transition: transform 0.3s ease;
        }
        
        .legend-toggle:hover {
            background: rgba(255, 255, 255, 0.2);
        }
        
        .legend-box.collapsed .legend-toggle {
            transform: rotate(180deg);
            margin-top: 8px;
            width: 16px;
            height: 16px;
            font-size: 10px;
        }
        
        .legend-content {
            padding: 15px 20px;
            transition: all 0.3s ease;
        }
        
        .legend-box.collapsed .legend-content {
            max-height: 0;
            padding: 0;
            overflow: hidden;
        }
        
        .legend-grid {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        
        .legend-section {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        
        .legend-subtitle {
            font-size: 11px;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.9);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 4px;
        }
        
        /* Depth Scale - Horizontal compact layout */
        .depth-scale {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: nowrap; /* Prevent wrapping to ensure single row */
        }
        
        .depth-item {
            display: flex;
            align-items: center;
            gap: 3px;
            font-size: 9px; /* Smaller font to fit more items */
            color: rgba(255, 255, 255, 0.7);
            white-space: nowrap; /* Prevent text wrapping */
        }
        
        .depth-bar {
            width: 16px; /* Smaller width to save space */
            height: 10px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 2px;
            flex-shrink: 0; /* Prevent bar from shrinking */
        }
        
        /* Magnitude Scale - Horizontal with selected sizes */
        .magnitude-scale {
            display: flex;
            align-items: center;  /* Center-align the circles */
            gap: 15px;
            padding: 5px 0;
        }
        
        .magnitude-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }
        
        .magnitude-circle {
            background: rgba(153, 153, 153, 0.6);
            border: 1.5px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .magnitude-item span {
            font-size: 10px;
            color: rgba(255, 255, 255, 0.8);
            font-weight: 500;
        }
        
        /* Fault Lines Scale */
        .fault-scale {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        
        .fault-item {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 9px;
            color: rgba(255, 255, 255, 0.7);
            white-space: nowrap;
        }
        
        .fault-line {
            width: 25px;
            height: 3px;
            border-radius: 1px;
        }
        
        /* Responsive */
        @media (max-width: 768px) {
            .legend-box {
                display: none; /* Hide legend on mobile to save space */
            }
            
            /* Removed absolute positioning that was breaking flex layout */
            
            .top-controls {
                top: 10px;
                padding: 5px;
            }
            
            .control-btn {
                padding: 8px 12px;
                font-size: 12px;
            }
            
            .control-btn span:not(.live-dot) {
                display: none;
            }
            
            .live-status-indicator {
                bottom: 60px;
                right: 5px;
                font-size: 10px;
            }
        }
        
        /* Pulsing earthquake animation */
        @keyframes earthquake-pulse {
            0% {
                transform: scale(1);
                opacity: 0.7;
            }
            100% {
                transform: scale(3.5);
                opacity: 0;
            }
        }

        /* Location pulse animation */
        @keyframes location-pulse {
            0% {
                transform: scale(1);
                opacity: 0.8;
            }
            50% {
                transform: scale(1.5);
                opacity: 0.4;
            }
            100% {
                transform: scale(2);
                opacity: 0;
            }
        }
        
        @keyframes smooth-fade-in {
            0% {
                opacity: 0;
                transform: scale(0.8);
            }
            100% {
                opacity: 1;
                transform: scale(1);
            }
        }
        
        .latest-earthquake-pulse {
            position: absolute;
            border-radius: 50%;
            animation: earthquake-pulse 2s ease-out infinite;
            pointer-events: none;
            z-index: 1000;
        }
        
        .latest-earthquake-pulse:nth-child(1) {
            width: 20px;
            height: 20px;
            margin-left: -10px;
            margin-top: -10px;
            border: 2px solid #ff0000;
            animation-delay: 0s;
        }
        
        .latest-earthquake-pulse:nth-child(2) {
            width: 30px;
            height: 30px;
            margin-left: -15px;
            margin-top: -15px;
            border: 2px solid #ff3333;
            animation-delay: 0.5s;
        }
        
        .latest-earthquake-pulse:nth-child(3) {
            width: 40px;
            height: 40px;
            margin-left: -20px;
            margin-top: -20px;
            border: 2px solid #ff6666;
            animation-delay: 1s;
        }
        
        /* Latest earthquake marker should be visible but not block clicks */
        .latest-earthquake-marker {
            z-index: 500 !important;  /* Reduced from 1001 to avoid blocking */
        }
        
        /* Ensure pulse rings don't block clicks */
        .pulse-ring {
            pointer-events: none !important;
        }
        
        .smooth-animation {
            pointer-events: none !important;
        }
