/* Reset e base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Nota: ho mantenuto l'URL di esempio, assicurati di cambiarlo con una tua immagine! */
    background: url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2000&q=80') center/cover no-repeat;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 0 20px;
}

.logo-container {
    margin-bottom: 3rem;
}

.logo {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #fff, #f8f9fa);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.tagline {
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 0;
}

.hero-text h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.4);
}

/* Category Sections */
.category-section {
    padding: 6rem 0;
    position: relative;
}

.category-section.alt-bg {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.category-title {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    position: relative;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 2px;
}

.category-description {
    text-align: center;
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.example-container {
    margin-bottom: 4rem;
}

.example-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
    color: #495057;
}

.examples-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-top: 4rem;
}

/* Image Comparison Styles */
.comparison-container {
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    border-radius: 20px;
    overflow: hidden;
    background: white;
    animation: fadeInUp 0.8s ease; /* Mantenuta la regola di animazione qui */
}

.image-comparison {
    position: relative;
    width: 100%;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.comparison-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3/2; /* Mantiene la proporzione */
    overflow: hidden;
}

/* REGOLA FONDAMENTALE CORRETTA PER ENTRAMBE LE IMMAGINI */
.before-image, 
.after-image {
    display: block;
    object-fit: cover;
    object-position: center center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* Larghezza corretta (100% del contenitore) */
    height: 100%; /* Altezza corretta (100% del contenitore) */
}

.before-image {
    z-index: 1;
}

.after-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%; /* La larghezza iniziale dello slider */
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

/* Slider Styles */
.slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    cursor: col-resize;
    z-index: 3;
    transform: translateX(-50%);
    transition: all 0.1s ease;
    will-change: left; /* Ottimizzazione mantenuta */
}

.slider:hover {
    background: #667eea;
    width: 6px;
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
}

.slider-line {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 100vh;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.slider-button {
    position: relative;
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    cursor: col-resize;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.slider-button:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.slider-button svg {
    width: 16px;
    height: 16px;
    transition: color 0.3s ease;
}

/* Footer */
.footer-section {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.footer-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1.2rem;
    }
    
    .hero-text h2 {
        font-size: 2rem;
    }
    
    .hero-text p {
        font-size: 1.1rem;
    }
    
    .category-title {
        font-size: 2.5rem;
    }
    
    .category-description {
        font-size: 1.1rem;
    }
    
    .example-title {
        font-size: 1.5rem;
    }
    
    .comparison-container {
        margin: 0 10px;
        border-radius: 15px;
    }
    
    .slider-button {
        width: 40px;
        height: 40px;
        padding: 0 6px;
    }
    
    .slider-button svg {
        width: 14px;
        height: 14px;
    }
    
    .category-section {
        padding: 4rem 0;
    }
    
    .footer-content h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .hero-text h2 {
        font-size: 1.8rem;
    }
    
    .hero-text p {
        font-size: 1rem;
    }
    
    .category-title {
        font-size: 2rem;
    }
    
    .cta-button {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .slider-button {
        width: 36px;
        height: 36px;
        padding: 0 5px;
    }
    
    .slider-button svg {
        width: 12px;
        height: 12px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Performance optimizations (restanti) */
.before-image {
    will-change: auto;
}

.after-image {
    will-change: auto;
}

/* Dark mode support preparation */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    /* Future dark mode styles can be added here */
}