/* --- RESET E GLOBALI --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', serif; 
    color: #f2f2f2;
    overflow-x: hidden;
    cursor: none;
    background-color: #0f003a;
}

/* NUOVO BLOCCO PER GESTIRE LO SFONDO SEPARATAMENTE */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(15,0,58,1) 10%, rgba(75,2,73,1) 60%);
    z-index: -2;
}

/* --- SFONDO ED EFFETTI SPECIALI --- */
#stars, #shooting-stars, .vhs-lines, .vhs-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.2; }
}

.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    box-shadow: 0 0 10px white;
    animation: shooting 1.5s linear;
}

@keyframes shooting {
    from {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    to {
        transform: translate(-300px, 300px) scale(0);
        opacity: 0;
    }
}

@keyframes noise {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-1px, 1px); }
  40% { transform: translate(1px, -1px); }
  60% { transform: translate(-1px, -1px); }
  80% { transform: translate(1px, 1px); }
}

.vhs-effect {
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAUAARxpOhYAAAAASUVORK5CYII=') repeat;
    animation: noise 0.4s infinite;
    opacity: 0.1;
    pointer-events: none;
}

.vhs-lines {
    background: repeating-linear-gradient(transparent 0%, rgba(255, 255, 255, 0.03) 2px, transparent 4px);
    animation: vhsLines 10s infinite linear; 
    pointer-events: none;
}

@keyframes vhsLines {
  from { background-position-y: 0; }
  to { background-position-y: 100px; }
}

.color-vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;

    background-color: rgba(238, 203, 173, 0.07);
    mix-blend-mode: overlay;

    box-shadow: inset 0 0 150px rgba(15, 0, 58, 0.8);
}

/* --- CURSORE E TOCCO --- */
.custom-cursor {
    position: fixed;
    width: 15px;
    height: 15px;
    border: 2px solid white;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 10001;
    transition: transform 0.1s linear; 
}

.mouse-trail {
    position: fixed;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
}

/* --- NUOVO EFFETTO TOCCO: SCINTILLIO (SPARKLE) --- */
.sparkle-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: sparkle-out 2.8s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

@keyframes sparkle-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: var(--end-transform); 
    }
}


/* --- SEZIONE 1: HERO (PRIMA SCHERMATA) --- */
.hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100dvh;
    text-align: center;
    padding: 1rem;
    position: relative;
}

.site-header {
    margin: 0;
}

.logo {
    width: 100px;
    height: auto;
    margin-bottom: 1.5rem;
    animation: pulse-grow 2s infinite ease-in-out;
}

@keyframes pulse-grow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hero-section h1 {
    font-family: 'Knewave', cursive;
    font-size: clamp(1.3rem, 4vw, 2.2rem); 
    font-weight: 400;
    color: #fff;
    margin-bottom: 1.5rem;
}

.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.social-icons a {
    color: #fff;
    font-size: 22px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.social-icons a img {
    width: 24px;
    height: 24px;
    position: relative;
    top: 2px;
}

.social-icons a:hover {
    transform: scale(1.15);
    color: #ff4b81;
}

#audio-controls {
    margin-top: 2rem; 
}

#audio-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #ff4b81;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#audio-button:hover {
    background-color: #a659ff;
    transform: scale(1.1);
}

#audio-icon {
    color: white;
    font-size: 20px;
    margin-left: 3px; 
}

#audio-icon.fa-pause {
    margin-left: 0;
}

.scroll-down-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    animation: bounce 2s infinite;
}

.scroll-down-indicator span {
    display: block;
    width: 100%;
    height: 100%;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* --- SEZIONE 2: CONTENUTI PRINCIPALI --- */
.main-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 1rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.spotify-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 100%;
    margin-bottom: 2.5rem;
}

.spotify-grid iframe {
    border: none;
    border-radius:12px;
    transition: transform 0.3s ease;
}

.spotify-grid iframe:hover {
    transform: translateY(-8px);
}

.more-playlists-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    
    background-color: #ff4b81;
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.more-playlists-btn:hover {
    background-color: #b93bf3;
    transform: scale(1.05);
}

.content-section {
    width: 100%;
    max-width: 800px;
    text-align: left;
    margin-top: 4rem;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.content-section h2 {
    font-family: 'Knewave', cursive;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #fff;
    text-align: center;
}

.content-section h3 {
    font-family: 'Manrope', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ff4b81;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.content-section p {
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 1rem;
}

.content-section a {
    color: #be4fff;
    text-decoration: underline;
}

.content-section a:hover {
    color: #5be6e6;
}

.site-footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 4rem 1rem 2rem 1rem;
    font-size: 0.9rem;
    color: #aaa;
    width: 100%;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

/* Stile per il contenitore dei link ai progetti */
.project-links-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

/* ===== BLOCCO UNIFICATO E CORRETTO ===== */
.project-link a {
    display: block; /* Mantiene la regola dall'altra definizione */
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.project-link a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.legal-links {
    margin-top: 0.5rem;
}

.legal-links a {
    color: #aaa;
    text-decoration: underline;
}

#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1c0a34; /* Un colore scuro ma leggermente diverso dallo sfondo */
    padding: 1rem 1.5rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    z-index: 10002; /* Più alto del cursore per essere sicuro sia visibile */
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap; /* Per schermi piccoli */
}

#cookie-banner p {
    margin: 0;
    color: #ddd;
    font-size: 0.9rem;
}

#cookie-banner a {
    color: #fff;
    text-decoration: underline;
}

#cookie-banner button {
    background-color: #634fff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap; /* Non manda a capo il testo del bottone */
    transition: background-color 0.2s ease;
}

#cookie-banner button:hover {
    background-color: #7a6aff;
}

