/* Helium Solar System Simulator - Modern Space Theme */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --sun-glow: #fbbf24;
    --mercury: #9ca3af;
    --venus: #fbbf24;
    --earth: #3b82f6;
    --mars: #ef4444;
    --jupiter: #d97706;
    --saturn: #f59e0b;
    --uranus: #06b6d4;
    --neptune: #3b82f6;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

#app {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Canvas Layers */
canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#starfield {
    z-index: 0;
}

#solar-system {
    z-index: 1;
    cursor: grab;
}

#solar-system:active {
    cursor: grabbing;
}

/* UI Overlay */
.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.ui-overlay > * {
    pointer-events: auto;
}

/* Header */
.app-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(to bottom, rgba(10, 10, 15, 0.9), transparent);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 10px;
    box-shadow: 0 0 20px var(--accent-glow);
}

.logo h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo .accent {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-controls {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* Planet Panel */
.planet-panel {
    position: absolute;
    top: 80px;
    right: 30px;
    width: 320px;
    background: rgba(18, 18, 26, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 24px;
    transform: translateX(0);
    transition: var(--transition);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.planet-panel.hidden {
    transform: translateX(400px);
    opacity: 0;
    pointer-events: none;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--text-primary);
}

.planet-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.planet-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--earth), #1e40af);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

.planet-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.planet-header span {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.planet-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.planet-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Bottom Controls */
.bottom-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    padding: 20px 30px;
    background: rgba(18, 18, 26, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Speed Control */
.speed-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.speed-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.speed-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

#speed-slider {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
}

#speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

#speed-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px var(--accent-glow);
}

#speed-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-primary);
    min-width: 35px;
}

/* Zoom Control */
.zoom-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.zoom-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

#zoom-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

/* View Buttons */
.view-buttons {
    display: flex;
    gap: 8px;
}

.view-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.view-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.view-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Toggle Controls */
.toggle-controls {
    display: flex;
    gap: 8px;
}

.toggle-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.toggle-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.toggle-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Planet Selector */
.planet-selector {
    position: absolute;
    bottom: 30px;
    left: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 200px;
}

.planet-thumb {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.planet-thumb:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.planet-thumb.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Scale Indicator */
.scale-indicator {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.scale-bar {
    width: 100px;
    height: 2px;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    border-radius: 1px;
}

.scale-text {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.solar-loader {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
}

.sun-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #fbbf24, #f59e0b);
    border-radius: 50%;
    box-shadow: 0 0 40px #fbbf24;
    animation: pulse 2s ease-in-out infinite;
}

.orbit-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

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

.loading-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    margin-bottom: 8px;
}

.loading-content p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    margin-bottom: 30px;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

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

.help-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.help-item h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.help-item p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .bottom-controls {
        flex-wrap: wrap;
        max-width: 90%;
        gap: 20px;
    }
    
    .planet-panel {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 15px 20px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .bottom-controls {
        bottom: 20px;
        padding: 15px 20px;
        gap: 15px;
    }
    
    .control-group {
        flex: 1;
        min-width: 120px;
    }
    
    .planet-selector {
        left: 20px;
        bottom: 140px;
    }
    
    .planet-panel {
        top: auto;
        bottom: 140px;
        right: 20px;
        left: 20px;
        width: auto;
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .help-grid {
        grid-template-columns: 1fr;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Planet Color Classes */
.planet-sun { background: radial-gradient(circle, #fbbf24, #f59e0b) !important; }
.planet-mercury { background: radial-gradient(circle, #9ca3af, #6b7280) !important; }
.planet-venus { background: radial-gradient(circle, #fbbf24, #d97706) !important; }
.planet-earth { background: radial-gradient(circle, #3b82f6, #1e40af) !important; }
.planet-mars { background: radial-gradient(circle, #ef4444, #b91c1c) !important; }
.planet-jupiter { background: radial-gradient(circle, #d97706, #92400e) !important; }
.planet-saturn { background: radial-gradient(circle, #f59e0b, #d97706) !important; }
.planet-uranus { background: radial-gradient(circle, #06b6d4, #0891b2) !important; }
.planet-neptune { background: radial-gradient(circle, #3b82f6, #1d4ed8) !important; }