/* ============================================
   NETFLIX STYLE - WebPlayer 2.0
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --nf-black: #141414;
    --nf-dark: #0a0a0a;
    --nf-surface: #1a1a1a;
    --nf-surface-hover: #222;
    --nf-red: #e50914;
    --nf-red-hover: #f40612;
    --nf-red-glow: rgba(229, 9, 20, 0.4);
    --nf-white: #fff;
    --nf-gray-light: #b3b3b3;
    --nf-gray: #808080;
    --nf-gray-dark: #333;
    --nf-gradient-bottom: linear-gradient(transparent, rgba(20, 20, 20, 0.6) 40%, #141414);
    --nf-gradient-left: linear-gradient(90deg, rgba(20, 20, 20, 0.95) 0%, transparent 100%);
    --nf-gradient-full: linear-gradient(180deg, transparent 0%, rgba(20, 20, 20, 0.4) 40%, #141414 100%);
    --nf-radius: 6px;
    --nf-radius-lg: 12px;
    --nf-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    --nf-transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --nf-sidebar-width: 68px;
    --nf-sidebar-expanded: 220px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--nf-black);
    color: var(--nf-white);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--nf-gray-dark);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--nf-gray);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--nf-sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #0a0a0a 0%, #111 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 9999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar:hover,
.sidebar.expanded {
    width: var(--nf-sidebar-expanded);
    background: #0a0a0a;
}

.sidebar .logo {
    padding: 20px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sidebar .logo img {
    height: 28px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sidebar.expanded .logo img {
    height: 40px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--nf-gray-light);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--nf-transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.sidebar a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--nf-red);
    border-radius: 0 3px 3px 0;
    transition: height var(--nf-transition);
}

.sidebar a:hover::before,
.sidebar a.active::before {
    height: 24px;
}

.sidebar a:hover {
    color: var(--nf-white);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar a.active {
    color: var(--nf-white);
}

.sidebar i {
    font-size: 20px;
    min-width: 28px;
    text-align: center;
    transition: all var(--nf-transition);
}

.sidebar span {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin-left: 4px;
}

.sidebar.expanded span {
    opacity: 1;
    transform: translateX(0);
}

body {
    padding-left: var(--nf-sidebar-width);
    transition: padding-left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body.sidebar-expanded {
    padding-left: var(--nf-sidebar-expanded);
}

/* ============================================
   SEARCH
   ============================================ */
.search-icon {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: var(--nf-gray-light);
    cursor: pointer;
    transition: all var(--nf-transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
}

.search-icon:hover {
    color: var(--nf-white);
    background: rgba(255, 255, 255, 0.05);
}

.search-container {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 20px;
    background: rgba(0, 0, 0, 0.3);
}

.search-container.active {
    max-height: 60px;
    padding: 12px 20px;
}

.search-container input {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: var(--nf-radius);
    border: 1px solid var(--nf-gray-dark);
    background: var(--nf-surface);
    color: var(--nf-white);
    outline: none;
    transition: border-color var(--nf-transition);
    font-family: 'Inter', sans-serif;
}

.search-container input:focus {
    border-color: var(--nf-red);
}

.search-container input::placeholder {
    color: var(--nf-gray);
}

/* ============================================
   SEARCH RESULTS
   ============================================ */
.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 20px 30px;
}

.result-item {
    background: var(--nf-surface);
    border-radius: var(--nf-radius);
    overflow: hidden;
    transition: transform var(--nf-transition), box-shadow var(--nf-transition);
}

.result-item:hover {
    transform: scale(1.08);
    box-shadow: var(--nf-shadow);
}

.result-item a {
    display: block;
}

.result-item img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}

.result-item p {
    padding: 10px;
    font-size: 13px;
    color: var(--nf-gray-light);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   HERO / FEATURED SECTION
   ============================================ */
.hero-section {
    position: relative;
    height: 85vh;
    min-height: 500px;
    background-size: cover;
    background-position: center top;
    display: flex;
    align-items: flex-end;
    padding: 0 4%;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        77deg,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.5) 40%,
        transparent 70%
    );
    z-index: 1;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(transparent, var(--nf-black));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 550px;
    padding-bottom: 60px;
}

.hero-content .hero-title {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 56px;
    letter-spacing: 2px;
    line-height: 1.05;
    margin-bottom: 16px;
    text-shadow: 2px 4px 12px rgba(0, 0, 0, 0.8);
}

.hero-content .hero-description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--nf-gray-light);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero-content .hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}

.hero-content .hero-meta .rating {
    color: #46d369;
    font-weight: 700;
}

.hero-content .hero-meta .match {
    color: #46d369;
    font-weight: 600;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-play {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--nf-white);
    color: #000;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--nf-radius);
    text-decoration: none;
    transition: all var(--nf-transition);
    border: none;
    cursor: pointer;
}

.btn-play:hover {
    background: rgba(255, 255, 255, 0.8);
}

.btn-play i {
    font-size: 22px;
}

.btn-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(109, 109, 110, 0.7);
    color: var(--nf-white);
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--nf-radius);
    text-decoration: none;
    transition: all var(--nf-transition);
    backdrop-filter: blur(4px);
}

.btn-info:hover {
    background: rgba(109, 109, 110, 0.5);
}

/* ============================================
   CONTENT ROWS / CAROUSELS
   ============================================ */
.content-section {
    padding: 0 4%;
    margin-bottom: 40px;
    position: relative;
}

.content-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--nf-white);
    letter-spacing: 0.5px;
}

