/* ASCITUR - Custom Styles */

/* Animazioni personalizzate */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Smooth scroll offset per navbar fisso */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 120px;
}

/* Navbar scrolled state */
.navbar-scrolled {
    transition: all 0.3s ease;
}

.navbar-scrolled nav {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Active link nella navbar */
nav a.active-link {
    color: #059669 !important;
    position: relative;
}

nav a.active-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: #059669;
    border-radius: 2px;
}

nav a {
    position: relative;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #059669;
}

/* Effetti hover personalizzati */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Gradient text */
.gradient-text {
    background:linear-gradient(135deg,#C58B00,#8A5E00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animazione bounce per la freccia */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    50% {
        transform: translateY(-10px) translateX(-50%);
    }
}

/* Pulsante con effetto ripple */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:hover::after {
    width: 300px;
    height: 300px;
}

/* Scroll to top button animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card hover effects migliorati */
.card {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.15);
}

/* Effetto parallax leggero per le sezioni */
section {
    position: relative;
    z-index: 1;
}

/* Loading skeleton solo per immagini lazy non ancora caricate */
img[loading="lazy"]:not(.loaded) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

img.loaded {
    animation: none;
    background: none;
}

/* Miglioramenti per dispositivi mobili */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.75rem;
    }

    nav a.active-link::after {
        bottom: -2px;
    }

    /* Navbar: riduce padding orizzontale su mobile */
    #navbar .max-w-7xl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Hero: riduce padding superiore così il testo non si nasconde sotto la navbar */
    #home {
        padding-top: 6rem;
        padding-bottom: 3rem;
    }

    /* Hero title: evita che fuoriesca */
    #home h1 {
        font-size: 2.25rem !important;
        line-height: 1.15;
    }

    /* Hero card destra: meno padding su mobile */
    #home .glass.rounded-3xl {
        padding: 1.5rem;
    }

    /* Services cards: meno padding interno */
    #services .p-8 {
        padding: 1.5rem;
    }

    /* Collaboration dark card: meno padding */
    #collaboration .p-8.rounded-3xl.bg-slate-900 {
        padding: 1.5rem;
    }

    /* Contact CTA: pulsante email va a capo correttamente */
    #contact .mt-10 a {
        font-size: 0.8rem;
        padding: 0.875rem 1.25rem;
        word-break: break-all;
    }

    /* Footer: colonne impilate su mobile */
    footer .grid {
        grid-template-columns: 1fr !important;
    }

    /* Footer brand occupa tutta la larghezza */
    footer .md\\:col-span-2 {
        grid-column: span 1 !important;
    }
}

/* Fix overflow su schermi molto stretti */
@media (max-width: 480px) {
    /* Navbar: riduce altezza e logo */
    #navbar nav .h-20 {
        height: 4rem;
    }

    #navbar nav img.h-16 {
        height: 2.75rem;
    }

    /* Hero: paragrafo descrittivo più leggibile */
    #home p.text-lg,
    #home p.text-xl {
        font-size: 0.9rem;
    }

    /* Hero badge */
    #home .glass-dark.rounded-full {
        font-size: 0.7rem;
        padding: 0.35rem 0.75rem;
    }

    /* About: mini cards a colonna singola */
    #about .sm\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* Companies: sempre 1 colonna */
    #companies .grid {
        grid-template-columns: 1fr !important;
    }

    /* Blog: 1 colonna */
    #blog .grid.md\\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    /* Collaboration proposta: 1 colonna */
    #collaboration .sm\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* Glow: disabilitati su mobile per performance */
    .glow {
        display: none;
    }
}

/* Ottimizzazione immagini */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Loading state per immagini */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Accessibilità */
a:focus-visible,
button:focus-visible {
    outline: 3px solid #059669;
    outline-offset: 3px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

.glow {
    pointer-events: none;
    z-index: 0;
}

/* Animazioni per scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile menu improvements */
@media (max-width: 1024px) {
    #mobileMenu a {
        font-size: 1.125rem;
        padding: 0.75rem 0;
        display: block;
        transition: color 0.3s ease;
    }
    
    #mobileMenu a:hover {
        color: #059669;
    }
}
