#detail-view {
    position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.85);
    z-index: 2000;
    display: none;
    overflow-y: auto;
    padding: 40px 0;
}
.detail-container {
    background: var(--card-bg);
    width: 90%; max-width: 900px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.detail-banner { width:100%; height:500px; background-size:cover; background-position:top center; position:relative; transition: background-image 0.3s ease; }
.detail-banner::after { content:''; position:absolute; bottom:0; width:100%; height:150px; background:linear-gradient(to top,var(--card-bg),transparent); }

.close-detail {
    position:absolute; top:20px; right:20px;
    width:40px; height:40px;
    background:#181818; color:white;
    border:none; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-size:1.8rem; cursor:pointer; z-index:100;
    transition: background 0.2s;
}
.close-detail:hover { background: #e50914; }
.close-detail:focus-visible { outline: 2px solid #e50914; outline-offset: 3px; }

.detail-info { padding:40px; display:grid; grid-template-columns:2fr 1fr; gap:40px; }
.detail-main h2 { font-size:2.8rem; margin-bottom:20px; }
.detail-meta { display:flex; gap:15px; color:#a3a3a3; font-size:1rem; margin-bottom:25px; }
.detail-description { font-size:1.1rem; line-height:1.6; }
.detail-sidebar { color:#a3a3a3; font-size:0.95rem; }
.detail-sidebar .sidebar-item { margin-bottom:15px; }
.detail-sidebar .label { display:block; margin-bottom:5px; }
.detail-sidebar .value { color:#fff; }

.season-tabs { display:flex; gap:20px; padding:0 40px; border-bottom:1px solid #404040; margin-bottom:20px; }
.season-tab {
    padding:10px 0; background:transparent; border:none;
    border-bottom:3px solid transparent;
    color:#a3a3a3; font-weight:bold; cursor:pointer;
}
.season-tab.active { color:#fff; border-bottom-color:var(--primary-color); }

.episode-item {
    display:grid; grid-template-columns:50px 180px 1fr;
    align-items:center; gap:25px;
    padding:20px 40px;
    border-bottom:1px solid #404040;
    cursor:pointer;
}
.episode-item:hover { background:#333; }
.episode-index { font-size:1.8rem; color:#d2d2d2; text-align:center; }
.episode-thumb { width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:4px; }

#detail-trailer-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden; 
    pointer-events: none;
}

#detail-trailer-wrap iframe,
#detail-yt-player,
#detail-yt-player iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%; 
    height: 168.75%; 
    transform: translate(-50%, -50%);
    border: none;
    pointer-events: none;
}

#detail-trailer-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--card-bg) 0%, rgba(24,24,24,0.4) 60%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

#detail-trailer-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 5;
    pointer-events: auto;
}

#detail-trailer-controls button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

#detail-trailer-controls button:hover {
    background: rgba(0,0,0,0.85);
    border-color: #fff;
}