/* ── DETAIL PAGE ────────────────────────────────────────── */
.detail-hero {
    position: relative; height: 60vh; min-height: 440px; overflow: hidden;
}
.detail-bg {
    position: absolute; inset: 0;
    background: url('https://picsum.photos/seed/phantom/1400/800') center 20%/cover no-repeat;
}
.detail-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(8,10,15,.3) 0%, rgba(8,10,15,.7) 50%, rgba(8,10,15,1) 100%);
}
.detail-back {
    position: absolute; top: 80px; left: 48px; z-index: 2;
    display: flex; align-items: center; gap: 8px;
    color: var(--muted); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: color .2s; background: none; border: none;
    font-family: var(--font-body); text-decoration: none;
}
.detail-back:hover { color: var(--text); }

.detail-content {
    padding: 0 48px 40px; margin-top: -120px;
    position: relative; z-index: 2;
    display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start;
}
.detail-poster {
    width: 220px; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden;
    border: 2px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,.6); flex-shrink: 0;
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-info { padding-top: 20px; }
.detail-category {
    font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--accent); font-weight: 600; margin-bottom: 10px; text-decoration: none; display: block;
}
.detail-title {
    font-family: var(--font-display); font-size: clamp(36px,5vw,60px);
    line-height: .95; letter-spacing: 1px; margin-bottom: 16px;
}
.detail-meta-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.meta-pill {
    padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 500;
    font-family: var(--font-mono); background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
}
.meta-pill.rating { background: rgba(232,197,71,.12); border-color: rgba(232,197,71,.3); color: var(--accent); }
.detail-desc { font-size: 14px; line-height: 1.75; color: rgba(240,242,247,.7); max-width: 580px; margin-bottom: 28px; }
.detail-actions { display: flex; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }
.detail-cast { font-size: 13px; color: var(--muted); }
.detail-cast span { color: var(--text); }

/* ── VIDEO PLAYER ─────────────────────────────────────── */
.video-section { padding: 0 48px 48px; }
.video-section-title { font-family: var(--font-display); font-size: 20px; letter-spacing: 1.5px; margin-bottom: 16px; }

/* Constrain width on large screens, centre it */
.player-outer {
    margin: 0 auto;
}

.player-wrap {
    position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 12px;
    overflow: hidden; background: #000; cursor: pointer;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.player-thumbnail {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
#real-video {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none;
}

/* Centre-play overlay (pre-play state) */
.player-overlay {
    position: absolute; inset: 0; z-index: 2;
    background: rgba(0,0,0,.45);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity .3s;
}
.player-overlay.hidden { opacity: 0; pointer-events: none; }
.big-play {
    width: 72px; height: 72px; border-radius: 50%;
    background: rgba(255,255,255,.15); border: 2px solid rgba(255,255,255,.4);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px; transition: transform .2s, background .2s;
}
.player-wrap:hover .big-play { transform: scale(1.1); background: rgba(255,255,255,.25); }
.player-label { font-size: 13px; color: rgba(255,255,255,.7); }

/* Bottom controls bar — appears on hover */
.player-controls {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 3;
    padding: 32px 16px 12px;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 100%);
    opacity: 0; transition: opacity .25s;
    pointer-events: none;
}
.player-wrap:hover .player-controls,
.player-wrap.paused .player-controls { opacity: 1; pointer-events: auto; }

/* Progress / seek bar */
.progress-row {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
}
.progress-bar {
    flex: 1; height: 4px; border-radius: 2px;
    background: rgba(255,255,255,.25);
    cursor: pointer; position: relative;
}
.progress-bar:hover { height: 6px; }
.progress-fill {
    height: 100%; border-radius: 2px;
    background: var(--accent);
    width: 0%; pointer-events: none;
    transition: width .1s linear;
}
.progress-bar:hover .progress-fill { background: #fff; }
.progress-thumb {
    position: absolute; top: 50%; right: -6px;
    transform: translateY(-50%);
    width: 12px; height: 12px; border-radius: 50%;
    background: #fff;
    opacity: 0; transition: opacity .15s;
    pointer-events: none;
}
.progress-bar:hover .progress-thumb { opacity: 1; }
.time-label {
    font-family: var(--font-mono); font-size: 12px;
    color: rgba(255,255,255,.8); white-space: nowrap; flex-shrink: 0;
}

/* Bottom row: play/pause + time + volume + fullscreen */
.controls-row {
    display: flex; align-items: center; gap: 8px;
}
.ctrl-btn {
    width: 34px; height: 34px; border-radius: 6px;
    background: none; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background .15s, transform .15s;
    color: #fff; flex-shrink: 0; padding: 0;
}
.ctrl-btn:hover { background: rgba(255,255,255,.15); transform: scale(1.1); }
.ctrl-btn svg { pointer-events: none; }
.ctrl-spacer { flex: 1; }

/* Volume slider (inline, collapses on mobile) */
.volume-wrap { display: flex; align-items: center; gap: 6px; }
.volume-slider {
    -webkit-appearance: none; appearance: none;
    width: 72px; height: 4px; border-radius: 2px;
    background: rgba(255,255,255,.3);
    outline: none; cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 12px; height: 12px; border-radius: 50%;
    background: #fff; cursor: pointer;
}
@media (max-width: 480px) { .volume-wrap { display: none; } }

/* ── RELATED ROW ─────────────────────────────────────── */
.related-section { padding: 0 48px 80px; }

@media (max-width: 768px) {
    .detail-content { grid-template-columns: 1fr; padding: 0 20px 40px; }
    .detail-poster { width: 150px; }
    .detail-back { left: 20px; }
    .video-section, .related-section { padding-left: 20px; padding-right: 20px; }
}

/* ── PLAYER LOADER ─────────────────────────────────────── */
.player-loader {
    position: absolute; inset: 0; z-index: 5;
    background: rgba(0,0,0,.7);
    display: none;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 16px;
}
.player-loader.active { display: flex; }
.player-loader .spinner {
    width: 48px; height: 48px;
    border: 3px solid rgba(255,255,255,.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player-loader .loader-text {
    font-size: 14px; color: rgba(255,255,255,.7);
    font-family: var(--font-body);
}
