* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 10px;
    gap: 10px;
}

.controls-panel {
    display: flex;
    gap: 20px;
    padding: 10px 15px;
    background: #16213e;
    border-radius: 8px;
    flex-wrap: wrap;
}

.control-section {
    flex: 1;
    min-width: 250px;
}

.status-divider {
    color: #444;
    margin: 0 5px;
}

.status-text {
    color: #7bed9f;
    font-size: 0.85rem;
}

.legal-btn {
    padding: 4px 12px;
    font-size: 12px;
    background-color: #7f8c8d;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.legal-btn:hover {
    background-color: #95a5a6;
}

.legal-btn.active {
    background-color: #e74c3c;
}

/* Loop controls in header */
.loop-controls {
    display: none;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #2a3f5f;
}

.loop-controls.visible {
    display: flex;
}

.loop-time-display {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #4cc9f0;
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 200px;
}

.frame-counter {
    color: #888;
    font-weight: normal;
    font-size: 0.8rem;
}

.loop-controls input[type="range"] {
    flex: 1;
    min-width: 150px;
    max-width: 400px;
}

.loop-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.loop-btn {
    padding: 5px 10px;
    background: #0f3460;
    border: 1px solid #4cc9f0;
    color: #4cc9f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.loop-btn:hover {
    background: #4cc9f0;
    color: #1a1a2e;
}

.loop-btn.hidden {
    display: none;
}

.fps-control {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #888;
    font-size: 0.8rem;
    margin-left: 10px;
}

.fps-control input {
    width: 45px;
    padding: 3px 5px;
    background: #0f3460;
    border: 1px solid #4cc9f0;
    color: #eee;
    border-radius: 3px;
    text-align: center;
}

.control-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Dropdown Menu Styles */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    padding: 6px 14px;
    background: #0f3460;
    border: 1px solid #4cc9f0;
    color: #4cc9f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.dropdown-btn:hover {
    background: #1a4a7a;
}

.dropdown-btn.active {
    background: #4cc9f0;
    color: #1a1a2e;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 140px;
    background: #16213e;
    border: 1px solid #4cc9f0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    margin-top: 4px;
    padding: 6px 0;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: #0f3460;
    color: #fff;
}

.dropdown-item input[type="radio"] {
    width: 14px;
    height: 14px;
    accent-color: #4cc9f0;
    cursor: pointer;
}

.dropdown-slider-container {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-slider-container input[type="range"] {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #0f3460;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.dropdown-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #4cc9f0;
    border-radius: 50%;
    cursor: pointer;
}

.dropdown-slider-container input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #4cc9f0;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#opacityValue {
    color: #7bed9f;
    font-size: 0.8rem;
    min-width: 35px;
}

/* Overlay Dropdown Styles */
.overlay-dropdown {
    min-width: 220px;
    padding: 0;
}

.overlay-item {
    border-bottom: 1px solid #2a3f5f;
}

.overlay-item:last-child {
    border-bottom: none;
}

.overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
}

.overlay-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
}

.overlay-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4cc9f0;
    cursor: pointer;
}

.overlay-settings-btn {
    background: transparent;
    border: 1px solid #4cc9f0;
    color: #4cc9f0;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.overlay-settings-btn:hover {
    background: #4cc9f0;
    color: #1a1a2e;
}

.overlay-settings-btn.active {
    background: #4cc9f0;
    color: #1a1a2e;
}

.overlay-settings {
    background: #0f3460;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overlay-settings.hidden {
    display: none;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #aaa;
}

.setting-row span:first-child {
    min-width: 50px;
}

.setting-row input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #16213e;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #4cc9f0;
    border-radius: 50%;
    cursor: pointer;
}

.setting-row input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #4cc9f0;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.setting-row input[type="color"] {
    width: 28px;
    height: 22px;
    padding: 0;
    border: 1px solid #4cc9f0;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}

.setting-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.setting-row input[type="color"]::-webkit-color-swatch {
    border-radius: 2px;
    border: none;
}

