* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #000;
    --panel-bg: rgba(10, 15, 25, 0.85);
    --text-primary: rgba(200, 210, 220, 0.9);
    --text-dim: rgba(150, 160, 170, 0.6);
    --text-bright: rgba(255, 255, 255, 1);
    --accent: rgba(100, 150, 255, 0.8);
    --accent-dim: rgba(100, 150, 255, 0.4);
    --border-dim: rgba(100, 120, 150, 0.2);
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    cursor: grab;
}

body:active {
    cursor: grabbing;
}

#solar-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Timeline */
#timeline-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
    background: var(--panel-bg);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    padding: 15px 20px;
    z-index: 10;
}

#timeline-date {
    text-align: center;
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: var(--text-bright);
}

#timeline-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: rgba(50, 70, 100, 0.5);
    border-radius: 3px;
    outline: none;
}

#timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent);
}

#timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 5px;
}

#timeline-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

#timeline-controls button,
#timeline-controls select {
    background: rgba(50, 70, 100, 0.5);
    border: 1px solid var(--border-dim);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

#timeline-controls button:hover,
#timeline-controls select:hover {
    background: rgba(100, 150, 255, 0.3);
    border-color: var(--accent-dim);
}

#play-pause.playing,
#play-reverse.playing {
    background: rgba(100, 200, 150, 0.3);
}

/* Navigation controls */
#nav-controls {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

#nav-controls button {
    width: 40px;
    height: 40px;
    background: var(--panel-bg);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

#nav-controls button:hover {
    background: rgba(100, 150, 255, 0.2);
    border-color: var(--accent-dim);
    transform: scale(1.1);
}

#nav-controls button.active {
    background: rgba(100, 150, 255, 0.3);
    border-color: var(--accent);
}

/* Scale indicator */
#scale-indicator {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--panel-bg);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    padding: 12px 16px;
    z-index: 10;
}

#scale-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-bright);
    margin-bottom: 4px;
}

#distance-label {
    font-size: 11px;
    color: var(--text-dim);
}

/* Info panel */
#info-panel {
    position: fixed;
    top: 20px;
    right: 80px;
    width: 300px;
    max-height: 60vh;
    background: var(--panel-bg);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    padding: 20px;
    z-index: 20;
    overflow-y: auto;
}

#info-panel.hidden {
    display: none;
}

#info-panel h2 {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 12px;
    color: var(--accent);
}

#info-content {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

#info-content p {
    margin-bottom: 10px;
}

#info-content .stat {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-dim);
}

#info-content .stat-label {
    color: var(--text-dim);
}

#info-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
}

#info-close:hover {
    color: var(--text-bright);
}

/* Events panel */
#events-panel {
    position: fixed;
    left: 20px;
    top: 100px;
    width: 220px;
    max-height: 50vh;
    background: var(--panel-bg);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    padding: 15px;
    z-index: 10;
    overflow-y: auto;
}

#events-panel h3 {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.event-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-dim);
    cursor: pointer;
    transition: all 0.2s;
}

.event-item:hover {
    background: rgba(100, 150, 255, 0.1);
    margin: 0 -10px;
    padding-left: 10px;
    padding-right: 10px;
}

.event-item:last-child {
    border-bottom: none;
}

.event-date {
    font-size: 10px;
    color: var(--accent);
    margin-bottom: 2px;
}

.event-title {
    font-size: 12px;
    color: var(--text-primary);
}

.event-item.past {
    opacity: 0.5;
}

.event-item.current {
    background: rgba(100, 200, 150, 0.15);
    border-left: 2px solid rgba(100, 200, 150, 0.8);
    margin-left: -2px;
}

/* Hover tooltip */
#hover-tooltip {
    position: fixed;
    pointer-events: none;
    background: var(--panel-bg);
    border: 1px solid var(--accent-dim);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-bright);
    z-index: 100;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#hover-tooltip.hidden {
    display: none;
}

#hover-tooltip .tooltip-title {
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 4px;
}

#hover-tooltip .tooltip-detail {
    color: var(--text-dim);
    font-size: 11px;
}

/* Back link */
#back-link {
    position: fixed;
    bottom: 120px;
    left: 20px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 12px;
    padding: 8px 12px;
    background: var(--panel-bg);
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    z-index: 10;
    transition: all 0.2s;
}

#back-link:hover {
    color: var(--text-bright);
    border-color: var(--accent-dim);
}

/* Responsive */
@media (max-width: 768px) {
    #timeline-container {
        width: 95%;
        padding: 10px 15px;
    }

    #events-panel {
        display: none;
    }

    #info-panel {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }

    #nav-controls {
        right: 10px;
    }

    #nav-controls button {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}
