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

:root {
    --bg-main: #141414;
    --bg-secondary: #000000;
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-muted: #808080;
    --accent-color: #e50914;
    /* Netflix Red */
    --hover-overlay: rgba(0, 0, 0, 0.4);
    --card-bg: #2f2f2f;
    --transition-speed: 0.3s;
    --nav-height: 70px;
    --green-rating: #46d369;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.5;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--card-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Typography & Layout */
a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.app-container {
    width: 100%;
}

.section-wrapper {
    padding: 0 4%;
    margin-bottom: 3vw;
}

.section-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 0.5em;
    display: inline-block;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    padding: 0 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 10%, transparent);
    z-index: 1000;
    transition: background-color var(--transition-speed);
}

.navbar.scrolled {
    background-color: var(--bg-main);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    color: var(--accent-color);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
}

.nav-links li a {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--text-primary);
    font-weight: 500;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    margin-right: 15px;
}

/* Side Drawer */
.side-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--bg-secondary);
    z-index: 2000;
    transition: left 0.3s ease;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
}

.side-drawer.active {
    left: 0;
}

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

.drawer-header .logo {
    font-size: 1.8rem;
}

#closeDrawer {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.drawer-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drawer-links li a {
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.drawer-links li a:hover,
.drawer-links li a.active {
    color: var(--accent-color);
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1999;
    display: none;
}

.drawer-overlay.active {
    display: block;
}

/* Modern Search */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--text-muted);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    width: 0;
    opacity: 0;
    transition: width 0.4s ease, opacity 0.4s ease;
    outline: none;
    font-family: inherit;
}

.search-container.active .search-input {
    width: 250px;
    opacity: 1;
}

.search-icon {
    cursor: pointer;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    padding: 5px;
}

/* User Dropdown */
.profile-dropdown {
    position: relative;
    cursor: pointer;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

.dropdown-menu {
    position: absolute;
    top: 45px;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--card-bg);
    border-radius: 4px;
    padding: 10px 0;
    width: 150px;
    display: none;
    flex-direction: column;
}

.profile-dropdown:hover .dropdown-menu {
    display: flex;
}

.dropdown-menu a,
.dropdown-menu button {
    padding: 10px 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    text-decoration: underline;
    color: white;
}

/* Hero Section */
.hero {
    position: relative;
    height: 80vh;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 50px;
    margin-bottom: 20px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, var(--bg-main) 0%, transparent 60%);
}

.hero-content {
    position: relative;
    z-index: 10;
    padding: 0 4%;
    max-width: 50%;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-desc {
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 25px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
    transition: 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background-color: white;
    color: black;
}

.btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

.btn-secondary {
    background-color: rgba(109, 109, 110, 0.7);
    color: white;
}

.btn-secondary:hover {
    background-color: rgba(109, 109, 110, 0.4);
}

/* Horizontal Carousels */
.carousel-container {
    position: relative;
    width: 100%;
}

.carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for carousel but keep functional */
.carousel::-webkit-scrollbar {
    display: none;
}

/* Movie Card */
.movie-card {
    position: relative;
    flex: 0 0 calc(100% / 5 - 8px);
    aspect-ratio: 2/3;
    background-color: var(--card-bg);
    border-radius: 4px;
    cursor: pointer;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .movie-card {
        flex: 0 0 calc(100% / 3 - 7px);
    }
}

@media (max-width: 768px) {
    .movie-card {
        flex: 0 0 calc(100% / 2 - 5px);
    }
}

.movie-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--transition-speed);
}

.movie-card:hover {
    transform: scale(1.05);
    /* Netflix subtle scale */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.movie-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 20px 10px 10px;
    opacity: 0;
    transition: opacity var(--transition-speed);
    display: flex;
    flex-direction: column;
}

.movie-card:hover .movie-overlay {
    opacity: 1;
}

.movie-overlay h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-overlay .meta {
    font-size: 0.75rem;
    display: flex;
    gap: 10px;
    align-items: center;
}

.rating {
    color: var(--green-rating);
    font-weight: 600;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--card-bg) 25%, #444 50%, var(--card-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-load 1.5s infinite;
}

@keyframes skeleton-load {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Authentication Pages (Login/Register) */
.auth-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 100%), url('https://assets.nflxext.com/ffe/siteui/vlv3/f841d4c7-10e1-40af-bcae-07a3f8dc141a/f6d7434e-d6de-4185-a6d4-c77a2d08737b/US-en-20220502-popsignuptwoweeks-perspective_alpha_website_medium.jpg');
    background-size: cover;
}

.auth-box {
    background: rgba(0, 0, 0, 0.85);
    padding: 60px 68px 40px;
    border-radius: 4px;
    width: 100%;
    max-width: 450px;
}

.auth-box h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 28px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form input {
    background: #333;
    border: none;
    border-radius: 4px;
    padding: 16px 20px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
}

.auth-form input:focus {
    outline: none;
    background: #454545;
}

.auth-form button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
    font-family: inherit;
    transition: 0.2s ease;
}

.auth-form button:hover {
    background: #f40612;
}

.auth-error {
    color: #e87c03;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.auth-bottom {
    margin-top: 50px;
    color: var(--text-muted);
}

.auth-bottom a {
    color: white;
}

/* Movie Detail Page specific */
.detail-hero {
    height: 70vh;
}

.detail-content {
    padding: 0 4%;
    margin-top: -200px;
    position: relative;
    z-index: 10;
    display: flex;
    gap: 40px;
    padding-bottom: 50px;
}

.detail-poster {
    width: 300px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    flex-shrink: 0;
}

.detail-info {
    flex: 1;
}

.detail-info h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.detail-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-desc {
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 800px;
}

#youtube-container {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16/9;
    background: black;
    margin-top: 30px;
}

/* Dashboard Specific */
.admin-container {
    padding: 100px 4% 50px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 600;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-box {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
}

@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .hero-content {
        max-width: 70%;
    }

    .section-title {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .hero {
        height: 60vh;
        padding-bottom: 30px;
    }

    .hero-content {
        max-width: 90%;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-desc {
        font-size: 0.95rem;
        -webkit-line-clamp: 4;
    }

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

    .btn {
        width: 100%;
        font-size: 1rem;
    }

    .section-wrapper {
        padding: 0 16px;
    }

    .section-title {
        font-size: 20px;
    }

    /* Detail Page */
    .detail-content {
        flex-direction: column;
        margin-top: -100px;
        align-items: center;
        text-align: center;
    }

    .detail-poster {
        width: 100%;
        max-width: 250px;
        margin-bottom: 20px;
    }

    .detail-info h1 {
        font-size: 2rem;
    }

    .detail-meta {
        justify-content: center;
        flex-wrap: wrap;
    }

    .detail-desc {
        font-size: 1rem;
    }

    /* Profile Page Header */
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding-top: 100px;
    }
}

@media (max-width: 480px) {
    .hero {
        height: 55vh;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-desc {
        font-size: 0.9rem;
    }

    .detail-hero {
        height: 50vh;
    }

    .logo {
        font-size: 1.5rem;
    }

    .search-input {
        position: absolute;
        top: 60px;
        right: 0;
        width: 200px !important;
        background: rgba(0, 0, 0, 0.9);
    }
}