:root {
    --primary-color: #e50914;
    --background-dark: #0f1014;
    --surface-dark: #18191f;
    --text-primary: #ffffff;
    --text-secondary: #a1a1a1;
    --gradient-overlay: linear-gradient(to top, #0f1014, transparent);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--background-dark);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(15, 16, 20, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-btn:hover,
.nav-btn.active {
    color: var(--text-primary);
}

.login-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

.login-btn:hover {
    transform: scale(1.05);
}

.mobile-menu-btn {
    display: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main Content */
#main-content {
    margin-top: 100px;
    /* Increased to avoid overlap */
    min-height: 80vh;
}

.content-wrapper {
    padding: 2rem 5%;
    /* Added padding for content */
    max-width: 1400px;
    margin: 0 auto;
}

.page-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section */
.hero-section {
    height: 60vh;
    background-image: url('https://image.tmdb.org/t/p/original/mSDsSDwaP3E7dEfUPWy4J0djt4O.jpg');
    /* Placeholder Hero */
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 5%;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #0f1014 0%, rgba(15, 16, 20, 0.8) 50%, transparent 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-content p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-btn {
    padding: 1rem 2.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.cta-btn:hover {
    background: #c40812;
}

.cta-btn.secondary {
    background: transparent;
    border: 1px solid white;
}

.cta-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Categories */
.categories-nav {
    padding: 2rem 5%;
}

.categories-nav h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.category-chips {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.category-chips::-webkit-scrollbar {
    height: 4px;
}

.category-chips::-webkit-scrollbar-thumb {
    background: var(--surface-dark);
    border-radius: 4px;
}

.cat-chip {
    padding: 0.6rem 1.5rem;
    background: var(--surface-dark);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    border-radius: 50px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.cat-chip:hover,
.cat-chip.active {
    background: var(--text-primary);
    color: var(--background-dark);
    border-color: var(--text-primary);
}

/* Movies Grid */
.movies-container {
    padding: 0 5% 4rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.movie-card {
    background: var(--surface-dark);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
}

.movie-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.movie-info {
    padding: 1rem;
}

.movie-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.rating {
    color: #ffd700;
}

.card-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.card-remove-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-content {
    background: var(--surface-dark);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 12px;
    position: relative;
    overflow-y: auto;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: white;
    z-index: 10;
}

.modal-body {
    display: flex;
    flex-direction: column;
}

.modal-hero {
    height: 400px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.modal-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--surface-dark), transparent);
}

.modal-details {
    padding: 2rem;
    margin-top: -100px;
    position: relative;
    z-index: 2;
}

.modal-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.modal-overview {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.cast-list {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.cast-member {
    text-align: center;
    min-width: 100px;
}

.cast-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
}

.cast-name {
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Footer */
footer {
    background: #000;
    padding: 4rem 5% 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.footer-section a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.8rem;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--text-primary);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons i {
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.social-icons i:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Auth Modal Specifics */
.auth-modal-content {
    max-width: 450px;
    background: linear-gradient(145deg, #1a1c23, #131418);
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-form-container {
    padding: 2rem;
    text-align: center;
}

.auth-form-container h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.full-width {
    width: 100%;
    margin-top: 1rem;
}

.auth-switch {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* Search Bar */
.search-bar-container {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 2rem;
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-bar input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s;
}

.search-bar input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Profile Menu */
.auth-container {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-menu {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-icon {
    width: 35px;
    height: 35px;
    border-radius: 4px;
    object-fit: cover;
}

.profile-trigger i {
    font-size: 0.8rem;
    color: var(--text-primary);
    transition: transform 0.3s;
}

.profile-menu.active .profile-trigger i {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: var(--surface-dark);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    z-index: 1001;
}

.dropdown-content.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0.5rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Video Modal */
.video-modal-content {
    background: black;
    width: 90%;
    max-width: 1000px;
    aspect-ratio: 16/9;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container {
    width: 100%;
    height: 100%;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#close-video {
    z-index: 20;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    top: -15px;
    right: -15px;
}

/* Confirmation Modal */
.confirmation-content {
    max-width: 400px;
    background: var(--surface-dark);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 8px;
}

/* Profile Modal */
.profile-details-container {
    color: var(--text-primary);
}

.profile-avatar-large img {
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.3);
}

#profile-logout-btn:hover {
    background: #c40812 !important;
    border-color: #c40812 !important;
}

/* Responsive adjustments */
/* Mobile Side Menu */
.mobile-side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background: #000;
    z-index: 3000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 2rem;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.mobile-side-menu.active {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.close-mobile-menu {
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.close-mobile-menu:hover {
    color: var(--primary-color);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-nav-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s;
    padding: 0.5rem 0;
}

.mobile-nav-link i {
    width: 25px;
    text-align: center;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--primary-color);
    padding-left: 10px;
}

.mobile-search-btn {
    display: none;
}

/* Mobile Auth Section */
.mobile-auth-section {
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
    padding-top: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 5%;
        justify-content: space-between;
    }

    .search-bar-container {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(15, 16, 20, 0.98);
        padding: 1rem;
        margin: 0;
        border-bottom: 1px solid var(--glass-border);
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .search-bar-container.active {
        display: flex;
    }

    .search-bar {
        max-width: 100%;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
        order: 1;
    }

    .logo {
        order: 2;
        font-size: 1.5rem;
    }

    .mobile-search-btn {
        display: block;
        order: 3;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .movies-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .movie-poster {
        aspect-ratio: 2/3;
    }
}