:root {
    --primary: #0ea5e9;
    --bg-dark: #12121c;
    --bg-card: rgba(18, 18, 28, 0.98);
    --bg-light: #2a2a3c;
    --text-main: #ffffff;
    --text-dim: #b5b5b5;
    --nav-height: 65px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: auto;
    scroll-padding-top: 0;
}

@media (min-width: 768px) {
    html {
        scroll-behavior: smooth;
        scroll-padding-top: var(--nav-height);
    }
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    padding-bottom: 0;
    min-height: 100vh;
    overscroll-behavior-y: none;
}

@media (min-width: 768px) {
    body {
        scrollbar-gutter: stable;
    }
}

main {
    padding-top: 0;
}

/* --- HEADER --- */
.header {
    height: var(--nav-height);
    background: linear-gradient(180deg, var(--bg-dark) 0%, rgba(18, 18, 28, 0.4) 90%, transparent 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 5000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: background, backdrop-filter;
}

.header.scrolled {
    background: linear-gradient(180deg, var(--bg-dark) 10%, rgba(18, 18, 28, 0.4) 50%, transparent 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1250px;
    gap: 10px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
}

@media (min-width: 480px) {
    .header-content {
        padding: 0 25px;
    }
}

@media (min-width: 768px) {
    .header-content {
        padding: 0 40px;
    }
}

@media (min-width: 1024px) {
    .header-content {
        padding: 0 50px;
    }
}

@media (min-width: 1280px) {
    .header-content {
        padding: 0 60px;
    }
}

.logo {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 22px;
    font-weight: 800;
    font-style: italic;
    white-space: nowrap;
    min-width: 110px;
    overflow: hidden;
}

.logo h1 span {
    background: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 2px;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.navbar-search {
    display: none;
    align-items: center;
    background: var(--bg-dark) 10%, rgba(18, 18, 28, 0.4) 50%, transparent 100%;
    border-radius: 8px;
    padding: 0 15px;
    gap: 10px;
    position: relative;
    flex: 1;
    max-width: 500px;
    min-width: 200px;
}

.navbar-search i {
    color: white;
    font-size: 20px;
}

.navbar-search input {
    background: none;
    border: none;
    color: white;
    padding: 10px 0;
    width: 100%;
    outline: none;
    font-size: 14px;
}

.navbar-search input::placeholder {
    color: white;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: 8px;
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 9000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-dropdown.active {
    display: block;
}

.search-dropdown .search-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
}

.search-dropdown .search-item:hover {
    background: var(--bg-light);
}

.search-dropdown .search-item img {
    width: 50px;
    height: 78.79px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.search-dropdown .search-item > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-height: 70px;
}

.search-dropdown .search-item h4 {
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    margin-bottom: 4px;
}

.search-dropdown .search-item span {
    color: var(--primary);
    font-size: 12px;
    margin-top: none;
}

.search-toggle,
.menu-toggle {
    background: var(--bg-dark) 10%, rgba(18, 18, 28, 0.4) 50%, transparent 100%;
    border: none;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-toggle:hover,
.menu-toggle:hover {
    transform: scale(1.1);
}

/* --- SEARCH OVERLAY --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: transparent;
    z-index: 6000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active {
    background: transparent;
    pointer-events: all;
    opacity: 1;
}

.search-header {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 15px;
    background: rgba(18, 18, 28, 0.98);
    height: var(--nav-height);
}

.search-overlay:not(.active) .search-header {
    display: none;
}

.search-input-wrapper {
    flex: 1;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.search-input-wrapper i {
    color: var(--text-dim);
    font-size: 20px;
}

.search-input-wrapper input {
    background: none;
    border: none;
    color: white;
    padding: 12px;
    width: 100%;
    outline: none;
    font-size: 16px;
}

.btn-filters {
    background: #2a2a3c;
    color: var(--text-dim);
    border: none;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.close-search {
    background: rgba(18, 18, 28, 0.98);
    color: var(--primary);
    border: 1px solid var(--primary);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 28px;
    cursor: pointer;
}

.search-results-list {
    margin-top: 0px;
    padding: 0;
    max-height: calc(100vh - var(--nav-height) - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.search-results-list .search-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    background: var(--bg-card);
    margin-bottom: 0;
    border-radius: 0;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
}

.search-results-list .search-item:hover {
    background: var(--bg-light);
}

.search-results-list .search-item img {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.search-results-list .search-item > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-height: 70px;
}

.search-results-list .search-item h4 {
    font-size: 14px;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.search-results-list .search-item span {
    color: var(--primary);
    font-size: 12px;
    margin-top: none;
}

/* --- SIDEBAR --- */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: var(--bg-card);
    z-index: 7000;
    padding-top: var(--nav-height);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
    will-change: transform;
}

.sidebar.active {
    transform: translateX(300px);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 20px;
}

.close-sidebar {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 28px;
    cursor: pointer;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transform: translateX(5px);
}

.sidebar-item.active {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.sidebar-item i {
    font-size: 22px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 6500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(0px);
    will-change: opacity;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
    backdrop-filter: blur(4px);
}

/* --- HERO SECTION --- */
.hero {
    height: calc(75vh + var(--nav-height));
    padding: calc(30px + var(--nav-height)) 20px 30px 20px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-dark);
    position: relative;
    margin-top: 0;
    overflow: hidden;
    will-change: transform;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, var(--bg-dark) 10%, rgba(18, 18, 28, 0.4) 50%, transparent 100%);
    z-index: 1;
}



.hero-content {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 1130px;
    margin: 0 auto;
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content h2 {
    font-size: 30px;
    margin-bottom: 2px;
}

.hero-meta {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-dim);
}

.badge {
    color: var(--primary);
    font-weight: bold;
}

.status {
    color: #4ade80;
}

.status i {
    font-size: 8px;
    vertical-align: middle;
}

.hero-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.hero-tags span {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-content p {
    font-size: 15px;
    color: var(--text-dim);
    margin-bottom: 25px;
    max-height: 4.5em;
    overflow-y: auto;
    line-height: 1.5;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.hero-content p::-webkit-scrollbar {
    width: 4px;
}

.hero-content p::-webkit-scrollbar-track {
    background: transparent;
}

.hero-content p::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.btn-play-hero {
    background: white;
    color: black;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}

.btn-play-hero:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: space-between;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    width: fit-content;
}

.volume-control i {
    color: white;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.volume-slider {
    width: 80px;
    height: 4px;
    cursor: pointer;
    accent-color: white;
}

.carousel-controls {
    display: flex;
    gap: 10px;
    order: 10;
    margin-left: auto;
}

.carousel-btn {
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

/* --- MOVIES CONTAINER --- */
.movies-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    will-change: transform;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.category-header h2 {
    font-size: 18px;
    flex-shrink: 0;
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    .category-header {
        flex-wrap: nowrap;
    }

    .filters {
        width: auto;
        max-width: none;
        flex-shrink: 0;
    }
}

.filters::-webkit-scrollbar {
    display: none;
}

.filter-select {
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    flex: 1;
    min-width: 70px;
    white-space: nowrap;
    cursor: pointer;
}

.filter-select option {
    background: var(--bg-card);
    color: white;
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    will-change: contents;
}

.movie-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.movie-card:hover {
    transform: scale(1.02);
}

.movie-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.movie-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 15px;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.movie-card-overlay h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: white;
    line-height: 1.3;
    max-height: 2.6em;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.movie-card-overlay h3::-webkit-scrollbar {
    width: 4px;
}

.movie-card-overlay h3::-webkit-scrollbar-track {
    background: transparent;
}

.movie-card-overlay h3::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.movie-card-overlay p {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 15px;
    max-height: 15em;
    overflow-y: auto;
    line-height: 1.5;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.movie-card-overlay p::-webkit-scrollbar {
    width: 4px;
}

.movie-card-overlay p::-webkit-scrollbar-track {
    background: transparent;
}

.movie-card-overlay p::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

@media (max-width: 767px) {
    .btn-play-hero span {
        display: none;
    }

    .btn-play-hero {
        padding: 12px 12px;
        border-radius: 50%;
    }

    .hero-buttons {
        gap: 5px;
    }

    .movie-card-overlay h3 {
        max-height: 2.6em;
        line-height: 1.3;
        overflow: hidden;
        display: -webkit-box;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .movie-card-overlay p {
        max-height: 9em;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    }

    .movie-card-overlay p::-webkit-scrollbar {
        width: 4px;
    }

    .movie-card-overlay p::-webkit-scrollbar-track {
        background: transparent;
    }

    .movie-card-overlay p::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }
}

.movie-card-overlay .movie-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.movie-card-overlay .btn-play-card {
    background: white;
    color: black;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
    margin: 0;
}

.movie-card-overlay .btn-play-card span {
    display: none;
}

.movie-card-overlay .btn-play-card:hover {
    transform: scale(1.05);
    background: var(--primary);
    color: white;
}

/* --- PAGINATION --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 20px;
}

.page-btn {
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-dark);
    border-color: var(--primary);
    transform: scale(1.1);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-btn i {
    font-size: 20px;
}

/* --- RESPONSIVE --- */
@media (min-width: 480px) {
    .movies-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .movie-card img {
        height: 250px;
    }

    .hero-content h2 {
        font-size: 32px;
    }

    .movies-container {
        padding: 25px;
    }

    .filter-select {
        min-width: 100px;
        max-width: 140px;
    }
}

@media (min-width: 768px) {
    .navbar-search {
        display: flex;
    }

    .search-toggle {
        display: none;
    }

    .movies-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .hero {
        height: calc(70vh + var(--nav-height));
        padding: calc(40px + var(--nav-height)) 40px 40px 40px;
    }

    .hero-content {
        max-width: calc(1130px - 80px);
    }

    .hero-content h2 {
        font-size: 42px;
    }

    .hero-buttons {
        gap: 10;
    }

    .movie-card img {
        height: 280px;
    }

    .movie-card-overlay p {
        max-height: 18em;
    }

    .logo h1 {
        font-size: 26px;
    }

    .movies-container {
        padding: 40px;
    }

    .category-header h2 {
        font-size: 22px;
    }

    .filter-select {
        min-width: 120px;
        max-width: none;
    }
}

@media (min-width: 1024px) {
    .movies-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .hero {
        height: calc(80vh + var(--nav-height));
        padding: calc(60px + var(--nav-height)) 60px 60px 60px;
    }

    .hero-content {
        max-width: calc(1250px - 120px);
    }

    .hero-content h2 {
        font-size: 48px;
    }

    .movie-card img {
        height: 320px;
    }

    .movies-container {
        padding: 50px;
    }
}

@media (min-width: 1280px) {
    .movies-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .hero {
        height: 85vh;
    }

    .hero-content h2 {
        font-size: 52px;
    }

    .movie-card img {
        height: 350px;
    }

    .movies-container {
        padding: 60px;
        max-width: 1250px;
    }
}

/* --- FOOTER --- */
footer {
    background: var(--bg-card);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px 20px;
    margin-top: 10px;
}

.footer-content {
    color: 1px solid rgba(255, 255, 255, 0.3);
    max-width: 1130px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-social {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.footer-social a {
    color: var(--text-dim);
    font-size: 24px;
    transition: color 0.3s;
    text-decoration: none;
}

.footer-social a:hover {
    color: var(--primary);
}

.footer-bottom p {
    color: var(--text-dim);
    font-size: 14px;
    text-align: center;
}