.setting-value {
    min-width: 30px;
    text-align: right;
    color: #7bed9f;
}

/* ASOS Dropdown Styles */
.asos-dropdown {
    min-width: 200px;
    padding: 0;
}

.asos-toggle {
    padding: 10px 12px;
    border-bottom: 1px solid #2a3f5f;
}

.asos-dropdown .overlay-settings {
    border-top: none;
}

/* ASOS Station Marker Styles */
.asos-station-marker {
    background: transparent !important;
    border: none !important;
}

.asos-station-marker.hidden {
    display: none !important;
}

.asos-station-marker svg {
    overflow: visible;
}

/* ASOS Tooltip Styles */
.asos-tooltip {
    background: rgba(22, 33, 62, 0.95) !important;
    border: 1px solid #4cc9f0 !important;
    border-radius: 6px !important;
    color: #eee !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    max-width: none !important;
    white-space: nowrap !important;
}

.asos-tooltip::before {
    border-top-color: #4cc9f0 !important;
}

.asos-tooltip-content {
    line-height: 1.2;
}

.asos-tooltip-content b {
    color: #4cc9f0;
    font-size: 13px;
}

.asos-tooltip-content .metar {
    display: block;
    margin-top: 4px;
    padding: 4px 6px;
    background: #0f3460;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
    line-height: 1.3;
    color: #ccc;
    white-space: nowrap;
}

/* LSR Dropdown Styles */
.lsr-dropdown {
    min-width: 200px;
}

.lsr-toggle {
    padding: 8px 0;
    border-bottom: 1px solid #333;
    margin-bottom: 8px;
}

.lsr-hour-input {
    width: 60px;
    padding: 4px 8px;
    background: #0f3460;
    border: 1px solid #4cc9f0;
    color: #eee;
    border-radius: 4px;
    font-size: 0.85rem;
}

.lsr-load-btn {
    width: 100%;
    padding: 6px 12px;
    background: #4cc9f0;
    color: #1a1a2e;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
}

.lsr-load-btn:hover {
    background: #3ab8df;
}

.lsr-status {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 8px;
    text-align: center;
}

/* LSR Marker Styles */
.lsr-icon {
    background: transparent !important;
    border: none !important;
}

.lsr-icon svg {
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5));
}

/* LSR Tooltip Styles */
.lsr-tooltip {
    background: rgba(22, 33, 62, 0.95) !important;
    border: 1px solid #ff6600 !important;
    border-radius: 6px !important;
    color: #eee !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    max-width: 350px !important;
}

.lsr-tooltip::before {
    border-top-color: #ff6600 !important;
}

.lsr-tooltip-content .lsr-type {
    font-weight: bold;
    font-size: 14px;
    color: #ff6600;
    margin-bottom: 4px;
}

.lsr-tooltip-content .lsr-detail {
    margin: 2px 0;
}

.lsr-tooltip-content .lsr-detail b {
    color: #4cc9f0;
}

.lsr-tooltip-content .lsr-remark {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #333;
    font-style: italic;
    color: #aaa;
}

/* Watch/Warning Dropdown Styles */
.ww-dropdown {
    min-width: 200px;
}

