/* ========================================
   Fastflix - Netflix Style
======================================== */

:root {
    --primary: #E50914;
    /* Netflix Red */
    --bg: #141414;
    /* Netflix Black */
    --surface: #181818;
    --text: #ffffff;
    --text-muted: #e5e5e5;
    --gray-dark: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================
   Navigation
======================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 68px;
    padding: 0 4%;
    display: flex;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 10%, rgba(0, 0, 0, 0));
    transition: background 0.3s;
    z-index: 1000;
}

.navbar.scrolled {
    background: #141414;
}

.nav-logo img {
    height: 25px;
    margin-right: 25px;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links li {
    font-size: 0.9rem;
    color: #e5e5e5;
    cursor: pointer;
    transition: color 0.3s;
}

.nav-links li.active,
.nav-links li:hover {
    color: #fff;
    font-weight: 500;
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    background: transparent;
    border: 1px solid #fff;
    padding: 5px 10px;
    color: #fff;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.search-box.visible {
    opacity: 1;
    background: #000;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
}

/* ========================================
   Hero Section
======================================== */
.hero {
    position: relative;
    height: 80vh;
    width: 100%;
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #141414 10%, transparent 50%);
}

.hero-content {
    position: absolute;
    bottom: 20%;
    left: 4%;
    width: 40%;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.45);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-desc {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.8rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.8;
}

.btn-play {
    background: white;
    color: black;
}

.btn-info {
    background: rgba(109, 109, 110, 0.7);
    color: white;
}

/* ========================================
   Rows & Carousels
======================================== */
.rows-container {
    margin-top: -100px;
    /* Pull up over hero */
    position: relative;
    z-index: 10;
    padding-bottom: 50px;
    overflow: hidden;
    /* Hide overflow to prevent body scrollbar from partial cards */
}

/* ========================================
   Cards
======================================== */
.content-row {
    margin-bottom: 30px;
    padding-left: 4%;
}

.row-header {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.explore-text {
    font-size: 0.9rem;
    color: #54b9f5;
    opacity: 0;
    transition: opacity 0.3s;
    cursor: pointer;
}

.row-header:hover .explore-text {
    opacity: 1;
}

.row-slider {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 40px;
    /* Space for hover expansion */
    padding-top: 40px;
    /* Space for hover expansion */
    margin-top: -40px;
    /* Negate top padding to keep header close */
    scroll-behavior: smooth;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.row-slider::-webkit-scrollbar {
    display: none;
}

.card {
    flex: 0 0 auto;
    width: 200px;
    /* Base width */
    aspect-ratio: 16/9;
    background: #222;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s, z-index 0.3s, box-shadow 0.3s;
    transform-origin: center center;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background: #181818;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    /* Let clicks pass through */
}

transform: scale(1.4);
z-index: 999;
/* Ensure it stays above everything */
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.9);
transition-delay: 0.3s;
/* Delay hover effect like Netflix */
}

.card:hover .card-info {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0.3s;
    /* Sync with card scale */
}

.card:hover img {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Hover fixes for first and last items */
.card:first-child:hover {
    transform: scale(1.4) translateX(20%);
}

.card:last-child:hover {
    transform: scale(1.4) translateX(-20%);
}

.card-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2a2a2a;
    border: 1px solid #999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.icon-btn:hover {
    border-color: white;
    background: #333;
}

.icon-btn:first-child {
    background: white;
    color: black;
    border: none;
}

.card h4 {
    font-size: 0.8rem;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   Ads
======================================== */
.ad-row {
    margin: 40px 0;
    padding: 0 4%;
}

.ad-banner {
    width: 100%;
    height: 120px;
    background-color: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    border: 1px dashed #444;
    border-radius: 8px;
}

/* ========================================
   Modals (Player & Series)
======================================== */
/* Modals (Player & Series) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Darker overlay */
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    backdrop-filter: blur(5px);
    /* Premium blur effect */
}

.modal.active {
    display: flex;
    opacity: 1;
}

/* Player Modal */
.player-wrapper {
    width: 100%;
    height: 100%;
    background: black;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#video-player {
    width: 100%;
    height: 100%;
    max-height: 100vh;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 2100;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

.player-overlay-header {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.live-badge {
    background: #E50914;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
}

.player-loading,
.player-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: black;
    z-index: 2050;
}

/* Series Modal */
.series-modal-content {
    background: #181818;
    width: 95%;
    /* Wider on mobile */
    max-width: 900px;
    height: 90vh;
    /* Taller */
    border-radius: 12px;
    /* Smoother corners */
    overflow: hidden;
    /* Hide scrollbar of container, scroll inside */
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    /* Deep shadow */
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.series-header {
    height: 40%;
    position: relative;
    background-size: cover;
    background-position: center;
}

.series-header-content {
    position: absolute;
    bottom: 20px;
    left: 30px;
    width: 60%;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.series-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.episodes-container {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.season-select {
    background: #333;
    color: white;
    padding: 10px 20px;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 1.1rem;
    margin-bottom: 20px;
    cursor: pointer;
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.episode-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: #222;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.episode-item:hover {
    background: #333;
}

.ep-number {
    font-size: 1.5rem;
    font-weight: 600;
    color: #999;
}

.ep-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
}

.ep-info h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.ep-info p {
    font-size: 0.9rem;
    color: #aeaeae;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   Loading Screen (The Giant Logo)
======================================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #141414;
    /* Match site bg */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    width: 150px;
    /* animation: pulse 2s infinite; Removed to prevent stuck animation perception */
}

/* @keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
} */

.error {
    color: #E50914;
    margin-top: 20px;
}

/* ========================================
   Profile Selection Screen
======================================== */
.profile-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #141414;
    z-index: 9000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease-out;
}

.profile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 100%;
    max-width: 800px;
}

.profile-content h1 {
    font-size: 3.5rem;
    font-weight: 500;
    color: white;
    text-align: center;
}

.profiles-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    gap: 15px;
    cursor: pointer;
    /* Removed erroneous property */
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    background-color: #333;
    border: 3px solid transparent;
    /* Default border */
    transition: border-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-item:hover .profile-avatar {
    border-color: white;
    transform: scale(1.05);
    /* Zoom effect */
}

.profile-name {
    font-size: 1.2rem;
    color: #808080;
    transition: color 0.2s;
    text-align: center;
}

.profile-item:hover .profile-name {
    color: white;
    font-weight: 500;
}

.add-profile {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: 1px solid #666;
    /* Specific helper border */
}

.add-profile:hover {
    background: white;
}

.add-profile:hover svg {
    fill: black;
}

.manage-profiles-btn {
    background: transparent;
    border: 1px solid #808080;
    color: #808080;
    padding: 10px 30px;
    font-size: 1.1rem;
    letter-spacing: 2px;
    cursor: pointer;
    margin-top: 50px;
    text-transform: uppercase;
    transition: border-color 0.2s, color 0.2s;
}

.manage-profiles-btn:hover {
    border-color: white;
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(1.1);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   Custom Player Controls (Netflix Style)
======================================== */
.player-wrapper {
    position: relative;
    background: black;
    overflow: hidden;
}

.video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, transparent 15%, transparent 85%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2010;
}

.player-wrapper:hover .player-controls,
.player-controls.visible {
    opacity: 1;
}

/* Top Bar */
.player-top {
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.player-back {
    cursor: pointer;
    opacity: 0.8;
    transition: transform 0.2s, opacity 0.2s;
}

.player-back:hover {
    transform: scale(1.1);
    opacity: 1;
}

.player-logo {
    height: 30px;
    object-fit: contain;
}

/* Center Click Area */
.player-center-click {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    /* Transparent click zone */
}

/* Bottom Controls */
.player-bottom {
    padding: 0 30px 30px 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Progress Bar */
.progress-container {
    height: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s;
}

.progress-container:hover {
    height: 10px;
}

.progress-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 3px;
}

.progress-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    width: 0%;
    transition: width 0.2s;
}

.progress-current {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #E50914;
    /* Netflix Red */
    border-radius: 3px;
    width: 0%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.progress-handle {
    width: 14px;
    height: 14px;
    background: #E50914;
    border-radius: 50%;
    margin-right: -7px;
    opacity: 0;
    /* Hidden by default */
    transition: transform 0.1s, opacity 0.1s;
    transform: scale(0);
}

.progress-container:hover .progress-handle {
    opacity: 1;
    transform: scale(1);
}

.progress-hover {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    pointer-events: none;
}

.progress-container:hover .progress-hover {
    opacity: 1;
}

/* Control Row */
.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.p-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    opacity: 0.8;
    transition: transform 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.p-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.time-display {
    font-size: 0.9rem;
    color: #dedede;
    margin-left: 10px;
}

.player-title-text {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-right: 15px;
}

/* Volume Slider */
.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    width: 140px;
}

.volume-slider-container {
    width: 0;
    overflow: hidden;
    transition: width 0.2s;
    display: flex;
    align-items: center;
}

.volume-container:hover .volume-slider-container {
    width: 100px;
}

.volume-slider {
    width: 90px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #E50914;
    border-radius: 50%;
    cursor: pointer;
}

/* Spinner override for center */
#buffering-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #E50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    pointer-events: none;
}