#details-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-size: cover;
    background-position: center center;
    transition: background-image 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}


#trailer-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Sotto l'overlay (1) e il contenuto (2) */
    pointer-events: none; /* Non intercettare click */
    overflow: hidden; /* Maschera lo zoom del video */
}
#trailer-container iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#details-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradiente leggermente più chiaro per far risaltare meglio le fanart */
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 30%, rgba(0,0,0,0.1) 60%, rgba(0,0,0,0.4) 100%);
    z-index: 1;
    transition: opacity 0.5s ease;
}

body.trailer-playing #details-overlay {
    opacity: 0.2; /* Rende l'overlay quasi invisibile durante il trailer */
}

#info-panel {
    position: relative;
    z-index: 2;
    flex: 1; /* Occupa tutto lo spazio disponibile sopra la griglia */
    padding: 2vw 4vw 16vw 4vw; /* Convertito in VW per scalare proporzionalmente */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Allinea il contenuto in basso */
    color: white;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
    margin-bottom: 10px;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

#info-logo {
    width: auto;
    height: auto;
    max-width: 400px;
    max-height: 150px;
    object-fit: contain;
    align-self: flex-start;
    margin-bottom: 20px;
    display: none;
}

#info-title {
    font-size: 3vw; /* Scala col monitor */
    margin: 0;
    font-weight: bold;
}

#info-title .year {
    font-weight: normal;
    font-size: 0.7em;
    color: #ccc;
    margin-left: 10px;
}

#info-title .sub-badge {
    display: inline-block;
    background-color: #f44336;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.5em;
    vertical-align: middle;
    margin-left: 15px;
    font-weight: bold;
}

#info-badges {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.info-badge {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
}

.info-badge.trailer {
    background-color: #2196F3;
    border-color: #2196F3;
    cursor: pointer;
}

#info-cast {
    margin-top: 10px;
    color: #ccc;
    font-size: 1.1vw; /* Leggermente più piccolo della trama */
}
#info-cast strong {
    color: #fff;
}

#info-plot {
    margin-top: 20px;
    font-size: 1.2vw; /* Scala col monitor */
    max-width: 100%;
    line-height: 1.5;
}

#home-view {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 16.5vw; /* Altezza proporzionale alla larghezza (approx 310px su 1080p) */
    background: linear-gradient(to top, #000000 0%, transparent 100%);
    z-index: 10;
    display: flex;
    align-items: center;
    padding: 0;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

#strip-counter {
    position: absolute;
    right: 1vw;
    top: 0vw;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2vw;
    font-weight: bold;
    z-index: 20;
    pointer-events: none;
    text-shadow: rgba(0, 0, 0, 0.8) 1px 1px 2px;
}

/* --- STATO TRAILER ATTIVO --- */
body.trailer-playing #home-view {
    transform: translateY(100%); /* Nasconde la strip spostandola in basso */
}

body.trailer-playing #info-panel {
    transform: translateY(10.5vw); /* Sposta i dettagli in basso seguendo la strip */
}

/* --- HINT TRAILER --- */
#trailer-hint {
    position: absolute;
    bottom: 30px;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    letter-spacing: 1px;
    text-transform: uppercase;
}

body.trailer-playing #trailer-hint {
    opacity: 1;
    transition-delay: 0.5s; /* Appare dopo che la strip è scesa */
    /* Pulsa 3 volte (2s * 3 = 6s), poi svanisce */
    animation: hintPulse 2s 3 forwards, fadeOut 0.5s 6s forwards;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.6; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(5px); }
}

@keyframes fadeOut {
    to { opacity: 0; }
}