/* =========================================
   VARIABLES & GLOBAL STYLES
   ========================================= */
:root {
    --bg-color: #212529;
    --accent-color: #0d6efd;
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #e9ecef;
    --text-secondary: #6c757d;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: var(--bg-color);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* =========================================
   TYPOGRAPHY & UTILITIES
   ========================================= */
.letter-spacing-1 { letter-spacing: 1px; }
.letter-spacing-2 { letter-spacing: 2px; }
.text-justify { text-align: justify !important; }
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* =========================================
   NAVIGATION (GLASSMORPHISM)
   ========================================= */
.glass-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.glass-btn:hover {
    transform: scale(1.1);
    background-color: rgba(13, 110, 253, 0.8);
}

.glass-box {
    background-color: rgba(33, 37, 41, 0.95) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    width: 320px !important;
}

.glass-box .nav-link {
    font-size: 1.2rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.glass-box .nav-link:hover {
    transform: translateX(-10px);
    color: var(--accent-color) !important;
}

/* =========================================
   SCROLL SNAP & SECTIONS
   ========================================= */
.scroll-snap-y {
    height: 100%;
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
}

.slide {
    height: 100vh;
    width: 100vw;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    display: flex;
    align-items: center;
}

/* =========================================
   HORIZONTAL GALLERY (TIRO CON L'ARCO)
   ========================================= */
.horizontal-wrapper {
    display: flex;
    width: 200vw;
    height: 100vh;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    will-change: transform;
}

.sub-slide {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    overflow-y: auto;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 40px 40px;
    max-width: 1300px;
    margin: auto;
}

.gallery-img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 15px;
    border: 2px solid var(--glass-border);
    transition: all 0.3s ease;
    background: #222;
    cursor: zoom-in;
    aspect-ratio: 1 / 1;
}

.gallery-img:hover {
    transform: scale(1.03);
    border-color: var(--accent-color);
}

.nav-arrow {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(13, 110, 253, 0.15);
    border: 1px solid rgba(13, 110, 253, 0.3);
    color: white;
    padding: 25px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.nav-arrow:hover {
    background: var(--accent-color);
    box-shadow: 0 0 20px rgba(13, 110, 253, 0.5);
}

/* =========================================
   LIGHTBOX
   ========================================= */
#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#lightbox.active {
    display: flex;
    opacity: 1;
}

#lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

/* =========================================
   PCTO: CARDS & ANIMATIONS
   ========================================= */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 850px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    z-index: 2;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.comp-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 4px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Badges Colors */
.badge-red { background: rgba(220, 53, 69, 0.2); color: #ff6b6b; border-color: rgba(220, 53, 69, 0.4); }
.badge-yellow { background: rgba(255, 193, 7, 0.2); color: #ffd93d; border-color: rgba(255, 193, 7, 0.4); }
.badge-green { background: rgba(40, 167, 69, 0.2); color: #6bff97; border-color: rgba(40, 167, 69, 0.4); }
.badge-blue { background: rgba(13, 110, 253, 0.2); color: #6db3ff; border-color: rgba(13, 110, 253, 0.4); }
.badge-purple { background: rgba(111, 66, 193, 0.2); color: #b184f5; border-color: rgba(111, 66, 193, 0.4); }
.badge-orange { background: rgba(253, 126, 20, 0.2); color: #ffb470; border-color: rgba(253, 126, 20, 0.4); }

.animate-bounce { animation: bounce 2s infinite; }
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
}

/* PCTO Fixed Background Images */
.fixed-bg-container {
    position: fixed;
    top: -5%;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.anim-img {
    position: absolute;
    width: 100%;
    max-width: 1400px;
    object-fit: contain;
    transition: transform 1s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease;
    opacity: 0;
    will-change: transform, opacity;
}

/* =========================================
   PRESENTATIONS & TRANSLATOR
   ========================================= */
.hover-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 1rem 3rem rgba(0,0,0,.175) !important;
}

.translate-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    z-index: 1000;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}
.translate-btn:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* =========================================
   HERO SECTION (HOME) & TYPEWRITER EFFECT
   ========================================= */
.hero-section {
    /* NOTA: Cambia 'sfondo.jpg' con il nome ed estensione reale del tuo file immagine */
    background-image: linear-gradient(rgba(33, 37, 41, 0.5), rgba(33, 37, 41, 0.6)), url('../assets/sfondo111.jpg'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Cursore della tastiera per l'effetto macchina da scrivere */
#typewriter-text::after {
    content: '|';
    animation: blinkCursor 1s step-end infinite;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}