.see-all {
    color: var(--nf-gray-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.see-all:hover {
    color: var(--nf-white);
}
}

.section-title:hover {
    color: var(--nf-gray-light);
}

.view-all a {
    color: var(--nf-red) !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--nf-transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.view-all a:hover {
    color: var(--nf-red-hover) !important;
}

.poster-carousel {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 0 16px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.poster-carousel::-webkit-scrollbar {
    display: none;
}

.poster-item {
    flex: 0 0 auto;
    width: 170px;
    text-align: center;
    position: relative;
    border-radius: var(--nf-radius);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                z-index 0s 0.4s;
    cursor: pointer;
}

.poster-item:hover {
    transform: scale(1.15);
    z-index: 10;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                z-index 0s 0s;
}

.poster-item img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: var(--nf-radius);
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.poster-item .poster-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 10px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    border-radius: 0 0 var(--nf-radius) var(--nf-radius);
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--nf-transition);
}

.poster-item:hover .poster-overlay {
    opacity: 1;
    transform: translateY(0);
}

.poster-item p {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--nf-gray-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

/* ============================================
   CATEGORY BUTTONS ROW
   ============================================ */
.category-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 20px 4%;
    flex-wrap: wrap;
}

.category-buttons a {
    display: block;
    transition: all var(--nf-transition);
}

.category-buttons img {
    height: 36px;
    border-radius: var(--nf-radius);
    opacity: 0.75;
    transition: all var(--nf-transition);
    filter: grayscale(30%);
}

.category-buttons a:hover img {
    opacity: 1;
    transform: scale(1.1);
    filter: grayscale(0%);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

/* ============================================
   GRID LAYOUT
   ============================================ */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    padding: 0 4%;
    margin-bottom: 50px;
}

.grid-item {
    position: relative;
    border-radius: var(--nf-radius);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                z-index 0s 0.4s;
    cursor: pointer;
    background: var(--nf-surface);
}

.grid-item:hover {
    transform: scale(1.08);
    z-index: 10;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                z-index 0s 0s;
}

.grid-item a {
    display: block;
}

.grid-item img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    border-radius: var(--nf-radius);
}

.grid-item p {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 10px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    font-size: 13px;
    font-weight: 500;
    color: var(--nf-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(5px);
    transition: all var(--nf-transition);
}

.grid-item:hover p {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.login-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(20, 20, 20, 0.92) 0%,
        rgba(20, 20, 20, 0.6) 50%,
        rgba(20, 20, 20, 0.85) 100%
    );
    z-index: 1;
}

.login-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(transparent, var(--nf-black));
    z-index: 2;
}

.login-bg .carousel-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    opacity: 0.25;
    height: 100%;
    align-content: flex-start;
}

.login-bg .poster {
    width: 150px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-radius: var(--nf-radius);
}

.login-bg .poster img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}

.login-content {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.login-box {
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 48px 44px;
    border-radius: var(--nf-radius-lg);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.login-box .logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-box .logo img {
    height: 44px;
}

.login-box h1 {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.login-box .subtitle {
    text-align: center;
    color: var(--nf-gray);
    font-size: 14px;
    margin-bottom: 32px;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 16px 18px;
    margin-bottom: 16px;
    border: 1px solid var(--nf-gray-dark);
    border-radius: var(--nf-radius);
    background: rgba(22, 22, 22, 0.9);
    color: var(--nf-white);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all var(--nf-transition);
    outline: none;
}

.login-box input:focus {
    border-color: var(--nf-white);
    background: rgba(30, 30, 30, 0.95);
}

.login-box input::placeholder {
    color: var(--nf-gray);
}

.login-box .btn-submit {
    width: 100%;
    padding: 16px;
    margin-top: 8px;
    background: var(--nf-red);
    color: var(--nf-white);
    border: none;
    border-radius: var(--nf-radius);
    font-size: 16px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all var(--nf-transition);
    letter-spacing: 0.5px;
}

.login-box .btn-submit:hover {
    background: var(--nf-red-hover);
}

.login-box .btn-submit:active {
    transform: scale(0.98);
}

.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 20px;
    z-index: 10;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

.login-footer p {
    color: var(--nf-gray);
    font-size: 13px;
}

.login-footer a {
    color: var(--nf-red);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--nf-transition);
}

.login-footer a:hover {
    color: var(--nf-red-hover);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .hero-content .hero-title {
        font-size: 42px;
    }

    .poster-item {
        width: 140px;
    }

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (max-width: 768px) {
    :root {
        --nf-sidebar-width: 0px;
        --nf-sidebar-expanded: 0px;
    }

    body {
        padding-left: 0 !important;
    }

    .sidebar {
        display: none;
    }

    .hero-section {
        height: 60vh;
    }

    .hero-content .hero-title {
        font-size: 32px;
    }

    .hero-content .hero-description {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .btn-play, .btn-info {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }

    .category-buttons img {
        height: 28px;
    }

    .poster-item {
        width: 120px;
    }

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 6px;
    }

    .login-box {
        padding: 36px 28px;
    }

    .search-results {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .hero-content .hero-title {
        font-size: 26px;
    }

    .category-buttons {
        gap: 10px;
        padding: 15px 3%;
    }

    .category-buttons img {
        height: 24px;
    }

    .poster-item {
        width: 105px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

/* ============================================
   MISC
   ============================================ */
.section-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 20px 4%;
}

.no-content {
    text-align: center;
    padding: 60px 20px;
    color: var(--nf-gray);
    font-size: 16px;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.loading-spinner::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--nf-gray-dark);
    border-top-color: var(--nf-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
