/* Animazioni per il caricamento delle pagine */

/* Preloader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Previeni scroll durante il caricamento */
.no-scroll {
    overflow: hidden;
}

/* Nascondi inizialmente tutti gli elementi animati */
.page-element {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.page-element.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Nascondi inizialmente le sezioni principali */
.hero-section,
.innovation-section,
#main-header,
footer {
    opacity: 0;
}

.loader-content {
    text-align: center;
    color: #c9c9c9;
}

.loader-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 2vh;
    animation: logoFloat 2s ease-in-out infinite;
}

.loader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.loader-text {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1vh;
    animation: textPulse 1.5s ease-in-out infinite;
}

.loader-bar {
    width: 200px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.loader-progress {
    height: 100%;
    background: linear-gradient(90deg, #494949, #666565);
    border-radius: 2px;
    animation: progressBar 2s ease-in-out infinite;
}

/* Animazioni del loader */
@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes textPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes progressBar {
    0% { width: 0%; transform: translateX(-100%); }
    50% { width: 100%; transform: translateX(0%); }
    100% { width: 100%; transform: translateX(100%); }
}

/* Animazioni per gli elementi della pagina */
.page-element {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.page-element.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Animazioni specifiche per diversi elementi */
.hero-section {
    animation: slideInUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.innovation-section {
    animation: slideInUp 0.8s ease forwards;
    animation-delay: 0.4s;
}

.features-section {
    animation: slideInUp 0.8s ease forwards;
    animation-delay: 0.6s;
}

.cta-section {
    animation: slideInUp 0.8s ease forwards;
    animation-delay: 0.8s;
}

.innovation-card {
    animation: cardSlideIn 0.6s ease forwards;
}

.innovation-card:nth-child(1) { animation-delay: 0.6s; }
.innovation-card:nth-child(2) { animation-delay: 0.8s; }
.innovation-card:nth-child(3) { animation-delay: 1.0s; }

/* Header animation */
#main-header {
    animation: slideInDown 0.6s ease forwards;
    animation-delay: 0.1s;
}

/* Footer animation */
footer {
    animation: slideInUp 0.6s ease forwards;
    animation-delay: 1.2s;
}

/* Nascondi inizialmente le nuove sezioni */
.features-section,
.cta-section {
    opacity: 0;
}

/* Keyframes per le animazioni */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Effetto hover per le carte - mantiene il blur originale */
.innovation-card {
    transition: all 0.3s ease;
}

.innovation-card:hover {
    transform: translateY(-5px);
    /* Rimuovo scale e box-shadow per mantenere il blur originale */
}

/* Animazioni per i pulsanti */
.common_btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.common_btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.common_btn:hover::before {
    left: 100%;
}

.common_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Animazioni per la navigazione */
.nav-btn {
    transition: all 0.3s ease;
    position: relative;
}

.nav-btn::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #494949, #666565);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-btn:hover::after {
    width: 100%;
}

.nav-btn:hover {
    color: #fff !important;
    transform: translateY(-1px) !important;
}

/* Animazioni responsive */
@media (max-width: 768px) {
    .hero-section,
    .innovation-section {
        animation-duration: 0.6s;
    }
    
    .innovation-card {
        animation-duration: 0.5s;
    }
    
    .page-element {
        transform: translateY(20px);
    }
}

/* Classe per disabilitare le animazioni se necessario */
.no-animations * {
    animation: none !important;
    transition: none !important;
}

/* Animazione di entrata per gli elementi quando scrolli */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Animazioni per i form */
.form-group {
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.5s ease forwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }
.form-group:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animazione per il logo */
.header-logo {
    opacity: 0;
    animation: logoEntrance 1s ease forwards;
    animation-delay: 0.3s;
}

@keyframes logoEntrance {
    0% {
        opacity: 0;
        transform: scale(0.8) rotate(-10deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}