.ww-toggle {
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.ww-hour-input {
    width: 60px;
    padding: 4px 8px;
    background: #0f3460;
    border: 1px solid #4cc9f0;
    color: #eee;
    border-radius: 4px;
}

.ww-load-btn {
    width: 100%;
    padding: 6px 12px;
    background: #4cc9f0;
    color: #1a1a2e;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.ww-load-btn:hover {
    background: #3ab8df;
}

.ww-status {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 8px;
    text-align: center;
}

/* Watch Polygon Popup Styles */
.watch-popup {
    min-width: 200px;
}

.watch-popup .watch-type {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #333;
}

.watch-popup .watch-type.svr {
    color: #4444ff;
}

.watch-popup .watch-type.tor {
    color: #ff4444;
}

.watch-popup .watch-type.other {
    color: #44ff44;
}

.watch-popup .watch-detail {
    margin: 3px 0;
    font-size: 12px;
}

.watch-popup .watch-detail b {
    color: #4cc9f0;
}

.watch-popup .watch-link {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #333;
}

.watch-popup .watch-link a {
    color: #4cc9f0;
    text-decoration: none;
}

.watch-popup .watch-link a:hover {
    text-decoration: underline;
}

/* mPING Dropdown Styles */
.mping-dropdown {
    min-width: 200px;
}

.mping-toggle {
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.mping-min-input {
    width: 60px;
    padding: 4px 8px;
    background: #0f3460;
    border: 1px solid #4cc9f0;
    color: #eee;
    border-radius: 4px;
}

.mping-load-btn {
    width: 100%;
    padding: 6px 12px;
    background: #4cc9f0;
    color: #1a1a2e;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.mping-load-btn:hover {
    background: #3ab8df;
}

.mping-status {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 8px;
    text-align: center;
}

/* mPING Marker Styles */
.mping-icon {
    background: transparent !important;
    border: none !important;
}

.mping-icon svg {
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5));
}

.mping-text-icon {
    background: transparent !important;
    border: none !important;
}

.mping-text-icon svg {
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.8));
}

.mping-shape-icon {
    background: transparent !important;
    border: none !important;
}

.mping-shape-icon svg {
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.6));
}

/* mPING Tooltip Styles */
.mping-tooltip {
    background: rgba(22, 33, 62, 0.95) !important;
    border: 1px solid #00bfff !important;
    border-radius: 6px !important;
    color: #eee !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    max-width: 250px !important;
}

.mping-tooltip::before {
    border-top-color: #00bfff !important;
}

.mping-tooltip-content .mping-coords {
    color: #aaa;
    font-size: 11px;
    margin-bottom: 4px;
}

.mping-tooltip-content .mping-type {
    font-weight: bold;
    color: #00bfff;
}

/* Readout Dropdown Styles */
.readout-dropdown {
    min-width: 180px;
}

.readout-toggle {
    padding: 10px 12px;
}

/* Readout Popup Styles */
.readout-popup {
    position: fixed;
    background: rgba(22, 33, 62, 0.95);
    border: 1px solid #4cc9f0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: #eee;
    z-index: 10000;
    pointer-events: none;
    min-width: 140px;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: none;
}

.readout-popup.visible {
    display: block;
}

.readout-popup-header {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #2a3f5f;
}

.readout-popup-coords {
    font-family: monospace;
    color: #4cc9f0;
}

.readout-panel-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    gap: 12px;
}

.readout-panel-label {
    color: #aaa;
    font-size: 11px;
    white-space: nowrap;
}

.readout-panel-data {
    font-family: monospace;
    font-weight: bold;
    text-align: right;
}

.readout-panel-data.cv {
    color: #f39c12;
}

.readout-panel-data.nexrad {
    color: #7bed9f;
}

.readout-panel-data.no-data {
    color: #666;
    font-weight: normal;
}

/* Crosshair Icon Styles */
.crosshair-icon {
    background: transparent;
    border: none;
    pointer-events: none;
}

.crosshair-icon svg {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
}

.control-row input[type="file"] {
    flex: 1;
    min-width: 150px;
}

#cogFolderPath {
    flex: 1;
    min-width: 250px;
}

.control-row select,
.control-row input[type="text"],
.control-row input[type="date"],
.control-row input[type="time"] {
    padding: 8px 12px;
    background: #0f3460;
    border: 1px solid #4cc9f0;
    color: #eee;
    border-radius: 4px;
    font-size: 0.9rem;
}

.control-row button {
    padding: 8px 16px;
    background: #4cc9f0;
    color: #1a1a2e;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.control-row button:hover {
    background: #7bed9f;
}

