/* =========================================================
   BASE VARIABLES & RESET
   ========================================================= */
:root {
    --bg-color: #0d0f12;           /* Deep dark background */
    --card-bg: #1a1d24;            /* Slightly lighter dark for cards */
    --primary-color: #e50914;      /* Professional Red */
    --primary-hover: #b80710;
    --text-light: #f1f1f1;
    --text-muted: #a0a0a0;
    --imdb-color: #f5c518;         /* Official IMDb Yellow */
    --success-color: #28a745;      /* Green for download buttons */
    --success-hover: #218838;
    --transition-speed: 0.3s;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================================================
   NAVIGATION BAR (HEADER)
   ========================================================= */
header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.navbar {
    background-color: rgba(7, 8, 10, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid #1a1d24;
}

.nav-container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    transition: color var(--transition-speed);
    cursor: pointer;
}

.nav-links a:hover, 
.nav-links a:focus {
    color: var(--primary-color);
    outline: none;
}

/* Genre Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #1a1d24;
    min-width: 180px;
    box-shadow: 0px 10px 25px rgba(0,0,0,0.8);
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #2a2d34;
}

.dropdown-content a {
    color: white;
    padding: 12px 20px;
    display: block;
    font-size: 14px;
    text-transform: capitalize;
    border-bottom: 1px solid #2a2d34;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: var(--primary-color);
    color: white;
    padding-left: 25px;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Hamburger Menu (Mobile) */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    padding: 5px;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background-color: var(--text-light);
    border-radius: 2px;
    transition: var(--transition-speed);
}

/* =========================================================
   SEARCH HERO SECTION
   ========================================================= */
.search-section {
    padding: 70px 20px;
    text-align: center;
    background: linear-gradient(to bottom, rgba(7, 8, 10, 0.8), var(--bg-color)), 
                url('https://via.placeholder.com/1920x600/111/333?text=Cinematic+Background') center/cover no-repeat;
    border-bottom: 1px solid #1a1d24;
}

.search-container h1 {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 2px 4px 10px rgba(0,0,0,0.8);
}

.search-container h2 {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-weight: 400;
}

.search-box {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: 50px;
    overflow: hidden;
}

.search-box input {
    flex: 1;
    padding: 18px 25px;
    border: none;
    font-size: 16px;
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    backdrop-filter: blur(5px);
}

.search-box input::placeholder {
    color: #bbb;
}

.search-box button {
    padding: 18px 40px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background var(--transition-speed);
}

.search-box button:hover {
    background-color: var(--primary-hover);
}

/* =========================================================
   MAIN CONTENT & MOVIE GRID
   ========================================================= */
.main-content {
    max-width: 1250px;
    margin: 40px auto 60px;
    padding: 0 20px;
}

.section-title {
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
    margin-bottom: 30px;
}

.section-title h3 {
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
}

/* Movie Cards (Updated for <a> tag support) */
.movie-card {
    display: block; /* Required because it is now an anchor tag */
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    position: relative;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--text-light);
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(229, 9, 20, 0.4);
    border-color: var(--primary-color);
}

.movie-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    background-color: #222; 
}

/* Badges */
.imdb-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--imdb-color);
    color: #000;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 8px;
    border-radius: 4px;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 8px;
    border-radius: 4px;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.movie-info {
    padding: 15px;
    text-align: center;
}

.movie-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.movie-meta {
    font-size: 13px;
    color: var(--text-muted);
}

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 60px;
    flex-wrap: wrap;
}

.page-btn {
    background-color: var(--card-bg);
    color: var(--text-light);
    border: 1px solid #333;
    padding: 10px 18px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.page-btn:hover:not(:disabled), 
.page-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(229, 9, 20, 0.3);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =========================================================
   SINGLE MOVIE PAGE DETAILS (For your manual HTML pages)
   ========================================================= */
.modal-body {
    display: flex;
    gap: 35px;
    align-items: flex-start; /* Prevents the poster image from stretching vertically */
    padding: 40px 20px;
    max-width: 1250px;
    margin: 0 auto;
}

.modal-portrait {
    width: 320px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    flex-shrink: 0;
}

.modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modal-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #fff;
    line-height: 1.2;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #ddd;
}

