/**
 * Three.js Graphics Styles for S.A.R.S. Website
 */

/* Home section background canvas - now very subtle */
.three-home-bg {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 1;
    pointer-events: none;
    opacity: 0.15; /* Much more discrete */
}

/* Ensure home section content is above the canvas */
#home .content,
#home h1,
#home p,
#home .buttons {
    position: relative;
    z-index: 10;
}

/* Music visualizer container */
.music-visualizer-3d {
    position: relative;
    width: 100%;
    height: 300px;
    margin: 20px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.music-visualizer-3d canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.music-visualizer-3d::before {
    content: "🎵 3D Music Visualizer";
    position: absolute;
    top: 10px;
    left: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    z-index: 5;
    pointer-events: none;
}

/* Enhanced 3D Album carousel */
.album-carousel-3d {
    position: relative;
    width: 100%;
    height: 500px; /* Increased height */
    margin: 40px 0;
    cursor: grab;
    border-radius: 20px;
    overflow: hidden;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.15) 0%, rgba(0, 212, 255, 0.05) 50%, transparent 70%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.album-carousel-3d:hover {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 212, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.album-carousel-3d:active {
    cursor: grabbing;
}

.album-carousel-3d.enhanced {
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.15) 0%, rgba(0, 212, 255, 0.05) 50%, transparent 70%);
}

.album-carousel-3d canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border-radius: 20px;
}

/* Remove the old ::before overlay since we're adding it dynamically */
.album-carousel-3d::before {
    display: none;
}

/* Loading states */
.three-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

.three-loading::before {
    content: "⚡";
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Performance optimization for mobile */
@media (max-width: 768px) {
    .music-visualizer-3d {
        height: 200px;
    }
    
    .album-carousel-3d {
        height: 300px;
    }
    
    .three-home-bg {
        opacity: 0.5; /* Reduce opacity on mobile for better text readability */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .music-visualizer-3d,
    .album-carousel-3d {
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .three-home-bg,
    .music-visualizer-3d canvas,
    .album-carousel-3d canvas {
        animation: none;
    }
}

/* Focus styles for accessibility */
.album-carousel-3d:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

/* Error state */
.three-error {
    background: rgba(255, 45, 146, 0.1);
    border: 1px solid rgba(255, 45, 146, 0.3);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 20px;
    border-radius: 10px;
}

.three-error::before {
    content: "⚠️ ";
}

/* WebGL not supported fallback */
.no-webgl .music-visualizer-3d,
.no-webgl .album-carousel-3d,
.no-webgl .three-home-bg {
    display: none;
}

.no-webgl-message {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 14px;
}
/* Hide original 2D carousel when 3D carousel is active */
#discography .carousel {
    display: none;
}

/* Optional: Show 2D carousel on mobile if 3D is too heavy */
@media (max-width: 768px) {
    /* Uncomment these lines if you want to show 2D on mobile instead of 3D */
    /* #discography .carousel { display: block; } */
    /* .album-carousel-3d { display: none; } */
}
