/* --- General Setup --- */
:root {
    --primary-color: #e50914;
    --secondary-color: #e50914a6;
    /* Netflix-like Red */
    --background-color: #141414;
    /* Dark Background */
    --surface-color: #23252a;
    /* Slightly lighter surface */
    --text-color: #ffffff;
    --text-color-secondary: #a0a0a0;
    --border-radius: 8px;
    --transition-speed: 0.3s;
    --font-family: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Loader Animation --- */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loader {
    display: flex;
}

.loader .dot {
    position: relative;
    width: 1.5em;
    height: 1.5em;
    margin: 0.8em;
    border-radius: 50%;
}

.loader .dot::before {
    position: absolute;
    content: "";
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    animation: wave 2s ease-out infinite;
}

.loader .dot:nth-child(1) {
    background: #e50914;
}

.loader .dot:nth-child(1)::before {
    animation-delay: 0.2s;
}

.loader .dot:nth-child(2) {
    background: #ffffff;
}

.loader .dot:nth-child(2)::before {
    animation-delay: 0.4s;
}

.loader .dot:nth-child(3) {
    background: #e50914;
}

.loader .dot:nth-child(3)::before {
    animation-delay: 0.6s;
}

@keyframes wave {

    50%,
    75% {
        transform: scale(2.5);
    }

    80%,
    100% {
        opacity: 0;
    }
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}


/* --- Header --- */
.main-header {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.main-nav .nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    transition: color var(--transition-speed);
    padding: 0.5rem;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
}

.main-nav a i {
    margin-right: 0.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    display: flex;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.search-box input {
    border: none;
    background: transparent;
    padding: 0.6rem;
    color: var(--text-color);
    outline: none;
    width: 200px;
}

.search-box button {
    background: var(--primary-color);
    border: none;
    color: var(--text-color);
    padding: 0.6rem 1rem;
    cursor: pointer;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- Hero Carousel --- */
.hero-section {
    padding: 4rem 0;
    overflow: hidden;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

.carousel {
    position: relative;
    height: 450px;
    /* Adjust as needed */
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-item {
    position: absolute;
    width: auto;
    height: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.5s, opacity 0.5s, z-index 0.5s;
    opacity: 0.5;
    z-index: 1;

}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-fit: contain;
    /* maintains aspect ratio while fitting within container */
    display: block;
    /* removes any extra space below the image */
}

.carousel-item.active {
    transform: scale(1);
    opacity: 1;
    z-index: 3;
}

.carousel-item:not(.active) {
    transform: scale(0.9);
}

.carousel-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.carousel-item-info h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.btn-watch {
    display: inline-block;
    background: var(--primary-color);
    color: var(--text-color);
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    margin-top: 1rem;
    transition: background-color var(--transition-speed);
}

.btn-watch:hover {
    background-color: #b80710;
}

/* --- Anime Grid --- */
.anime-grid-section {
    padding: 2rem 0;
}

.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.anime-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform var(--transition-speed);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.anime-card:hover {
    transform: scale(1.05);
}

.anime-card img {
    aspect-ratio: 2/3;
    object-fit: cover;
}


.anime-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 20%, transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.anime-card:hover .anime-card-overlay {
    opacity: 1;
}

.anime-card-overlay .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    font-size: 3rem;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.anime-card:hover .play-icon {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.anime-card-overlay h3 {
    font-size: 1.2rem;
    color: var(--text-color);
}

.anime-card-overlay p {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}


/* --- Footer --- */
.main-footer {
    background: var(--surface-color);
    padding: 3rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.social-links {
    margin: 1.5rem 0;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    margin: 0 1rem;
    transition: color var(--transition-speed);
}

.social-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

/* --- Anime Page Specific --- */
.anime-details-header {
    padding: 4rem 0;
    background-size: cover;
    background-position: center;
    position: relative;
}

.anime-details-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(20, 20, 20, 1) 30%, rgba(20, 20, 20, 0.5));
}

.anime-details-content {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.anime-poster img {
    width: 250px;
    border-radius: var(--border-radius);
}

.anime-info h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
}

.anime-info .genres {
    margin: 1rem 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.anime-info .genre-tag {
    background: var(--surface-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.anime-info .synopsis {
    max-width: 600px;
    margin: 1rem 0;
}

.anime-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
}

.btn-secondary {
    background: var(--surface-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
}

.episode-section {
    padding: 2rem 0;
}

.episode-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.episode-item a {
    display: block;
    background: var(--surface-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: background-color 0.3s;
}

.episode-item a:hover {
    background-color: #3a3d42;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-header .container {
        position: relative;
    }

    .main-nav.active {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--background-color);
        padding: 1rem 0;
    }

    .main-nav.active .nav-links {
        flex-direction: column;
        align-items: center;
    }

    .anime-details-content {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .header-actions {
        gap: 0.5rem;
    }

    .search-box input {
        width: 120px;
    }

    .carousel {
        height: 350px;
    }

    .carousel-item-info h3 {
        font-size: 1.8rem;
    }

    .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 576px) {
    .logo {
        font-size: 1.5rem;
    }

    .search-box {
        display: none;
    }

    /* Hide search box on very small screens, or handle differently */
    .anime-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .footer-content {
        text-align: center;
    }
}


/* --- Browse Page & Filter Controls --- */
.browse-section {
    padding: 2rem 0;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2.5rem;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    font-weight: 500;
}

.control-group select {
    background-color: #3a3d42;
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.75rem;
    font-family: var(--font-family);
    font-size: 1rem;
    min-width: 150px;
}

.btn-filter {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color var(--transition-speed);
}

.btn-filter:hover {
    background-color: #b80710;
}

.btn-filter i {
    margin-right: 0.5rem;
}

/* --- Pagination --- */
.pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.pagination ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
}

.pagination .page-link {
    display: block;
    padding: 0.8rem 1.2rem;
    background-color: var(--surface-color);
    color: var(--text-color);
    border-radius: 6px;
    transition: background-color var(--transition-speed);
    font-weight: 500;
}

.pagination .page-link:hover,
.pagination .page-link.active {
    background-color: var(--primary-color);
    color: var(--text-color);
}

.pagination .page-link.disabled {
    color: var(--text-color-secondary);
    pointer-events: none;
}

.pagination .page-link i {
    font-size: 0.8rem;
}

/* --- Responsive Adjustments for Filters --- */
@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group select {
        width: 100%;
    }
}


/* Added styles for search suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #2d2d2d;
}

.suggestion-item:hover {
    background: #2a2a2a;
}

.suggestion-item img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    margin-right: 12px;
    border-radius: 4px;
}

.suggestion-item .title {
    font-weight: 600;
    margin-bottom: 4px;
}

.suggestion-item .genres {
    font-size: 12px;
    color: #aaa;
}

.hidden {
    display: none !important;
}

/* download vbv */
.download-options {
    text-align: center;
    background: var(--surface-color);
    padding: 20px;
    margin: 0 auto;
    border-radius: 8px;
}

/* Default style for desktop */
.download-options .btn {
    font-size: 16px;
    /* Default button text size */
    padding: 10px 20px;
    /* Default padding */
    margin: 5px;
    /* Spacing between buttons (if multiple) */
}

/* Mobile responsiveness (applies below 768px) */
@media (max-width: 768px) {
    .download-options {
        display: flex;
        flex-direction: column;
        /* Stacks buttons vertically */
        align-items: center;
        /* Centers buttons */
        gap: 5px;
        /* Adds space between stacked buttons */
    }

    .download-options .btn {
        width: 100%;
        /* Full width (1x1 button) */
        /* max-width: 150px; */
        /* Optional: Limits button width */
        font-size: 14px;
        /* Smaller text on mobile */
        padding: 8px 12px;
        /* Adjust padding for smaller screens */
    }
}



/* Additional styles for enhanced buttons and layout */
a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #c00812;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--dark-secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #333;
    transform: translateY(-2px);
}

.movie-detail-header {
    position: relative;
}

.movie-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.download-options {
    margin-top: 30px;
}

.download-quality {
    background-color: var(--dark-secondary);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}

.download-quality h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-quality h3::before {

    font-size: 16px;
}

.download-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background-color: rgba(229, 9, 20, 0.1);
    border-radius: var(--border-radius);
    color: var(--dark-text);
    transition: var(--transition);
    border: 1px solid rgba(229, 9, 20, 0.3);
}

.download-btn:hover {
    background-color: rgba(229, 9, 20, 0.2);
    transform: translateY(-3px);
}

.download-btn .server {
    font-weight: 600;
}

.download-btn .size {
    font-size: 12px;
    opacity: 0.8;
}

.download-btn i {
    margin-left: 10px;
    color: var(--primary-color);
}

.movie-info {
    padding: 15px;
}

.movie-title {
    font-size: 16px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray-text);
    margin-bottom: 10px;
}

.movie-meta i {
    color: var(--primary-color);
    margin-right: 3px;
}

.movie-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 15px;
}

.movie-tags span {
    background-color: rgba(229, 9, 20, 0.1);
    color: var(--primary-color);
    padding: 3px 8px;
    border-radius: 50px;
}

.movie-languages {
    margin-top: 25px;
}

.movie-languages button {
    padding: 8px 15px;
    margin-right: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    background-color: black;
    border: none;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.movie-languages button.active {
    background-color: black;
    color: white;
}

.movie-languages button:hover {
    background-color: #333;
    color: white;
}

.hero-actions {
    display: flex;
    gap: 15px;
}

/* Base button styles */
.btn-primary,
.btn-secondary {
    color: #fff;
    background-color: #e50914;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #5c5c5c;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Container for the button bar */
.button-bar {
    display: flex;
    flex-direction: row;
    /* Default horizontal layout */
    flex-wrap: wrap;
    gap: 8px;
    /* Space between buttons */
    justify-content: flex-start;
    align-items: center;
    padding: 8px;
}

/* Stack vertically on small devices */
@media (max-width: 768px) {
    .button-bar {
        flex-direction: column;
        align-items: stretch;
        /* Makes buttons full width */
    }

    .button-bar .btn-primary,
    .button-bar .btn-secondary {
        width: 100%;
        /* Full width buttons on small screens */
        margin: 4px 0;
        /* Vertical spacing only */
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .download-links {
        grid-template-columns: 1fr;
    }

    .movie-actions {
        flex-direction: column;
    }

    .movie-actions .btn {
        width: 100%;
    }
}

.premium-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: gold;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.anime-card {
    position: relative;
    /* This is needed for absolute positioning of the tag */
}

/* Cast Grid Container */
.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

/* Individual Cast Member Item */
.cast-item {
    background: #1a1a2e;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cast-item:hover {
    transform: translateY(-5px);
}

/* Cast Photo Container */
.cast-photo {
    position: relative;
    width: 100%;
    padding-top: 140%;
    /* Creates a square aspect ratio */
    overflow: hidden;
}

.cast-photo img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cast-item:hover .cast-photo img {
    transform: scale(1.05);
}

/* Cast Info Text */
.cast-item h4 {
    margin: 10px 0 5px;
    padding: 0 10px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-align: center;
}

.cast-item p {
    margin: 0 0 10px;
    padding: 0 10px;
    font-size: 14px;
    color: #a1a1a1;
    text-align: center;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }

    .cast-item h4 {
        font-size: 14px;
    }

    .cast-item p {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
}


/* Screenshots Container */
.screenshot-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Individual Screenshot - Portrait Style */
.screenshot {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    background: #1a1a2e;
    aspect-ratio: 2/3;
    /* Portrait aspect ratio similar to cast photos */
}

.screenshot:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.screenshot:hover img {
    transform: scale(1.03);
}

/* Screenshot Caption */
.screenshot-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    font-size: 14px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.screenshot:hover .screenshot-caption {
    transform: translateY(0);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .screenshot-info {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .screenshot-info {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
}


.download-options-container {
    position: relative;
    height: auto;
    overflow: hidden;
}

.download-options-page {
    display: none;
    transition: transform 0.5s ease;
}

.download-options-page.active-page {
    display: block;
}

.download-options-page.slide-out-left {
    transform: translateX(-100%);
}

.download-options-page.slide-out-right {
    transform: translateX(100%);
}

.download-options-page.slide-in-left {
    transform: translateX(0);
    animation: slideInLeft 0.5s forwards;
}

.download-options-page.slide-in-right {
    transform: translateX(0);
    animation: slideInRight 0.5s forwards;
}

@keyframes slideInLeft {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

.download-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}

.page-btn,
.page-number {
    background: none;
    border: none;
    padding: 5px 10px;
    margin: 0 5px;
    cursor: pointer;
    font-size: 16px;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-number.active {
    font-weight: bold;
    text-decoration: underline;
}

.movie-poster {

    border-radius: 8px;
    overflow: hidden;

    transition: transform 0.3s ease;
}

.movie-poster:hover {
    transform: scale(1.03);
}

/* Add to your existing CSS */
.mobile-search-box {
    display: none;
    padding: 1rem;
    width: 100%;
}

.main-nav.active .mobile-search-box {
    display: flex;
}

.mobile-search-box input {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    background: var(--background-color-light);
    color: var(--text-color);
}

.mobile-search-box button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    cursor: pointer;
}

/* Hide the desktop search box on mobile */
@media (max-width: 992px) {
    .search-box {
        display: none;
    }
}

/* Mobile search suggestions */
.mobile-search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--background-color);
    border-radius: 0 0 8px 8px;

    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.mobile-search-suggestions .suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--background-color-light);
}

.mobile-search-suggestions .suggestion-item:hover {
    background-color: var(--background-color-light);
}

.mobile-search-suggestions .suggestion-item img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 4px;
}

.mobile-search-suggestions .suggestion-item .title {
    font-weight: 600;
    margin-bottom: 4px;
}

.mobile-search-suggestions .suggestion-item .genres {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Position the mobile suggestions container properly */
.main-nav.active .mobile-search-box {
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--surface-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}


/* --- Content Type Filter Tabs --- */
.content-type-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.content-type-btn {
    background: var(--surface-color);
    color: var(--text-color-secondary);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
    white-space: nowrap;
}

.content-type-btn:hover {
    background: #3a3d42;
    color: var(--text-color);
}

.content-type-btn.active {
    background: var(--primary-color);
    color: var(--text-color);
}

/* For mobile devices */
@media (max-width: 768px) {
    .content-type-tabs {
        overflow-x: auto;
        padding-bottom: 0.5rem;
        margin: 0 -1rem 1.5rem;
        padding: 0 1rem 0.5rem;
        scrollbar-width: none;
        /* Firefox */
    }

    .content-type-tabs::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .content-type-btn {
        flex: 0 0 auto;
    }
}