/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --netflix-red: #E50914;
    --netflix-black: #141414;
    --netflix-dark: #000000;
    --netflix-gray: #808080;
    --netflix-light-gray: #B3B3B3;
    --netflix-white: #FFFFFF;
}

body {
    font-family: 'Netflix Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--netflix-black);
    color: var(--netflix-white);
    overflow-x: hidden;
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 10%, transparent);
    transition: background-color 0.3s ease;
    padding: 0 4%;
}

.navbar.scrolled {
    background-color: var(--netflix-black);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

.logo {
    width: auto;
    height: auto;
    cursor: pointer;
}

.logo-svg {
    width: 100%;
    height: 100%;
    fill: var(--netflix-red);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: var(--netflix-white);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--netflix-light-gray);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

/* Source Toggle */
.source-toggle-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.source-toggle-btn:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.1);
}

.source-dropdown {
    display: none;
    position: absolute;
    top: 60px;
    right: 80px;
    /* Adjust based on layout */
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 10px 0;
    z-index: 1002;
    min-width: 150px;
}

.source-dropdown.show {
    display: block;
}

.source-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.source-dropdown a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Hamburger Menu (Mobile Only) */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--netflix-white);
    margin: 3px 0;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.search-btn,
.notifications-btn {
    background: none;
    border: none;
    color: var(--netflix-white);
    cursor: pointer;
    padding: 8px;
    transition: opacity 0.3s ease;
}

.search-btn:hover,
.notifications-btn:hover {
    opacity: 0.7;
}

.profile-menu {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.dropdown-icon {
    color: var(--netflix-white);
    transition: transform 0.3s ease;
}

.profile-menu:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: rgba(0, 0, 0, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    min-width: 200px;
    padding: 4px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.profile-menu:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--netflix-white);
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-item img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.dropdown-item svg {
    width: 20px;
    height: 20px;
}

.dropdown-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.15);
    margin: 4px 0;
}

/* Hero Section */
.hero {
    position: relative;
    height: 80vh;
    display: flex;
    align-items: center;
    padding: 0 4%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8), transparent 50%),
        url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="1920" height="1080"%3E%3Crect width="1920" height="1080" fill="%23333"/%3E%3C/svg%3E');
    background-size: cover;
    background-position: center;
    margin-bottom: -150px;
}

.hero-content {
    max-width: 600px;
    z-index: 1;
    padding-top: 100px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    line-height: 1.1;
}

.hero-description {
    font-size: 1.4rem;
    line-height: 1.4;
    margin-bottom: 30px;
    color: var(--netflix-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
}

.btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 32px;
    font-size: 1.2rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--netflix-white);
    color: var(--netflix-black);
}

.btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.75);
}

.btn-secondary {
    background-color: rgba(109, 109, 110, 0.7);
    color: var(--netflix-white);
}

.btn-secondary:hover {
    background-color: rgba(109, 109, 110, 0.4);
}

.hero-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--netflix-black) 0%, transparent 100%);
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content Rows */
.content {
    padding: 0 4%;
    z-index: 2;
    position: relative;
}

.row {
    margin-bottom: 40px;
}

.row-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--netflix-white);
    transition: color 0.3s ease;
}

.row-title:hover {
    color: var(--netflix-light-gray);
}

.row-container {
    position: relative;
    padding: 0 50px;
}

.row-content {
    display: flex;
    gap: 32px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 20px 0;
}

.row-content::-webkit-scrollbar {
    display: none;
}

.row-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: var(--netflix-white);
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.row-container:hover .row-nav {
    opacity: 1;
}

.row-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.row-nav-left {
    left: 0;
}

.row-nav-right {
    right: 0;
}

.card {
    width: 200px;
    height: 300px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: scale(1.1) translateY(-8px);
    z-index: 5;
    box-shadow: 0 12px 24px rgba(229, 9, 20, 0.4);
}

.card:hover::before {
    opacity: 1;
}

/* Footer */
.footer {
    padding: 50px 4% 30px;
    margin-top: 80px;
    color: var(--netflix-gray);
}

.footer-container {
    max-width: 1000px;
}

.social-links {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.social-links a {
    color: var(--netflix-white);
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--netflix-gray);
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-column a {
    color: var(--netflix-gray);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: var(--netflix-light-gray);
}

.service-code-btn {
    background: none;
    border: 1px solid var(--netflix-gray);
    color: var(--netflix-gray);
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.service-code-btn:hover {
    color: var(--netflix-white);
    border-color: var(--netflix-white);
}

.copyright {
    font-size: 11px;
    color: var(--netflix-gray);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-links {
        gap: 15px;
    }

    .nav-links a {
        font-size: 13px;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-description {
        font-size: 1.2rem;
    }

    .card {
        min-width: 250px;
        height: 141px;
    }
}

@media (max-width: 768px) {
    .navbar-left {
        gap: 15px;
    }

    .nav-links {
        position: fixed;
        top: 68px;
        left: -100%;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        padding: 20px 4%;
        transition: left 0.3s ease;
        z-index: 999;
        gap: 0;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        width: 100%;
        padding: 15px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links a {
        font-size: 16px;
        display: block;
    }

    .hamburger {
        display: flex;
    }

    .logo {
        width: auto;
        height: auto;
        cursor: pointer;
    }

    .navbar-right {
        gap: 15px;
    }

    .hero {
        height: 60vh;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .row-title {
        font-size: 1.2rem;
    }

    .card {
        min-width: 200px;
        height: 113px;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }

    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .navbar-container {
        padding: 0 16px;
    }

    .hero-content {
        padding-top: 80px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 0.9rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .card {
        min-width: 150px;
        height: 84px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content>* {
    animation: fadeIn 0.8s ease-out forwards;
}

.hero-title {
    animation-delay: 0.2s;
}

.hero-description {
    animation-delay: 0.4s;
}

.hero-buttons {
    animation-delay: 0.6s;
}

/* Smooth Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--netflix-black);
}

::-webkit-scrollbar-thumb {
    background: var(--netflix-gray);
    border-radius: 4px;
}

/* Grid Layout for Movies & Series Pages */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 4%;
    justify-content: center;
}

.media-grid .card {
    width: 100%;
    height: 300px;
    /* Force height for consistency */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.media-grid .card:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* Page Title Style */
.page-title {
    padding: 80px 4% 10px;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--netflix-white);
}

/* Pagination / Load More Button */
.pagination {
    display: flex;
    justify-content: center;
    padding: 30px 0 60px;
}

#loadMoreBtn {
    background-color: var(--netflix-red);
    color: white;
    font-weight: bold;
    border-radius: 4px;
    padding: 12px 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#loadMoreBtn:hover {
    background-color: #f40612;
}

/* Genre Filter */
.genre-filter {
    display: flex;
    gap: 12px;
    padding: 0 4% 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.genre-filter::-webkit-scrollbar {
    display: none;
}

.genre-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.genre-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.genre-btn.active {
    background: var(--netflix-red);
    border-color: var(--netflix-red);
}

#loadMoreBtn:disabled {
    background-color: var(--netflix-gray);
    cursor: not-allowed;
}