/* HomeboxTV Modern Streaming Design System */

:root {
    --brand-red: #E50914;
    --brand-red-hover: #f40612;
    --bg-dark: #0f0f11;
    --bg-card: #18181c;
    --bg-card-hover: #22222b;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: #E50914;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #33333d transparent;
}

body {
    background-color: var(--bg-dark);
    color: #ffffff;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Custom scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #272733;
    border-radius: 9999px;
    border: 2px solid var(--bg-dark);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brand-red);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Modal Open state to prevent scroll bleed */
.modal-open {
    overflow: hidden !important;
}

/* Premium Glassmorphism */
.glass {
    background: rgba(15, 15, 17, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border-subtle);
}

.glass-card {
    background: rgba(24, 24, 28, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Gradients */
.hero-gradient {
    background: linear-gradient(77deg, rgba(15, 15, 17, 0.95) 0%, rgba(15, 15, 17, 0.7) 40%, rgba(15, 15, 17, 0) 100%);
}

.bottom-shade {
    background: linear-gradient(180deg, transparent 0%, rgba(15, 15, 17, 0.7) 60%, #0f0f11 100%);
}

/* Player Specific Styles */
.player-gpu-layer {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
}

/* Wireframe Player Style: Horizontal Language Option Bars */
.stream-option-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.5rem;
    background: #141418;
    border: 1.5px solid #272733;
    border-radius: 8px;
    color: #f1f1f5;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stream-option-bar:hover {
    background: #1d1d24;
    border-color: rgba(229, 9, 20, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -4px rgba(229, 9, 20, 0.25);
}

.stream-option-bar.active {
    background: #1e1b20;
    border-color: var(--brand-red);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.35);
}

.stream-option-bar .play-btn-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.stream-option-bar:hover .play-btn-circle,
.stream-option-bar.active .play-btn-circle {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: #ffffff;
    transform: scale(1.1);
}

/* --- NETFLIX-STYLE PLAYER CONTROLS --- */
.netflix-player-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    user-select: none;
}

.netflix-player-box:fullscreen {
    border-radius: 0;
    border: none;
    width: 100vw;
    height: 100vh;
}

.netflix-player-box:-webkit-full-screen {
    border-radius: 0;
    border: none;
    width: 100vw;
    height: 100vh;
}

.netflix-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 30;
    transition: opacity 0.35s ease;
    pointer-events: auto;
}

.netflix-overlay.hidden-controls {
    opacity: 0;
    pointer-events: none;
    cursor: none;
}

.netflix-top-bar {
    width: 100%;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
}

.netflix-top-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.netflix-top-btn:hover:not(.no-action) {
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.1);
}

.netflix-top-btn.no-action {
    opacity: 0.85;
    cursor: default;
}

.netflix-bottom-bar {
    width: 100%;
    padding: 2rem 2rem 1.25rem 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.65) 50%, rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.netflix-timeline-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
}

.netflix-timeline-track {
    position: relative;
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: height 0.15s ease;
}

.netflix-timeline-track:hover {
    height: 8px;
}

.netflix-timeline-buffer {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    pointer-events: none;
}

.netflix-timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: #e50914;
    border-radius: 4px;
    pointer-events: none;
}

.netflix-timeline-thumb {
    position: absolute;
    top: 50%;
    width: 15px;
    height: 15px;
    background: #e50914;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.netflix-timeline-track:hover .netflix-timeline-thumb {
    transform: translate(-50%, -50%) scale(1);
}

.netflix-time-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e5e5e5;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
}

.netflix-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.netflix-ctrl-group {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.netflix-ctrl-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border-radius: 6px;
    transition: transform 0.18s ease, color 0.18s ease;
}

.netflix-ctrl-btn:hover {
    transform: scale(1.15);
    color: #ffffff;
}

.netflix-ctrl-btn:active {
    transform: scale(0.95);
}

/* Volume Slider on Hover */
.netflix-volume-group {
    position: relative;
    display: flex;
    align-items: center;
}

.netflix-volume-slider-wrapper {
    width: 0;
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), margin 0.25s ease;
    display: flex;
    align-items: center;
}

.netflix-volume-group:hover .netflix-volume-slider-wrapper {
    width: 75px;
    margin-left: 0.5rem;
}

.netflix-volume-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.netflix-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
}

/* Center Title / Info */
.netflix-center-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    letter-spacing: 0.02em;
    max-width: 45%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Netflix Floating Menu (Audio & Subtitles / Episodes) */
.netflix-floating-panel {
    position: absolute;
    bottom: calc(100% + 1.25rem);
    right: 0;
    background: rgba(18, 18, 22, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 0.85rem;
    min-width: 260px;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
    z-index: 70;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.netflix-floating-header {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    padding: 0 0.5rem 0.5rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.25rem;
}

.netflix-floating-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #e5e7eb;
    cursor: pointer;
    transition: all 0.15s ease;
}

.netflix-floating-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.netflix-floating-item.active {
    background: rgba(229, 9, 20, 0.25);
    color: #ff4d58;
    font-weight: 800;
}

/* Recommended Sidebar Cards (YouTube Style Dimensions) */
.recommended-card {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 100%;
    background: #141419;
    border: 1.5px solid #22222d;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.recommended-card:hover {
    transform: translateY(-3px);
    border-color: rgba(229, 9, 20, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.recommended-thumb-wrapper {
    position: relative;
    width: 100%;
    height: 165px;
    min-height: 165px;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #1c1c24;
}

.recommended-thumb-wrapper img {
    width: 100%;
    height: 100%;
    min-height: 165px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.recommended-card:hover .recommended-thumb-wrapper img {
    transform: scale(1.06);
}

/* Animations */
@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.animate-pulse-subtle {
    animation: pulse-subtle 2s infinite ease-in-out;
}

/* Isolated Movie Card Hover Overlay */
.movie-card {
    position: relative;
}

.movie-card-overlay {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.movie-card:hover .movie-card-overlay {
    opacity: 1 !important;
    pointer-events: auto;
}

.movie-card:hover .movie-card-img {
    transform: scale(1.1);
}