.control-row button:disabled {
    background: #555;
    cursor: not-allowed;
}

.control-row label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #aaa;
}

.control-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.control-row input[type="range"] {
    width: 100px;
}

.hint {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.maps-container {
    display: flex;
    gap: 10px;
    flex: 1;
    min-height: 400px;
}

.maps-container.four-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
}

.map-panel.hidden {
    display: none !important;
}

.map-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #16213e;
    border-radius: 8px;
    overflow: hidden;
    min-height: 0;
}

/* Panel Header Styles */
.panel-header {
    background: #0f3460;
    padding: 8px 10px;
    flex-shrink: 0;
}

.panel-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.panel-label {
    color: #4cc9f0;
    font-weight: bold;
    font-size: 0.9rem;
}

.panel-type-select {
    padding: 4px 8px;
    background: #16213e;
    border: 1px solid #4cc9f0;
    color: #4cc9f0;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
}

.moment-select {
    padding: 4px 6px;
    background: #16213e;
    border: 1px solid #7bed9f;
    color: #7bed9f;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
}

.moment-select.hidden {
    display: none;
}

.panel-info {
    flex: 1;
    color: #888;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel-config {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.panel-config.hidden {
    display: none;
}

.folder-input {
    flex: 1;
    padding: 4px 8px;
    background: #16213e;
    border: 1px solid #4cc9f0;
    color: #eee;
    border-radius: 3px;
    font-size: 0.8rem;
}

.folder-input::placeholder {
    color: #666;
}

.load-btn {
    padding: 4px 10px;
    background: #4cc9f0;
    color: #1a1a2e;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
}

.load-btn:hover {
    background: #7bed9f;
}

.clip-btn {
    padding: 2px 6px;
    background: transparent;
    color: #f39c12;
    border: 1px solid #f39c12;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: normal;
    transition: all 0.2s;
    margin-left: 6px;
    line-height: 1;
}

.clip-btn:hover {
    background: rgba(243, 156, 18, 0.2);
}

.clip-btn.active {
    background: #f39c12;
    color: #1a1a2e;
}

.clip-btn.hidden {
    display: none;
}

.download-btn {
    padding: 2px 8px;
    background: transparent;
    color: #7bed9f;
    border: 1px solid #7bed9f;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: normal;
    transition: all 0.2s;
    margin-left: 6px;
}

.download-btn:hover {
    background: #7bed9f;
    color: #1a1a2e;
}

.download-btn.hidden {
    display: none;
}

.panel-header .progress-container {
    margin-top: 6px;
}

.panel-header .progress-bar {
    height: 4px;
}

.map {
    flex: 1;
    min-height: 200px;
}

.map-panel {
    position: relative;
}

.panel-colorbar {
    position: absolute;
    bottom: 30px;
    right: 10px;
    background: rgba(22, 33, 62, 0.85);
    border-radius: 4px;
    padding: 4px;
    z-index: 1000;
    display: none;
}

.panel-timestamp {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 33, 62, 0.85);
    color: #4cc9f0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    z-index: 1000;
    white-space: nowrap;
}


/* Radar markers */
.radar-marker {
    background: transparent;
}

.radar-square {
    width: 10px;
    height: 10px;
    background: white;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s;
}

.radar-square:hover {
    background: #4cc9f0;
    transform: scale(1.2);
}

.radar-square.selected {
    background: #7bed9f;
    border-color: #2ed573;
    width: 12px;
    height: 12px;
}

/* CV Radar markers (distinguished from NEXRAD with different color) */
.cv-radar-marker {
    background: transparent;
}

.cv-radar-square {
    width: 10px;
    height: 10px;
    background: #f39c12;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s;
}

.cv-radar-square:hover {
    background: #f1c40f;
    transform: scale(1.2);
}

.cv-radar-square.selected {
    background: #e74c3c;
    border-color: #c0392b;
    width: 12px;
    height: 12px;
}

/* CV Variable select styling */
.cv-variable-select {
    border-color: #f39c12;
    color: #f39c12;
}

