/* ============================================
   3D Solar System Simulator - Styles
   ============================================ */

/* CSS Variables */
:root {
    --bg-dark: #0a0a1a;
    --bg-panel: rgba(15, 15, 35, 0.9);
    --border-glow: rgba(100, 150, 255, 0.3);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-blue: #4a9eff;
    --accent-purple: #a855f7;
    --accent-gradient: linear-gradient(135deg, #4a9eff 0%, #a855f7 100%);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Loading Screen */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

#loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading p {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Main Container */
#container {
    width: 100%;
    height: 100%;
}

/* Title */
#title {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
    pointer-events: none;
}

#title h1 {
    font-size: 28px;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(74, 158, 255, 0.3);
    margin-bottom: 8px;
}

#title p {
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

/* Control Panel */
#controls {
    position: fixed;
    top: 30px;
    left: 30px;
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    padding: 20px;
    z-index: 100;
    min-width: 200px;
}

.control-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

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

.control-group input[type="range"] {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    margin: 0 10px;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.control-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

#speed-value {
    font-size: 12px;
    color: var(--accent-blue);
    min-width: 35px;
    text-align: right;
}

#reset-camera {
    width: 100%;
    padding: 10px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#reset-camera:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(74, 158, 255, 0.4);
}

/* Planet Info Panel */
#planet-info {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    padding: 25px;
    z-index: 100;
    width: 280px;
    transition: opacity 0.3s, transform 0.3s;
}

#planet-info.hidden {
    opacity: 0;
    transform: translateY(-50%) translateX(20px);
    pointer-events: none;
}

#close-info {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
}

#close-info:hover {
    background: rgba(255, 255, 255, 0.2);
}

#planet-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent);
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.3);
}

#planet-name {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.detail-row .value {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

#planet-description {
    margin-top: 15px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Planet Navigation */
#planet-nav {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: 50px;
    padding: 12px 20px;
    z-index: 100;
}

#planet-nav button {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#planet-nav button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-blue);
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.4);
}

#planet-nav button.active {
    background: var(--accent-gradient);
    border-color: transparent;
}

/* Responsive */
@media (max-width: 768px) {
    #title h1 {
        font-size: 20px;
    }
    
    #title p {
        font-size: 11px;
    }
    
    #controls {
        top: auto;
        bottom: 100px;
        left: 15px;
        padding: 15px;
        min-width: 160px;
    }
    
    #planet-info {
        right: 15px;
        width: 250px;
        padding: 20px;
    }
    
    #planet-nav {
        bottom: 15px;
        padding: 8px 15px;
    }
    
    #planet-nav button {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* Planet Labels (3D) */
.planet-label {
    position: absolute;
    color: white;
    font-size: 12px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    pointer-events: none;
    white-space: nowrap;
    transform: translate(-50%, -100%);
    margin-top: -15px;
}

/* Glow Effect Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(74, 158, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(74, 158, 255, 0.6);
    }
}

.glow {
    animation: glow 2s ease-in-out infinite;
}
