/* ============================================
   VARIABILI CSS E CONFIGURAZIONE GLOBALE
   ============================================ */
:root {
    /* Colori principali - Palette moderna e fresca */
    --primary-color: #125A8C;        /* Blu logo */
    --primary-dark: #0d4260;         /* Blu scuro */
    --primary-light: #1a70a8;        /* Blu chiaro */
    --secondary-color: #f59e0b;      /* Arancione/ambra vibrante */
    --secondary-light: #fbbf24;      /* Giallo dorato */
    --accent-color: #dc2626;         /* Rosso moderno */
    --accent-purple: #8b5cf6;        /* Viola accento */
    --text-dark: #1f2937;            /* Grigio scuro moderno */
    --text-medium: #6b7280;          /* Grigio medio */
    --text-light: #f9fafb;           /* Bianco sporco */
    --bg-overlay: rgba(255, 255, 255, 0.95);
    --bg-overlay-dark: rgba(0, 0, 0, 0.75);

    /* Font - Famiglia moderna e leggibile */
    --font-primary: "Poppins", "Segoe UI", system-ui, sans-serif;
    --font-secondary: "Inter", "Segoe UI", system-ui, sans-serif;
    --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-text: 0 2px 4px rgba(0, 0, 0, 0.8);

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

/* ============================================
   RESET E BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #464646;
    overflow-x: hidden;
}

/* ============================================
   ANIMAZIONI KEYFRAMES
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* ============================================
   CLASSI UTILITY PER ANIMAZIONI
   ============================================ */
.animate-fadeIn {
    animation: fadeIn 0.8s ease forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 1s ease forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.8s ease forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.8s ease forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.6s ease forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Delay classes */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* ============================================
   NAVIGATION BAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg-overlay-dark);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.5s ease;
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    padding: 0.5rem 2rem;
    background: rgba(0, 0, 0, 0.9);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logo {
    height: 50px;
    transition: all var(--transition-normal);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8))
            drop-shadow(0 0 20px rgba(255, 255, 255, 0.6))
            drop-shadow(0 0 30px rgba(255, 255, 255, 0.4));
}

.navbar-logo:hover {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 1))
            drop-shadow(0 0 30px rgba(255, 255, 255, 0.8))
            drop-shadow(0 0 45px rgba(255, 255, 255, 0.6));
}

.navbar-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.navbar-link {
    color: var(--text-light);
    text-decoration: none;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    position: relative;
    transition: all var(--transition-normal);
}

.navbar-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.navbar-link:hover {
    color: var(--secondary-color);
    text-shadow: 0 0 10px var(--secondary-color);
}

.navbar-link:hover::after {
    width: 100%;
}

.navbar-link.active {
    color: var(--secondary-color);
}

/* Mobile menu toggle */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.navbar-toggle span {
    width: 30px;
    height: 3px;
    background: var(--text-light);
    transition: all var(--transition-normal);
}

/* ============================================
   CONTENITORI E LAYOUT
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    min-height: 100vh;
    padding: 6rem 2rem 4rem;
    position: relative;
}

.section-title {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 5vw, 4rem);
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* ============================================
   CARDS E COMPONENTI
   ============================================ */
.card {
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card:hover::before {
    left: 100%;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #ffdb70);
    color: var(--text-dark);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   LOADING E STATI
   ============================================ */
.loading {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .navbar-menu {
        gap: 1rem;
    }

    .navbar-link {
        font-size: 1rem;
    }

    .section {
        padding: 5rem 1.5rem 3rem;
    }
}

@media (max-width: 768px) {
    .navbar-toggle {
        display: flex;
    }

    .navbar-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 2rem;
        gap: 1rem;
        transition: left var(--transition-normal);
    }

    .navbar-menu.active {
        left: 0;
    }

    .navbar-link {
        font-size: 1.5rem;
        width: 100%;
        text-align: center;
    }

    .section {
        padding: 4rem 1rem 2rem;
    }

    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .navbar {
        padding: 0.5rem 1rem;
    }

    .navbar-logo {
        height: 40px;
    }
}

/* ============================================
   SCROLL ANIMATIONS (Intersection Observer)
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-center { justify-content: center; align-items: center; }
.flex-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.grid { display: grid; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.hidden { display: none; }
.visible { display: block; }
