/* CSS Variables */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --accent: #f56565;
    --success: #48bb78;
    --warning: #ed8936;
    --spiritual: #9f7aea;
    --tech: #4299e1;
    --business: #38b2ac;
    --dark: #1a202c;
    --light: #f7fafc;
    --space-bg: #0a0a1a;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Poppins', sans-serif;
    height: 100%;
    overflow: hidden;
    background: var(--space-bg);
    color: white;
}

body {
    position: relative;
}

/* Loading Screen */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--space-bg) 0%, #1a0a2c 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.loader {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
}

.loader::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.loader-planet {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

#load-status {
    margin-top: 20px;
    color: var(--light);
    font-size: 1.1rem;
}

.progress-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
}

/* Control Panels */
.control-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 20px;
    z-index: 9999;
    position: fixed;
}

#mode-selector {
    top: 20px;
    left: 20px;
    max-width: 200px;
}

#mode-selector h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: white;
    font-size: 1rem;
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.mode-btn.active {
    background: var(--primary);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* VR Toggle */
#vr-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.vr-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.vr-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* Navigation Controls */
#nav-controls {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
}

.nav-btn:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.nav-btn i {
    font-size: 1.2rem;
}

.nav-btn span {
    font-size: 0.8rem;
}

/* Progress Indicator */
#progress-indicator {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    padding: 15px;
}

.progress-dots {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.progress-item {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.progress-item:hover {
    background: var(--primary);
    transform: scale(1.3);
}

.progress-item.active {
    background: var(--primary);
    box-shadow: 0 0 20px var(--primary);
}

.progress-item.completed {
    background: var(--success);
}

.progress-item::after {
    content: attr(title);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.progress-item:hover::after {
    opacity: 1;
}

/* Info Panel */
#info-panel {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    max-width: 350px;
    min-width: 300px;
    transition: opacity 0.3s ease;
}

#info-panel.hidden {
    opacity: 0;
    pointer-events: none;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close-btn:hover {
    opacity: 1;
}

#info-title {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

#info-content {
    line-height: 1.6;
    color: var(--light);
}

/* Instructions */
#instructions {
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
}

.instruction-icons {
    display: flex;
    gap: 30px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.instruction-icons span {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Performance Monitor */
#perf-monitor {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #4CAF50;
    padding: 8px 15px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    z-index: 9996;
    display: flex;
    gap: 15px;
}

#perf-monitor.hidden {
    display: none;
}

/* Compatibility Warning */
#compatibility-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

#compatibility-warning.hidden {
    display: none;
}

.warning-content {
    background: rgba(255, 87, 87, 0.9);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    backdrop-filter: blur(10px);
}

.warning-content i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: white;
}

.warning-content h3 {
    margin-bottom: 15px;
    color: white;
}

.warning-content p {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
}

.warning-content button {
    background: white;
    color: #ff5757;
    border: none;
    padding: 10px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.warning-content button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    #nav-controls {
        bottom: 10px;
    }
    
    #mode-selector {
        max-width: 180px;
    }
    
    .instruction-icons {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #nav-controls {
        width: 90%;
    }
    
    #mode-selector {
        top: 10px;
        left: 10px;
    }
    
    #vr-toggle {
        top: 10px;
        right: 10px;
    }
    
    .vr-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    #progress-indicator {
        right: 10px;
        padding: 10px;
    }
    
    #info-panel {
        right: 10px;
        max-width: 300px;
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    .nav-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-btn {
        flex-direction: row;
        justify-content: flex-start;
        min-width: 200px;
    }
    
    #mode-selector {
        max-width: 150px;
    }
    
    .mode-btn {
        padding: 10px;
        font-size: 0.8rem;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}