/* Leaflet customization */
.leaflet-container {
    background: #0f3460;
}

.leaflet-control-zoom a {
    background: #16213e !important;
    color: #4cc9f0 !important;
    border-color: #4cc9f0 !important;
}

.leaflet-control-attribution {
    background: rgba(22, 33, 62, 0.8) !important;
    color: #888 !important;
}

.leaflet-control-attribution a {
    color: #4cc9f0 !important;
}

/* Loading spinner */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #4cc9f0;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Frame Slider Styling */
#frameSlider {
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #0f3460;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#frameSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #4cc9f0;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(76, 201, 240, 0.5);
}

#frameSlider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #4cc9f0;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(76, 201, 240, 0.5);
}

.loop-btn {
    background: #0f3460;
    border: 1px solid #4cc9f0;
    color: #4cc9f0;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.loop-btn:hover {
    background: #4cc9f0;
    color: #1a1a2e;
}

.loop-btn.hidden {
    display: none;
}

.fps-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
    font-size: 0.85rem;
    color: #aaa;
}

.fps-control input {
    width: 50px;
    background: #0f3460;
    border: 1px solid #4cc9f0;
    color: #4cc9f0;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    text-align: center;
}

.fps-control input:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(76, 201, 240, 0.5);
}

/* Progress Bar */
.progress-container {
    margin-top: 10px;
    width: 100%;
}

.progress-container.hidden {
    display: none;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 5px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #0f3460;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4cc9f0, #7bed9f);
    border-radius: 4px;
    transition: width 0.15s ease-out;
}

/* Main content layout with side panel */
.main-content {
    display: flex;
    flex: 1;
    gap: 10px;
    min-height: 0;
}

/* Time Selection Side Panel */
.time-selector-panel {
    width: 220px;
    min-width: 220px;
    background: #16213e;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.time-selector-header {
    padding: 10px 12px;
    background: #0f3460;
    border-bottom: 1px solid #2a3f5f;
}

.time-selector-header h3 {
    color: #4cc9f0;
    font-size: 0.9rem;
    margin: 0 0 4px 0;
}

.time-selector-header .file-count {
    color: #7bed9f;
    font-size: 0.75rem;
}

.time-selector-hint {
    padding: 6px 12px;
    background: #0f3460;
    color: #666;
    font-size: 0.7rem;
    font-style: italic;
    border-bottom: 1px solid #2a3f5f;
}

.time-selector-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    min-height: 0;
}

.time-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.time-item {
    padding: 6px 8px;
    background: #0f3460;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #ccc;
    transition: all 0.15s;
    user-select: none;
}

.time-item:hover {
    background: #1a4a7a;
}

.time-item.selected {
    background: #4cc9f0;
    color: #1a1a2e;
}

.time-item .time-display {
    font-family: monospace;
    font-weight: bold;
    display: block;
}

.time-item .file-name {
    font-size: 0.65rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    margin-top: 2px;
}

.time-item.selected .file-name {
    color: #0f3460;
}

.time-selector-footer {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 8px 10px;
    border-top: 1px solid #2a3f5f;
    background: #0f3460;
    flex-wrap: wrap;
}

.time-btn {
    padding: 5px 10px;
    background: #16213e;
    border: 1px solid #4cc9f0;
    color: #4cc9f0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.time-btn:hover {
    background: #4cc9f0;
    color: #1a1a2e;
}

.time-btn.primary {
    background: #4cc9f0;
    color: #1a1a2e;
    font-weight: bold;
}

.time-btn.primary:hover {
    background: #7bed9f;
}

.time-btn.primary:disabled,
.time-btn:disabled {
    background: #333;
    border-color: #555;
    color: #666;
    cursor: not-allowed;
}

