/* Studio Emme Academy - Form Loader Styles */

/* Cross-browser compatibility */
.studioemme-loader-overlay,
.studioemme-loader-container,
.studioemme-loader-bar {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Overlay principale */
.studioemme-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 22, 43, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* Safari */
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    -webkit-transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    -moz-transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.studioemme-loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Container del loader */
.studioemme-loader-container {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.98) 100%);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 380px;
    width: 90%;
    animation: studioemmeLoaderSlideIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 2px solid #e91e63;
}

.studioemme-loader-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #e91e63, #ff4081, #e91e63);
    animation: studioemmeGradient 3s ease infinite;
}

/* Maschera teatrale */
.studioemme-theater-mask {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: studioemmeMaskFloat 2.5s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(233, 30, 99, 0.5));
    color: #e91e63;
}

/* Testi */
.studioemme-loader-text {
    color: #1a1a1a;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
}

.studioemme-loader-subtext {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

/* Barra di progresso */
.studioemme-loader-progress {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 1.5rem 0;
    position: relative;
}

.studioemme-loader-bar {
    height: 100%;
    background: linear-gradient(90deg, #e91e63, #ff4081, #e91e63);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    animation: studioemmeGradient 2s ease infinite;
}

.studioemme-loader-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: studioemmeShimmer 1.5s ease infinite;
}

/* Stili specifici per il form contatti */
.studioemme-loader-overlay.contact-form-active .studioemme-loader-text {
    color: #e91e63;
    font-weight: 700;
}

.studioemme-loader-overlay.contact-form-active .studioemme-loader-bar {
    background: linear-gradient(90deg, #e91e63, #ff6b9d, #e91e63);
}

/* Cross-browser compatibility fixes */
.studioemme-loader-overlay {
    /* IE11 fallback */
    background: rgb(15, 22, 43);
    background: rgba(15, 22, 43, 0.95);
    
    /* Edge 12+ fallback */
    @supports not (backdrop-filter: blur(8px)) {
        background: rgba(15, 22, 43, 0.98);
    }
}

/* Fallback for browsers without CSS Grid */
.studioemme-loader-container {
    display: block;
    text-align: center;
}

/* Ensure proper z-index stacking */
.studioemme-loader-overlay {
    z-index: 999999;
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .studioemme-loader-overlay {
        position: -webkit-sticky;
        position: sticky;
    }
}

/* Animazioni */
@keyframes studioemmeLoaderSlideIn {
    from {
        transform: translateY(30px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes studioemmeMaskFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg) scale(1); 
    }
    25% { 
        transform: translateY(-8px) rotate(-3deg) scale(1.05); 
    }
    75% { 
        transform: translateY(-4px) rotate(3deg) scale(1.02); 
    }
}

@keyframes studioemmeGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes studioemmeShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Responsive */
@media (max-width: 768px) {
    .studioemme-loader-container {
        padding: 2rem;
        margin: 1rem;
        border-radius: 20px;
    }
    
    .studioemme-theater-mask {
        font-size: 3rem;
    }
    
    .studioemme-loader-text {
        font-size: 1rem;
    }
}

/* Accessibilità - riduzione movimento */
@media (prefers-reduced-motion: reduce) {
    .studioemme-loader-overlay {
        transition: opacity 0.3s ease;
    }
    
    .studioemme-loader-container {
        animation: none;
    }
    
    .studioemme-theater-mask {
        animation: none;
    }
    
    .studioemme-loader-bar {
        animation: none;
        transition: width 0.5s ease;
    }
}