/* --- SERIES DETAIL PANEL (OVERLAY & MODAL) --- */

/* 1. Overlay a tutto schermo (Sfondo scuro) */
#series-detail-panel {
    display: flex;
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Sfondo semitrasparente */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px); /* Effetto sfocatura sullo sfondo */
}

/* 2. Finestra Modale (Contenuto) */
.detail-content {
    width: 85vw; height: 85vh;
    max-width: 1400px;
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: fadeIn 0.3s ease forwards;
}

.detail-header {
    padding: 20px 30px; display: flex; justify-content: space-between; align-items: center;
    background: rgba(34, 34, 34, 0.8); border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 1; backdrop-filter: blur(10px);
}

#detail-title { margin: 0; color: white; font-size: 24px; }

.close-detail { background: none; border: none; color: #aaa; font-size: 32px; cursor: pointer; }
.close-detail:hover { color: white; }

.detail-body { flex: 1; display: flex; overflow: hidden; z-index: 1; }

.seasons-col { width: 25%; border-right: 1px solid rgba(255,255,255,0.1); overflow-y: auto; background: rgba(34, 34, 34, 0.6); }
.episodes-col { width: 75%; overflow-y: auto; padding: 20px; background: rgba(26, 26, 26, 0.6); }

.season-btn {
    display: block; width: 100%; padding: 15px 20px; text-align: left;
    background: none; border: none; color: #aaa; cursor: pointer;
    border-bottom: 1px solid #2a2a2a; transition: all 0.2s; font-size: 16px;
}
.season-btn:hover { background: rgba(255,255,255,0.1); color: white; }

/* Stato Attivo (Stagione corrente) */
.season-btn.active { 
    background: rgba(33, 150, 243, 0.25); 
    color: #fff; 
    border-left: none; /* Rimosso bordo */
    font-weight: bold;
}

/* Stato Focus (Navigazione) - Sovrascrive stili globali */
.season-btn:focus {
    background-color: #2196F3 !important;
    color: white !important;
    outline: none !important;
    border-color: transparent !important;
    transform: none !important;
}

.season-status {
    display: block;         /* Manda le info a capo sotto il nome della stagione */
    font-size: 0.75em;      /* Testo più piccolo */
    font-weight: normal;    /* Toglie il grassetto ereditato dal bottone */
    opacity: 0.7;           /* Rende il colore più tenue */
    margin-top: 4px;        /* Distanzia leggermente dal titolo */
    white-space: nowrap;    /* Impedisce che la data o i numeri vadano a capo spezzandosi */
}

.episode-card {
    display: flex; gap: 20px; margin-bottom: 20px; padding: 15px;
    background: rgba(255,255,255,0.03); border-radius: 8px; cursor: pointer;
    position: relative; /* Per posizionare la barra */
    transition: background-color 0.2s;
}
.episode-card:hover { background: rgba(255,255,255,0.1); transform: none; }

.episode-card:focus { 
    background: rgba(33, 150, 243, 0.3) !important; 
}

.ep-img {
    width: 200px; height: 112px; background: #333; border-radius: 4px; flex-shrink: 0;
    background-size: cover; background-position: center;
    position: relative; overflow: hidden;
}
.ep-info { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.ep-title { color: white; font-size: 18px; font-weight: bold; }
.ep-meta { color: #888; font-size: 13px; display: flex; gap: 15px; }
.ep-plot { color: #ccc; font-size: 14px; margin-top: 8px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.no-data {
    color: #888;
    font-style: italic;
    text-align: center;
    margin-top: 40px;
    font-size: 1.2em;
}

/* Barra Progresso Episodio */
.ep-progress {
    position: absolute;
    bottom: 6px;
    left: 8px;
    width: calc(100% - 16px);
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.5);
}
.ep-progress-bar {
    height: 100%; background-color: #FFFFFF; width: 0%;
    border-radius: 2px 0 0 2px;
}

@media (max-width: 900px) {
    .seasons-col { width: 200px; }
    .ep-img { width: 150px; height: 84px; }
    .ep-title { font-size: 16px; }
    .ep-plot { -webkit-line-clamp: 2; line-clamp: 2; }
}
