/* Forecast Timeline Slider Styles - Neo-Tactile Design */
.forecast-timeline {
    padding: 40px 16px 16px 16px;
    position: relative;
    display: block;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    z-index: 10;
}

.forecast-timeline.collapsed {
    padding: 0;
    height: 0;
    opacity: 0;
    margin: 0;
    border: none;
    transform: translateY(-10px);
}

[data-theme="light"] .forecast-timeline {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Timeline Title */
.timeline-title {
    position: absolute;
    top: 12px;
    left: 16px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 5;
}

[data-theme="light"] .timeline-title {
    color: rgba(0, 0, 0, 0.6);
}

/* Toggle Button for Slider */
.timeline-toggle-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    background: rgba(33, 150, 243, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(33, 150, 243, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.timeline-toggle-btn:hover {
    background: rgba(33, 150, 243, 0.25);
    border-color: rgba(33, 150, 243, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

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

.timeline-toggle-btn svg {
    width: 16px;
    height: 16px;
    stroke: #2196F3;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-toggle-btn.collapsed svg {
    transform: rotate(180deg);
}

[data-theme="light"] .timeline-toggle-btn {
    background: rgba(33, 150, 243, 0.1);
    border-color: rgba(33, 150, 243, 0.2);
}

[data-theme="light"] .timeline-toggle-btn:hover {
    background: rgba(33, 150, 243, 0.2);
    border-color: rgba(33, 150, 243, 0.4);
}

.timeline-header {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.timeline-time-display {
    text-align: center;
}

.timeline-time {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    line-height: 1.2;
    font-family: 'Courier New', monospace;
}

.timeline-date {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.timeline-time-display.forecast .timeline-time {
    color: #00aaff;
}

.timeline-time-display.forecast .timeline-date {
    color: #00aaff;
}

/* Precision Alignment Fixes */
.timeline-track-container {
    position: relative;
    padding: 0 15px;
    /* Match label center: 30px/2 = 15px */
    margin-bottom: 15px;
}

.timeline-track {
    position: relative;
    height: 12px;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2) 0%, rgba(33, 150, 243, 0.35) 100%);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(33, 150, 243, 0.25);
    margin-bottom: 8px;
}

.timeline-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        to right,
        transparent 0%,
        transparent calc(8.333% - 1px),
        rgba(255, 255, 255, 0.15) calc(8.333% - 1px),
        rgba(255, 255, 255, 0.15) 8.333%
    );
}

[data-theme="light"] .timeline-track {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15) 0%, rgba(33, 150, 243, 0.25) 100%);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(255, 255, 255, 0.8);
    border-color: rgba(33, 150, 243, 0.35);
}

[data-theme="light"] .timeline-track::before {
    background: repeating-linear-gradient(
        to right,
        transparent 0%,
        transparent calc(8.333% - 1px),
        rgba(0, 0, 0, 0.08) calc(8.333% - 1px),
        rgba(0, 0, 0, 0.08) 8.333%
    );
}

/* Remove last tick overflow if needed or mask it */

.timeline-now-marker {
    position: absolute;
    left: 0;
    top: -5px;
    width: 2px;
    height: 18px;
    background: #ff0000;
    z-index: 2;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    display: none;
    /* Hide for now as thumb is enough indicator */
}

.timeline-slider {
    width: calc(100% - 8px);
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    position: relative;
    display: block;
    margin: 0 4px 12px 4px;
    cursor: pointer;
    outline: none;
    z-index: 100;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff, #e3f2fd, #2196F3);
    box-shadow: 
        0 0 0 3px rgba(33, 150, 243, 0.3),
        0 0 0 6px rgba(33, 150, 243, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 
        0 0 0 4px rgba(33, 150, 243, 0.4),
        0 0 0 8px rgba(33, 150, 243, 0.2),
        0 6px 16px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(33, 150, 243, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.timeline-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
    box-shadow: 
        0 0 0 3px rgba(33, 150, 243, 0.5),
        0 0 0 6px rgba(33, 150, 243, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.timeline-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff, #e3f2fd, #2196F3);
    box-shadow: 
        0 0 0 3px rgba(33, 150, 243, 0.3),
        0 0 0 6px rgba(33, 150, 243, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
    cursor: grab;
    border: 2px solid rgba(255, 255, 255, 0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 
        0 0 0 4px rgba(33, 150, 243, 0.4),
        0 0 0 8px rgba(33, 150, 243, 0.2),
        0 6px 16px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(33, 150, 243, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.timeline-slider::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
    box-shadow: 
        0 0 0 3px rgba(33, 150, 243, 0.5),
        0 0 0 6px rgba(33, 150, 243, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #888;
    margin-top: 5px;
    padding: 0;
    /* Removing padding, controlled by span width */
    user-select: none;
    width: 100%;
}

.timeline-labels span {
    width: 30px;
    display: flex;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Add small tick above label */
.timeline-labels span::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
}

.timeline-labels span:hover {
    color: #2196F3;
    transform: translateY(-2px) scale(1.1);
    text-shadow: 0 0 8px rgba(33, 150, 243, 0.5);
}

[data-theme="light"] .timeline-labels span:hover {
    color: #1976D2;
    text-shadow: 0 0 8px rgba(25, 118, 210, 0.3);
}

.timeline-labels span:hover::before {
    background: #2196F3;
    height: 6px;
    top: -10px;
    box-shadow: 0 0 6px rgba(33, 150, 243, 0.6);
}

[data-theme="light"] .timeline-labels span:hover::before {
    background: #1976D2;
    box-shadow: 0 0 6px rgba(25, 118, 210, 0.4);
}

.timeline-labels span.now {
    color: #ff5252;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 82, 82, 0.4);
}

[data-theme="light"] .timeline-labels span.now {
    color: #d32f2f;
    text-shadow: 0 0 8px rgba(211, 47, 47, 0.3);
}

.timeline-labels span.active {
    color: #2196F3;
    font-weight: 700;
    transform: scale(1.15);
    text-shadow: 0 0 10px rgba(33, 150, 243, 0.6);
}

[data-theme="light"] .timeline-labels span.active {
    color: #1976D2;
    text-shadow: 0 0 10px rgba(25, 118, 210, 0.4);
}

.forecast-timeline.visible {
    display: block;
}

/* Light mode adjustments */
body.light-mode .forecast-timeline {
    border-top-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .timeline-labels {
    color: #666;
}

body.light-mode .timeline-labels span.now {
    color: #cc0000;
}

body.light-mode .timeline-labels span.active {
    color: #0066cc;
}