/* Intro Frame-Based Container */
#intro-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #000;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 1s ease-out;
}

#intro-container.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Canvas per i frame */
#intro-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Video (mantenuto per retrocompatibilità) */
#intro-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    opacity: 1;
    transition: opacity 0.5s ease;
    z-index: 10001;
}

.scroll-indicator.hide {
    opacity: 0;
}

.scroll-text {
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.scroll-icon {
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 25px;
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 10px;
}

.scroll-icon::before {
    content: '';
    width: 4px;
    height: 10px;
    background: #fff;
    border-radius: 2px;
    animation: scroll-down 2s infinite;
}

@keyframes scroll-down {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Progress Bar */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 10001;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #f4e4a6);
    width: 0%;
    transition: width 0.1s linear;
}

/* Main Content - Initially Hidden */
body.intro-active {
    overflow: hidden;
}

body.intro-active #main-content {
    opacity: 0;
    transform: scale(0.95);
}

#main-content {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

#main-content.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    overflow: visible;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .scroll-text {
        font-size: 12px;
    }
    
    .scroll-icon {
        width: 25px;
        height: 45px;
    }
    
    .scroll-indicator {
        bottom: 30px;
    }
}

/* Preloader per il video */
.video-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10001;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader-text {
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 2px;
}

.loader-percent {
    color: #d4af37;
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 1px;
}