/* Classe per nascondere il banner */
#cookie-banner.hidden {
    display: none;
}
/* =============================================================== */
/* --- STILE PER PAGINE DI CONTENUTO (POLICY, ETC.) --- */
/* =============================================================== */

.page-container {
    width: 100%;
    max-width: 850px;
    margin: 8rem auto 4rem;
    /* Padding: 4rem sopra, 2rem lati, 6rem sotto per più spazio */
    padding: 4rem 2rem 4rem; 
    background-color: rgba(15, 0, 58, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.page-container h1, .page-container h2, .page-container h3 {
    font-family: 'Knewave', cursive;
    color: #fff;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.page-container h1 {
    font-size: 2.5rem;
    text-align: center;
}

.page-container h2 {
    font-size: 1.8rem;
}

.page-container p, .page-container li {
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #ddd;
    margin-bottom: 1rem;
}

.page-container ul {
    list-style-position: inside;
    padding-left: 1rem;
}

.page-container a {
    color: #8c7eff; /* Un colore che risalta per i link */
    text-decoration: underline;
}

.page-container a:hover {
    text-decoration: none;
}

.back-link {
    display: inline-block;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    margin-bottom: 2rem;
}

.back-link:hover {
    color: #ff2d65;
}

/* Stili per le card delle playlist con effetto hover */

.playlist-card {
    position: relative; /* Fondamentale per posizionare l'overlay */
    display: block;
    border-radius: 12px;
    overflow: hidden; /* Nasconde ciò che esce dai bordi arrotondati */
    -webkit-tap-highlight-color: transparent; /* Rimuove il flash blu su mobile al tocco */
}

.playlist-card img {
    width: 100%;
    display: block;
    transition: filter 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); /* Transizione per scurire */
}

.playlist-card .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    background-color: rgba(0, 0, 0, 0.5); /* Sfondo nero semi-trasparente */
    color: #fff; /* Colore per testo e icona */
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px; /* Spazio tra titolo e icona */
    
    opacity: 0; /* Nascosto di default */
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); /* Transizione per l'overlay */
}

.playlist-card .playlist-title {
    font-family: 'Knewave', cursive;
    font-size: 1.8rem;
    font-weight: 400;
    margin: 0;
    text-align: center;
    padding: 0 10px;
    transform: translateY(10px);
    transition: transform 0.4s ease;
}

.playlist-card .overlay i {
    font-size: 1.4rem;
    transform: translateY(10px);
    transition: transform 0.4s ease;
}

/* --- L'EFFETTO HOVER --- */

/* Applica l'effetto sia su hover (desktop) sia quando la card è attiva (mobile) */
.playlist-card:hover img,
.playlist-card.is-active img {
    filter: brightness(60%); /* Scurisce l'immagine */
}

.playlist-card:hover .overlay,
.playlist-card.is-active .overlay {
    opacity: 1; /* Mostra l'overlay */
}

.playlist-card:hover .playlist-title,
.playlist-card:hover .overlay i,
.playlist-card.is-active .playlist-title,
.playlist-card.is-active .overlay i {
    transform: translateY(0); /* Porta gli elementi alla loro posizione finale */
}

/* --- Stile per la sezione contatti nel footer --- */
.contact-section {
    margin-bottom: 2rem; /* Aggiunge un po' di spazio prima del copyright */
}

.contact-section a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ccc; /* Un grigio chiaro per non essere troppo invadente */
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-section a:hover {
    color: #ff4b81; /* Lo stesso colore rosa dell'hover degli altri elementi */
}

.contact-section i {
    font-size: 1.1rem; /* Dimensione dell'icona della mail */
}

/* --- STILI PER MENU HAMBURGER --- */

.hamburger-btn {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10003; /* Sopra il cookie banner */
    
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.hamburger-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-50%) scale(1.1);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: rgba(15, 0, 58, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10004; /* Il più alto di tutti */
    
    display: flex;
    justify-content: center;
    align-items: center;

    /* Nascosto di default */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.close-menu-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.menu-nav {
    text-align: center;
}

.menu-nav a {
    display: block;
    color: white;
    text-decoration: none;
    font-family: 'Knewave', cursive;
    font-size: clamp(2.5rem, 8vw, 4rem);
    padding: 10px 0;
    transition: transform 0.3s ease, color 0.3s ease;
}

.menu-nav a:hover {
    color: #ff4b81;
    transform: scale(1.05);
}

/* --- STILI PER PAGINA CONTATTI --- */
.contact-highlight {
    margin: 2rem 0;
    text-align: center;
}

.contact-highlight a {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px 30px;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.contact-highlight a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.contact-social-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 1rem;
}

.contact-social-icons a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
    text-decoration: none;
    font-size: 1rem;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-social-icons a:hover {
    color: #fff;
    border-color: #fff;
}

/* --- Stili per Screenshot Progetti --- */
.screenshot-container {
    margin: 2.5rem auto; /* Spazio sopra e sotto */
    text-align: center;
}

.screenshot-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* --- Stili per Visuals App (ColorEase) --- */
.app-visuals-container {
    margin: 2.5rem 0;
    text-align: center;
}

.app-icon-showcase img {
    width: 128px;
    height: 128px;
    border-radius: 24px; /* Raggio tipico per le icone app */
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.screenshots-flex-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Va a capo su schermi piccoli */
}

.screenshots-flex-container img {
    max-width: 280px; /* Larghezza massima per ogni screenshot */
    width: 45%; /* Cerca di occupare metà spazio, ma non più di 280px */
    height: auto;
    border-radius: 16px; /* Bordi più arrotondati per simulare un telefono */
    border: 1px solid rgba(255, 255, 255, 0.1);
}