/* ==========================================================================
   3Cipercash - UX/UI Advanced Optimizations
   Miglioramenti avanzati per esperienza utente ottimale
   ========================================================================== */

/* ==================== SMOOTH INTERACTIONS ==================== */
/* Transizioni fluide per tutti gli elementi interattivi */
a, button, .btn, .card-3d, .nav-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effects migliorati */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 82, 204, 0.25);
}

.btn:active {
    transform: translateY(0);
    transition-duration: 0.1s;
}

/* ==================== TOUCH TARGETS (Mobile UX) ==================== */
/* Tutti gli elementi cliccabili devono essere almeno 44x44px */
@media screen and (max-width: 768px) {
    .btn,
    .nav-link,
    a.header-contact-item,
    .social-link {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Maggiore spacing tra link cliccabili */
    .nav-menu .nav-item {
        margin: 8px 0;
    }
    
    /* Back to top button più grande su mobile */
    .back-to-top {
        width: 52px;
        height: 52px;
        font-size: 1.125rem;
    }
}

/* ==================== READABILITY IMPROVEMENTS ==================== */
/* Migliora la leggibilità dei testi lunghi */
.section-description,
.hero-subtitle,
p {
    max-width: 70ch; /* Lunghezza ottimale linea di testo */
    margin-left: auto;
    margin-right: auto;
}

/* Contrasto migliorato per testi secondari */
.text-light,
.section-description {
    color: #4B5563;
}

@media screen and (max-width: 768px) {
    .section-description,
    .hero-subtitle,
    p {
        max-width: 100%;
    }
}

/* ==================== FOCUS INDICATORS (Accessibility) ==================== */
/* Indicatori di focus visibili per navigazione da tastiera */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
    outline: 3px solid #4A9EFF;
    outline-offset: 4px;
    border-radius: 4px;
}

/* ==================== LOADING STATES ==================== */
/* Skeleton loading per immagini */
img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}

img[src] {
    background: none;
}

/* ==================== CARDS SPACING & HOVER ==================== */
/* Spaziatura ottimizzata per le card */
.info-card-large,
.target-card,
.category-card,
.why-item {
    transition: all 0.3s ease;
}

.info-card-large:hover,
.target-card:hover,
.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 82, 204, 0.18);
}

@media screen and (max-width: 768px) {
    /* Riduce effetto hover su mobile per performance */
    .info-card-large:active,
    .target-card:active,
    .category-card:active {
        transform: translateY(-4px);
    }
}

/* ==================== FORM IMPROVEMENTS ==================== */
/* Migliora usabilità form (se presenti) */
input, textarea, select {
    font-size: 16px !important; /* Previene zoom su iOS */
    min-height: 48px;
    padding: 12px 16px;
}

label {
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

/* ==================== SECTION DIVIDERS ==================== */
/* Separatori visivi tra sezioni */
.section + .section {
    border-top: 1px solid rgba(229, 231, 235, 0.5);
}

.section-alt {
    background: linear-gradient(to bottom, #F9FAFB 0%, #F5F7FA 100%);
}

/* ==================== HERO GRADIENT OVERLAY ==================== */
/* Migliora contrasto testo hero */
.hero-overlay {
    background: linear-gradient(
        135deg,
        rgba(0, 82, 204, 0.85) 0%,
        rgba(74, 158, 255, 0.75) 50%,
        rgba(0, 82, 204, 0.85) 100%
    );
}

/* ==================== STATS COUNTER IMPROVEMENTS ==================== */
.stat-item {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.stat-item:hover {
    border-color: rgba(74, 158, 255, 0.3);
    background: rgba(74, 158, 255, 0.05);
}

/* ==================== BREADCRUMB STYLING ==================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    margin-top: 16px;
    opacity: 0.9;
}

.breadcrumb a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumb a:hover {
    opacity: 0.7;
}

/* ==================== ICON CONSISTENCY ==================== */
/* Dimensioni consistenti per le icone */
.fa, .fas, .far, .fab {
    width: 1em;
    text-align: center;
}

/* ==================== CTA SECTION IMPROVEMENTS ==================== */
.cta-section {
    background: linear-gradient(135deg, #0052CC 0%, #003D99 100%);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(74, 158, 255, 0.15) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* ==================== FOOTER LINKS HOVER ==================== */
.footer-links a,
.footer-contact a {
    transition: all 0.2s ease;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.footer-links a:hover::after {
    width: 100%;
}

/* ==================== SOCIAL LINKS IMPROVEMENTS ==================== */
.social-link {
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
    color: var(--accent-color);
}

/* ==================== PAGE HEADER CONSISTENCY ==================== */
.page-header {
    background: linear-gradient(135deg, #0052CC 0%, #4A9EFF 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="2"/></svg>');
    background-size: 100px 100px;
    opacity: 0.3;
}

.page-header-content {
    position: relative;
    z-index: 1;
}

/* ==================== MOBILE MENU IMPROVEMENTS ==================== */
@media screen and (max-width: 768px) {
    .nav-menu {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    }
    
    .nav-menu.active {
        animation: slideDown 0.3s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Separator tra link menu */
    .nav-item:not(:last-child) {
        border-bottom: 1px solid rgba(0, 82, 204, 0.1);
    }
}

/* ==================== BACK TO TOP IMPROVEMENTS ==================== */
.back-to-top {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    background: rgba(0, 82, 204, 0.9);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 82, 204, 0.4);
}

.back-to-top:active {
    transform: translateY(-2px) scale(1);
}

/* ==================== SCROLL REVEAL ANIMATIONS ==================== */
/* Animazioni di entrata per elementi AOS */
[data-aos="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition-property: transform, opacity;
}

[data-aos="fade-up"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== ERROR PREVENTION ==================== */
/* Previeni selezione accidentale */
.btn,
.logo,
.mobile-toggle {
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ==================== PERFORMANCE HINTS ==================== */
/* Suggerimenti al browser per ottimizzare rendering */
.card-3d,
.btn,
.nav-link {
    will-change: transform;
}

/* Rimuovi will-change dopo animazione */
.card-3d:not(:hover),
.btn:not(:hover),
.nav-link:not(:hover) {
    will-change: auto;
}

/* ==================== PRINT OPTIMIZATIONS ==================== */
@media print {
    .hero-overlay,
    .section-alt {
        background: white !important;
        color: black !important;
    }
    
    .btn {
        border: 1px solid black;
        background: white !important;
        color: black !important;
    }
}
