/* Cosmic Universe Scene Styles */

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

body {
    font-family: 'Arial', sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    cursor: none;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #001122 0%, #000000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 1s ease-out;
}

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

.loader {
    text-align: center;
}

.cosmic-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: cosmic-spin 2s linear infinite;
    margin: 0 auto 20px;
}

@keyframes cosmic-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    animation: cosmic-pulse 2s ease-in-out infinite;
}

@keyframes cosmic-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Main Scene Container */
#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #001122 0%, #000000 70%);
}

/* Audio Controls */
#audio-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
}

#audio-toggle {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#audio-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(255, 255, 255, 0.1);
}

#audio-toggle:active {
    transform: scale(0.95);
}

#audio-toggle.muted {
    background: rgba(255, 100, 100, 0.2);
    border-color: rgba(255, 100, 100, 0.3);
}

#audio-toggle.muted:hover {
    background: rgba(255, 100, 100, 0.3);
}

/* Credits Controls */
#credits-controls {
    position: fixed;
    bottom: 30px;
    right: 110px; /* Position next to audio controls */
    z-index: 100;
}

#credits-button {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: rgba(79, 195, 247, 0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(79, 195, 247, 0.3);
}

#credits-button:hover {
    background: rgba(79, 195, 247, 0.2);
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(79, 195, 247, 0.2);
    border-color: rgba(79, 195, 247, 0.5);
}

#credits-button:active {
    transform: scale(0.95);
}

#credits-button:focus {
    outline: 2px solid #4fc3f7;
    outline-offset: 4px;
}

/* Info Panel with Logo */
#info-panel {
    position: fixed;
    top: 30px;
    left: 30px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    z-index: 100;
    transition: opacity 0.3s ease;
    max-width: 250px;
}

#info-panel:hover {
    opacity: 0.5;
}

/* Logo Placeholder */
#logo-placeholder {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#site-logo {
    max-width: 150px;
    max-height: 60px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    transition: all 0.3s ease;
}

#site-logo:hover {
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.5));
    transform: scale(1.05);
}

/* Fallback for missing logo */
#logo-placeholder::before {
    content: "🌌 SHAWN RADAM";
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #4fc3f7;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
    margin-bottom: 10px;
}

#site-logo + #logo-placeholder::before {
    display: none;
}

#info-panel p {
    margin: 0 0 8px 0;
    line-height: 1.4;
}

#fps-counter {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Custom Cursor */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: difference;
    transition: transform 0.1s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    #audio-controls {
        bottom: 20px;
        right: 20px;
    }
    
    #credits-controls {
        bottom: 20px;
        right: 90px;
    }
    
    #audio-toggle,
    #credits-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    #info-panel {
        top: 20px;
        left: 20px;
        padding: 10px 15px;
        font-size: 12px;
        max-width: 200px;
    }
    
    #site-logo {
        max-width: 120px;
        max-height: 50px;
    }
    
    #logo-placeholder::before {
        font-size: 14px;
    }
    
    body {
        cursor: auto;
    }
    
    body::after {
        display: none;
    }
}

@media (max-width: 480px) {
    #credits-controls {
        bottom: 90px; /* Stack vertically on very small screens */
        right: 20px;
    }
    
    #info-panel {
        top: 15px;
        left: 15px;
        padding: 8px 12px;
        font-size: 11px;
        max-width: 180px;
    }
    
    #site-logo {
        max-width: 100px;
        max-height: 40px;
    }
    
    #logo-placeholder::before {
        font-size: 12px;
        letter-spacing: 1px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .cosmic-spinner {
        animation: none;
    }
    
    .loader p {
        animation: none;
        opacity: 1;
    }
    
    #audio-toggle,
    #credits-button {
        transition: none;
    }
    
    #site-logo:hover {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    #audio-toggle,
    #credits-button {
        background: #000;
        border: 2px solid #fff;
        color: #fff;
    }
    
    #info-panel {
        background: #000;
        border: 1px solid #fff;
    }
    
    #site-logo {
        filter: contrast(150%) brightness(120%);
    }
}

/* Focus States for Accessibility */
#audio-toggle:focus,
#credits-button:focus {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* Animation Classes for JavaScript */
.fade-in {
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.scale-in {
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from { 
        transform: scale(0);
        opacity: 0;
    }
    to { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Star Twinkling Effect (for fallback) */
.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Shooting Star Effect (for fallback) */
.shooting-star {
    position: absolute;
    background: linear-gradient(45deg, #fff 0%, transparent 70%);
    border-radius: 2px;
    animation: shoot 2s ease-out;
}

@keyframes shoot {
    0% {
        transform: translateX(-100px) translateY(100px);
        opacity: 1;
    }
    100% {
        transform: translateX(200px) translateY(-200px);
        opacity: 0;
    }
}