/* ========================================
   Spirit & Soul - Main Stylesheet
   ======================================== */

/* CSS Variables */
:root {
    /* Colors */
    --primary-gradient: linear-gradient(to bottom, #8B00FF, #4B0082); /* Vertikal von oben nach unten */
    --button-color: #8B00FF;
    --button-hover: #a020f0;
    --text-light: #ffffff;
    --text-dark: #333333;
    
    /* Overlay (set dynamically from config) */
    --overlay-color: #505050;
    --overlay-opacity: 0.5;
    --fade-duration: 1s;
    
    /* Player Colors */
    --player-bg: rgba(30, 30, 40, 0.85);
    --player-text: #ffffff;
    --progress-bg: rgba(255, 255, 255, 0.2);
    --progress-fill: #8B00FF;
    
    /* Spacing */
    --player-bottom-spacing: 40px;
    --logo-top-spacing: 10vh;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-light);
}

body {
    position: relative;
    background: #000000; /* Schwarzer Hintergrund verhindert weißen Flash */
}

/* Background Layer */
.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    background: #000000; /* Schwarzer Hintergrund als Basis */
}

.bg-element {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity var(--fade-duration) ease-in-out;
    z-index: 1; /* BEIDE Elemente auf gleichem z-index! */
    background: transparent;
}

.bg-element.active {
    opacity: 1;
    /* KEIN z-index Wechsel - beide Elemente bleiben auf z-index: 1 */
}

.bg-element img,
.bg-element video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: var(--overlay-opacity);
    transition: opacity 0.5s ease;
}

.overlay.color-overlay {
    background-color: var(--overlay-color);
}

.overlay.image-overlay {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a0033, #330066);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

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

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(139, 0, 255, 0.2);
    border-top-color: #8B00FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 20px;
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 2px;
}

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

/* Fullscreen Play Button (for autoplay fallback) */
.fullscreen-play {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.fullscreen-play.hidden {
    opacity: 0;
    pointer-events: none;
}

.fullscreen-play-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 40px rgba(139, 0, 255, 0.4);
}

.fullscreen-play-button:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(139, 0, 255, 0.6);
}

.fullscreen-play-text {
    margin-top: 30px;
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 3px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --player-bottom-spacing: 30px;
    }
}

@media (max-width: 768px) {
    :root {
        --player-bottom-spacing: 20px;
        --logo-top-spacing: 8vh;
    }
    
    .fullscreen-play-button {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
    
    .fullscreen-play-text {
        font-size: 1.2rem;
    }
}
