/* Enhanced Timeline Component Styles */
.timeline-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
}

/* Timeline Header */
.timeline-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.timeline-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.timeline-info {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 14px;
}

.timeline-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.data-source {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.domain {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.frame-counter, .timestamp {
    color: #e0e0e0;
    font-size: 13px;
}

/* Timeline Controls */
.timeline-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.timeline-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.timeline-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Timeline Minimize Button - Match Weather Panel Style */
.timeline-minimize-btn {
    background: #ff4757;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    margin-left: 8px;
}

.timeline-minimize-btn:hover {
    background: #ff3742;
    transform: scale(1.1);
}

/* Timeline Minimized State - EXACT Copy of Weather Layer Minimized State */
.timeline-container.minimized {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid #4a90e2;
    backdrop-filter: blur(5px);
    font-weight: 600;
    cursor: pointer;
    width: auto;
    max-width: none;
    transform: none;
    left: auto;
    right: 20px;
    bottom: 20px;
    z-index: 10000;
    transition: all 0.3s ease;
}

.timeline-container.minimized:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.02);
}

.timeline-minimized-btn {
    /* Copy exact h3.control-title inheritance */
    font-size: 18px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    color: white;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    /* Copy any h3 defaults that might affect appearance */
    display: block;
    font-style: normal;
    text-transform: none;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 40px;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-color: #4facfe;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.control-btn i {
    font-size: 14px;
}

#speed-btn {
    min-width: 50px;
    font-weight: 600;
}

/* Timeline Slider Container */
.timeline-slider-container {
    position: relative;
    margin-bottom: 16px;
}

.timeline-ticks {
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 16px;
    pointer-events: none;
}

.timeline-tick {
    position: absolute;
    width: 2px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    transform: translateX(-50%);
    border-radius: 1px;
    transition: all 0.2s ease;
}

.timeline-tick.no-data {
    background: rgba(255, 0, 0, 0.6);
    height: 12px;
}

.timeline-tick.live {
    background: #4facfe;
    height: 12px;
    box-shadow: 0 0 8px rgba(79, 172, 254, 0.6);
}

.timeline-tick.forecast {
    background: #ff6b6b;
    height: 10px;
}

.timeline-slider {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    position: relative;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
    border: 2px solid white;
    transition: all 0.2s ease;
}

.timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(79, 172, 254, 0.6);
}

.timeline-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
    border: 2px solid white;
    transition: all 0.2s ease;
}

.timeline-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(79, 172, 254, 0.6);
}

.timeline-slider::-webkit-slider-track {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    border-radius: 3px;
    height: 6px;
}

.timeline-slider::-moz-range-track {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    border-radius: 3px;
    height: 6px;
    border: none;
}

/* Timeline Labels */
.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.label-past, .label-future {
    font-weight: 500;
}

.label-now {
    color: #4facfe;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(79, 172, 254, 0.6);
}

/* Timeline Footer */
.timeline-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.timeline-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.timeline-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.timeline-gaps {
    color: #ff6b6b;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.timeline-gaps i {
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline-container {
        width: 95%;
        padding: 12px;
        bottom: 10px;
    }
    
    .timeline-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .timeline-info {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .timeline-controls {
        justify-content: center;
    }
    
    .control-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .timeline-stats {
        flex-direction: column;
        gap: 4px;
    }
    
    .timeline-footer {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .timeline-container {
        width: 98%;
        padding: 10px;
    }
    
    .timeline-info {
        font-size: 12px;
    }
    
    .data-source, .domain {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .control-btn {
        padding: 5px 8px;
        font-size: 10px;
        min-width: 35px;
    }
    
    .timeline-slider::-webkit-slider-thumb {
        width: 16px;
        height: 16px;
    }
    
    .timeline-slider::-moz-range-thumb {
        width: 16px;
        height: 16px;
    }
}

/* Animation Classes */
.timeline-container {
    animation: slideUp 0.3s ease-out;
}

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

.control-btn {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading States */
.timeline-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.timeline-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Focus States for Accessibility */
.control-btn:focus {
    outline: 2px solid #4facfe;
    outline-offset: 2px;
}

.timeline-slider:focus {
    outline: 2px solid #4facfe;
    outline-offset: 2px;
    border-radius: 5px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .timeline-container {
        background: rgba(0, 0, 0, 0.95);
        border: 2px solid white;
    }
    
    .control-btn {
        border: 2px solid white;
    }
    
    .timeline-slider::-webkit-slider-thumb {
        border: 3px solid white;
    }
} 

/* Timeline Component Styles */
.timeline-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 26, 26, 0.95);
    border-radius: 12px;
    padding: 15px;
    min-width: 600px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

/* Timeline Header */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    position: relative;
}

/* Timeline Title (similar to control-title in index.html) */
.timeline-title {
    margin: 0;
    padding-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    position: relative;
    width: 100%;
    text-align: left;
}

.timeline-controls {
    display: flex;
    gap: 8px;
}

.timeline-btn {
    background: rgba(60, 60, 60, 0.8);
    border: 1px solid rgba(100, 100, 100, 0.3);
    color: #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.timeline-btn:hover {
    background: rgba(80, 80, 80, 0.9);
    border-color: rgba(120, 120, 120, 0.5);
}

/* Timeline Body */
.timeline-body {
    position: relative;
    margin-bottom: 10px;
}

.timeline-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(100, 100, 100, 0.3);
    outline: none;
    cursor: pointer;
    border-radius: 2px;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #4a90e2;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-slider::-webkit-slider-thumb:hover {
    background: #5ba0f2;
    transform: scale(1.2);
}

.timeline-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4a90e2;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-ticks {
    position: relative;
    height: 20px;
    margin-top: 5px;
}

/* Timeline Footer */
.timeline-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #aaa;
    font-size: 12px;
}

#timeline-timestamp {
    font-family: monospace;
}

#frame-counter {
    font-family: monospace;
}

/* Mesoscale Submenu Styles */
.submenu {
    background: rgba(40, 40, 40, 0.95);
    border-radius: 8px;
    padding: 10px;
    margin-top: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.mesoscale-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.mesoscale-btn {
    background: rgba(60, 60, 60, 0.8);
    border: 1px solid rgba(100, 100, 100, 0.3);
    color: #ddd;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    text-align: center;
    min-width: 100px;
}

.mesoscale-btn:hover {
    background: rgba(80, 80, 80, 0.9);
    border-color: rgba(120, 120, 120, 0.5);
    transform: translateY(-1px);
}

.mesoscale-btn.active {
    background: rgba(76, 175, 80, 0.8);
    border-color: rgba(76, 175, 80, 0.5);
    color: white;
    font-weight: 500;
}

.mesoscale-btn.updating {
    opacity: 0.6;
    cursor: wait;
    animation: pulse 1.5s infinite;
}

.mesoscale-btn small {
    display: block;
    font-size: 11px;
    opacity: 0.8;
    margin-top: 2px;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* Timeline Header Layout */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid #333;
}

.timeline-info {
    display: flex;
    align-items: center;
}

.timeline-title {
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-controls .frame-counter,
.timeline-controls .timestamp {
    color: #ccc;
    font-size: 12px;
    margin-right: 10px;
}

/* Timeline Minimized State */
.timeline-container.minimized {
    padding: 8px 12px;
    max-width: 120px;
    backdrop-filter: none;
}

.timeline-minimized-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.2s ease;
}

.timeline-minimized-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.timeline-minimized-btn {
    background: none;
    border: none;
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.timeline-minimized-btn:hover {
    color: #4fc3f7;
    transform: scale(1.05);
}