/* Tropical Dashboard - Dark Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f1419;
    color: #e8eaed;
    overflow: hidden;
}

.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: #1a1d21;
    border-bottom: 1px solid #3c4043;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #8ab4f8;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.back-button:hover {
    background: rgba(138, 180, 248, 0.1);
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e8eaed;
    margin-bottom: 0.25rem;
}

.header-text p {
    font-size: 0.875rem;
    color: #9aa0a6;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.storm-dropdown {
    background: #2d3136;
    border: 1px solid #3c4043;
    color: #e8eaed;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    min-width: 200px;
}

.time-display {
    background: #2d3136;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #9aa0a6;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Left Sidebar */
.left-sidebar {
    width: 280px;
    background: #1a1d21;
    border-right: 1px solid #3c4043;
    padding: 1.5rem;
    overflow-y: auto;
}

.control-group {
    margin-bottom: 2rem;
}

.control-group h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e8eaed;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-toggle, .cyclogenesis-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.model-toggle input, .cyclogenesis-toggle input {
    width: 16px;
    height: 16px;
    accent-color: #8ab4f8;
}

.toggle-label {
    font-size: 0.875rem;
    color: #e8eaed;
    cursor: pointer;
}

/* Legend Popup Styling */
.legend-popup {
    background: rgba(26, 29, 33, 0.95);
    border: 1px solid #3c4043;
    border-radius: 8px;
    padding: 1rem;
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.legend-header h3 {
    margin: 0;
    color: #e8eaed;
    font-size: 1rem;
}

.legend-toggle-btn {
    background: none;
    border: none;
    color: #e8eaed;
    cursor: pointer;
    font-size: 0.875rem;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.legend-item.selected {
    background: rgba(138, 180, 248, 0.1);
    border: 1px solid #8ab4f8;
}

.legend-icon {
    width: 24px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.storm-markers-icon {
    display: flex;
    gap: 2px;
}

.storm-icon {
    width: 6px;
    height: 6px;
    background: #8ab4f8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4px;
    color: white;
    font-weight: bold;
}

.ensemble-markers-icon {
    width: 8px;
    height: 8px;
    background: #8ab4f8;
    border-radius: 50%;
}

.tracks-icon {
    width: 24px;
    height: 2px;
    background: #e8eaed;
    border-radius: 1px;
}

.ensemble-tracks-icon {
    width: 24px;
    height: 8px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ensemble-tracks-icon::before,
.ensemble-tracks-icon::after {
    content: '';
    height: 2px;
    background: #8ab4f8;
    border-radius: 1px;
}

.cones-icon {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 12px solid #8ab4f8;
    transform: rotate(-15deg);
}

.wind-colors-icon {
    width: 24px;
    height: 4px;
    background: linear-gradient(to right, #ff0000, #ff8c00, #ffff00, #00ff00, #00ffff, #8000ff);
    border-radius: 2px;
}

.legend-text {
    flex: 1;
    font-size: 0.875rem;
    color: #e8eaed;
}

.legend-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #8ab4f8;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    background: #0f1419;
}

#tropicalMap {
    height: 100%;
    width: 100%;
}

/* Time Navigation */
.time-navigation {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    background: rgba(26, 29, 33, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid #3c4043;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.time-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.time-control.init-time {
    background: #2d3136;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #3c4043;
}

.time-control.lead-time {
    background: #2d3136;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #3c4043;
    position: relative;
}

.lead-time-display {
    position: absolute;
    top: -1.5rem;
    left: 0;
    font-size: 0.875rem;
    color: #9aa0a6;
    background: rgba(26, 29, 33, 0.9);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.time-control label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #9aa0a6;
    min-width: 80px;
}

.time-display {
    background: transparent;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #e8eaed;
    flex: 1;
}

.time-nav-btn, .calendar-btn, .play-pause-btn, .refresh-btn {
    background: #3c4043;
    border: 1px solid #5f6368;
    color: #e8eaed;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-nav-btn:hover, .calendar-btn:hover, .play-pause-btn:hover, .refresh-btn:hover {
    background: #5f6368;
}

.time-slider {
    flex: 1;
    height: 6px;
    background: #3c4043;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #8ab4f8;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.time-slider::-webkit-slider-track {
    background: #8ab4f8;
    border-radius: 3px;
    height: 6px;
}

/* Right Panel */
.right-panel {
    width: 320px;
    background: #1a1d21;
    border-left: 1px solid #3c4043;
    padding: 1.5rem;
    overflow-y: auto;
}

.storm-details, .ensemble-stats, .ai-predictions {
    background: #2d3136;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.storm-details h3, .ensemble-stats h3, .ai-predictions h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #e8eaed;
    margin-bottom: 1rem;
}

.no-storm-selected {
    text-align: center;
    color: #9aa0a6;
}

.no-storm-selected h3 {
    margin-bottom: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: #9aa0a6;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #8ab4f8;
}

.ai-metrics {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #1a1d21;
    border-radius: 8px;
}

.metric-label {
    font-size: 0.875rem;
    color: #9aa0a6;
}

.metric-value {
    font-size: 1rem;
    font-weight: 600;
    color: #8ab4f8;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 25, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #3c4043;
    border-top: 3px solid #8ab4f8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: #9aa0a6;
    font-size: 0.875rem;
}

/* Map Customization */
.leaflet-container {
    background: #0f1419 !important;
}

.leaflet-control-zoom {
    background: #2d3136 !important;
    border: 1px solid #3c4043 !important;
}

.leaflet-control-zoom a {
    background: #2d3136 !important;
    border: 1px solid #3c4043 !important;
    color: #e8eaed !important;
}

.leaflet-control-zoom a:hover {
    background: #3c4043 !important;
}

.leaflet-control-attribution {
    background: rgba(26, 29, 33, 0.8) !important;
    color: #9aa0a6 !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .left-sidebar {
        width: 240px;
    }
    
    .right-panel {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .left-sidebar, .right-panel {
        width: 100%;
        height: auto;
    }
    
    .map-container {
        height: 60vh;
    }
}
