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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to bottom, #000428, #004e92);
    color: #e0e0e0;
    overflow: hidden;
}

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

header {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 30px;
    border-bottom: 2px solid #1e88e5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    flex: 1;
}

header h1 {
    font-size: 28px;
    color: #64b5f6;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    color: #90caf9;
    font-style: italic;
}

.toggle-btn {
    background: linear-gradient(to bottom, #1e88e5, #1565c0);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.toggle-btn:hover {
    background: linear-gradient(to bottom, #2196f3, #1e88e5);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hide UI state */
.ui-hidden .header-content,
.ui-hidden .control-panel {
    display: none;
}

.ui-hidden header {
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: none;
}

.ui-hidden .toggle-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.canvas-container {
    flex: 1;
    position: relative;
    background: radial-gradient(circle at center, #001a33, #000000);
    overflow: hidden;
}

#solarSystem {
    width: 100%;
    height: 100%;
    display: block;
}

.control-panel {
    width: 320px;
    background: rgba(0, 0, 0, 0.85);
    border-left: 2px solid #1e88e5;
    overflow-y: auto;
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
}

.control-panel h2 {
    color: #64b5f6;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1e88e5;
}

.info-panel,
.controls,
.equations-panel {
    margin-bottom: 25px;
}

.info-item {
    margin: 10px 0;
    font-size: 13px;
}

.info-item strong {
    color: #90caf9;
    display: inline-block;
    min-width: 120px;
}

.info-item span {
    color: #e0e0e0;
}

.control-group {
    margin: 15px 0;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    color: #90caf9;
    font-size: 14px;
}

.control-group input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

.control-group input[type="checkbox"] {
    margin-right: 8px;
}

.control-group span {
    display: inline-block;
    margin-left: 10px;
    color: #e0e0e0;
    font-size: 13px;
}

.btn {
    background: linear-gradient(to bottom, #1e88e5, #1565c0);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.btn:hover {
    background: linear-gradient(to bottom, #2196f3, #1e88e5);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.equation {
    margin: 15px 0;
    padding: 12px;
    background: rgba(30, 136, 229, 0.1);
    border-left: 3px solid #1e88e5;
    border-radius: 3px;
}

.equation strong {
    color: #64b5f6;
    display: block;
    margin-bottom: 8px;
}

.math {
    font-family: 'Courier New', monospace;
    color: #90caf9;
    font-size: 14px;
    margin: 8px 0;
    padding: 5px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.eq-desc {
    font-size: 12px;
    color: #b0bec5;
    font-style: italic;
    margin-top: 5px;
}

.keyboard-help {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #1e88e5;
}

.keyboard-help h2 {
    color: #64b5f6;
    font-size: 18px;
    margin-bottom: 15px;
}

.shortcut {
    margin: 8px 0;
    font-size: 13px;
    color: #e0e0e0;
}

.shortcut strong {
    color: #90caf9;
    display: inline-block;
    min-width: 60px;
}

/* Scrollbar styling */
.control-panel::-webkit-scrollbar {
    width: 8px;
}

.control-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.control-panel::-webkit-scrollbar-thumb {
    background: #1e88e5;
    border-radius: 4px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: #2196f3;
}

/* Planet selection highlight */
#planetInfo {
    margin-top: 10px;
    padding: 10px;
    background: rgba(30, 136, 229, 0.1);
    border-radius: 5px;
}

/* Touch device optimizations */
.control-panel button,
.toggle-btn {
    min-height: 44px;
    min-width: 44px;
}

/* Mobile help - show only on mobile */
.mobile-help {
    display: none;
}

@media (max-width: 768px) {
    .mobile-help {
        display: block;
    }
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    header {
        padding: 12px 15px;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    .subtitle {
        font-size: 11px;
    }
    
    .toggle-btn {
        font-size: 24px;
        padding: 8px 12px;
    }
    
    .main-content {
        flex-direction: column;
    }

    .control-panel {
        width: 100%;
        max-height: 40vh;
        border-left: none;
        border-top: 2px solid #1e88e5;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .control-group {
        padding: 12px;
    }
    
    .control-group h3 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .control-group label {
        font-size: 13px;
    }
    
    /* Larger touch targets */
    .control-panel button {
        padding: 12px 20px;
        font-size: 15px;
        min-height: 48px;
    }
    
    .control-panel input[type="range"] {
        height: 40px;
        cursor: pointer;
    }
    
    .control-panel input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
    
    /* Stack controls vertically on very small screens */
    .controls {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    /* Info panel adjustments */
    .info-panel,
    .planet-info {
        padding: 12px;
    }
    
    .info-item {
        font-size: 13px;
        margin: 8px 0;
    }
    
    /* Equations panel - collapsible on mobile */
    .equations {
        max-height: 200px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .equations h3 {
        font-size: 14px;
    }
    
    .equation-item {
        font-size: 12px;
        padding: 8px;
    }
    
    /* Keyboard shortcuts - hide on mobile */
    .keyboard-help {
        display: none;
    }
    
    /* Canvas adjustments */
    .canvas-container {
        height: 60vh;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        flex-direction: row;
    }
    
    .control-panel {
        width: 300px;
        max-height: 100%;
        border-top: none;
        border-left: 2px solid #1e88e5;
    }
    
    .canvas-container {
        height: 100%;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .control-panel {
        width: 320px;
    }
    
    header h1 {
        font-size: 24px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    header h1 {
        font-size: 16px;
    }
    
    .subtitle {
        display: none;
    }
    
    .control-panel {
        max-height: 35vh;
        font-size: 12px;
    }
    
    .canvas-container {
        height: 65vh;
    }
    
    /* Make control panel collapsible indicator */
    .control-panel::before {
        content: '⬇ Swipe to view controls ⬇';
        display: block;
        text-align: center;
        padding: 8px;
        background: rgba(30, 136, 229, 0.3);
        font-size: 11px;
        color: #90caf9;
    }
}