.modal-meta span {
    background: #2a2d34;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #3a3d44;
}

.modal-meta span.imdb {
    background: var(--imdb-color);
    color: #000;
    border-color: var(--imdb-color);
    font-weight: bold;
}

.modal-desc {
    margin-bottom: 25px;
    color: #bbb;
    font-size: 15px;
    line-height: 1.8;
    border-bottom: 1px solid #2a2d34;
    padding-bottom: 25px;
}

/* Download Section Styling */
.download-section h4 {
    margin-bottom: 15px;
    font-size: 20px;
    color: var(--text-light);
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

.download-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
}

.dl-btn {
    background-color: var(--success-color);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.dl-btn:hover {
    background-color: var(--success-hover);
    transform: translateY(-3px);
}

/* Series Seasons & Episodes Styling */
.season-container {
    background: #15181e;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #2a2d34;
}

.season-container h5 {
    margin-bottom: 15px;
    font-size: 18px;
    color: var(--primary-color);
    border-bottom: 1px solid #2a2d34;
    padding-bottom: 10px;
}

.episode-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px dashed #333;
}

.episode-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ep-title {
    font-weight: 600;
    font-size: 15px;
    color: #eee;
}

/* =========================================================
   SEO TEXT SECTION
   ========================================================= */
.seo-content {
    line-height: 1.5;
    opacity: 0.7;
    margin-bottom: 20px;
}
.seo-content p {
    text-align: justify;
}
.seo-content strong {
    color: #fff;
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
}

/* =========================================================
   FUTURISTIC BACK TO TOP BUTTON
   ========================================================= */
#backToTopBtn {
    position: fixed;
    bottom: 40px;
    right: 30px;
    z-index: 1500;
    background: rgba(26, 29, 36, 0.8);
    color: #e50914;
    border: 2px solid #e50914;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.6), inset 0 0 10px rgba(229, 9, 20, 0.3);
    backdrop-filter: blur(5px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

#backToTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTopBtn:hover {
    background: #e50914;
    color: #fff;
    box-shadow: 0 0 25px rgba(229, 9, 20, 1), inset 0 0 10px rgba(255, 255, 255, 0.5);
    transform: translateY(-5px) scale(1.1);
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
    background-color: #07080a;
    padding: 50px 20px;
    text-align: center;
    border-top: 1px solid #1a1d24;
}

.footer-logo {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.footer-logo span {
    color: var(--primary-color);
}

.footer p {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 700px;
    margin: 0 auto 15px;
    line-height: 1.8;
}

.footer a:hover {
    color: var(--primary-color) !important;
}

/* =========================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================= */

@media (max-width: 1024px) {
    .movie-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .modal-portrait {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #07080a;
        position: absolute;
        top: 65px;
        left: 0;
        padding: 20px 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.9);
        border-top: 1px solid #1a1d24;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        padding: 15px 0;
        display: block;
        width: 100%;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        display: none;
        background: #111;
        max-height: 250px;
        border: none;
        border-radius: 0;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .search-container h1 { font-size: 28px; }
    .search-container h2 { font-size: 15px; }
    .search-box { flex-direction: column; border-radius: 8px; }
    .search-box input { border-radius: 8px 8px 0 0; }
    .search-box button { border-radius: 0 0 8px 8px; padding: 15px; }

    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .movie-title { font-size: 14px; }
    .movie-meta { font-size: 12px; }

    .modal-body {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 20px;
    }

    .modal-portrait {
        width: 220px;
        margin-bottom: 10px;
    }

    .modal-title {
        text-align: center;
        font-size: 24px;
    }

    .modal-meta {
        justify-content: center;
    }
    
    .modal-desc {
        text-align: justify;
    }
    
    #backToTopBtn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .movie-grid {
        gap: 10px;
    }
    .movie-card img {
        aspect-ratio: 2/3;
    }
    .modal-portrait {
        width: 180px;
    }
    .dl-btn {
        width: 100%;
    }
    .pagination {
        gap: 5px;
    }
    .page-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}