.selected-count {
    color: #7bed9f;
    font-size: 0.75rem;
    flex: 1;
    text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
    .maps-container {
        flex-direction: column;
    }

    .map-panel {
        min-height: 300px;
    }

    .info-panel {
        flex-direction: column;
    }

    .loop-controls {
        flex-wrap: wrap;
    }
}

/* =====================
   Compare Feature Styles
   ===================== */

/* Compare Dropdown */
.compare-dropdown {
    min-width: 240px;
}

.compare-toggle {
    padding: 10px 12px;
    border-bottom: 1px solid #2a3f5f;
}

.compare-settings {
    padding: 10px 12px;
    display: none;
}

.compare-settings.visible {
    display: block;
}

.compare-select {
    padding: 6px 8px;
    background: #0f3460;
    border: 1px solid #4cc9f0;
    color: #eee;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
    margin-top: 4px;
}

.compare-select:focus {
    outline: none;
    border-color: #7bed9f;
}

.height-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.height-filter-row span {
    font-size: 0.8rem;
    color: #aaa;
}

.height-input {
    width: 55px;
    padding: 5px 6px;
    background: #0f3460;
    border: 1px solid #4cc9f0;
    color: #eee;
    border-radius: 4px;
    font-size: 0.8rem;
    text-align: center;
}

.height-input:focus {
    outline: none;
    border-color: #7bed9f;
}

.compare-generate-btn {
    width: 100%;
    padding: 10px 12px;
    background: #4cc9f0;
    border: none;
    color: #1a1a2e;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    margin-top: 8px;
}

.compare-generate-btn:hover {
    background: #7bed9f;
}

.compare-generate-btn:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
}

.compare-status {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #888;
    min-height: 1.2em;
}

/* Scatterplot Popup */
.scatterplot-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(22, 33, 62, 0.98);
    border: 2px solid #4cc9f0;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
    min-width: 450px;
}

.scatterplot-popup.visible {
    display: block;
}

.scatterplot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #0f3460;
    border-bottom: 1px solid #4cc9f0;
    border-radius: 6px 6px 0 0;
    cursor: move;
}

.scatterplot-title {
    color: #4cc9f0;
    font-weight: 600;
    font-size: 0.95rem;
}

.scatterplot-close-btn {
    background: transparent;
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.scatterplot-close-btn:hover {
    background: #ff6b6b;
    color: #1a1a2e;
}

.scatterplot-content {
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #1a1a2e;
}

#scatterplotCanvas {
    background: #16213e;
    border: 1px solid #2a3f5f;
    border-radius: 4px;
}

.scatterplot-footer {
    padding: 10px 16px;
    background: #0f3460;
    border-top: 1px solid #2a3f5f;
    border-radius: 0 0 6px 6px;
}

#scatterplotStats {
    font-size: 0.8rem;
    color: #7bed9f;
}

/* Draggable state */
.scatterplot-popup.dragging {
    cursor: move;
    user-select: none;
}

/* Legal Modal Styles */
.legal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
}

.legal-modal.hidden {
    display: none !important;
}

.legal-modal-content {
    background-color: #2c3e50;
    border-radius: 8px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.legal-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #34495e;
}

.legal-modal-header h2 {
    color: #3498db;
    font-size: 24px;
    margin: 0;
}

.legal-close-btn {
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.legal-close-btn:hover {
    color: #e74c3c;
}

.legal-modal-body {
    padding: 25px;
    overflow-y: auto;
    color: #ecf0f1;
}

.legal-section {
    margin-bottom: 30px;
}

.legal-section h3 {
    color: #3498db;
    font-size: 18px;
    margin-bottom: 12px;
    border-bottom: 1px solid #34495e;
    padding-bottom: 8px;
}

.legal-section p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.legal-section ul {
    margin-left: 25px;
    margin-bottom: 10px;
}

.legal-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.legal-section a {
    color: #3498db;
    text-decoration: none;
}

.legal-section a:hover {
    text-decoration: underline;
}

.legal-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #34495e;
    text-align: center;
    color: #95a5a6;
    font-size: 14px;
}
