* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #dc2626;
    --dark-red: #991b1b;
    --light-red: #ef4444;
    --black: #000000;
    --dark-gray: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --white: #ffffff;
    --dark-bg: #0f0f0f;
    --header-bg: #1a1a1a;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --dropdown-bg: rgba(0, 0, 0, 0.3);
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --shadow-dark: rgba(0, 0, 0, 0.3);
    --shadow-heavy: rgba(0, 0, 0, 0.5);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-medium: rgba(255, 255, 255, 0.2);
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-faded: rgba(255, 255, 255, 0.7);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--white);
    background-color: var(--dark-bg);
}

/* Header */
.header {
    background-color: var(--header-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px var(--shadow-heavy);
    border-bottom: 1px solid var(--border-light);
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    padding: 5px;
}

.menu-btn span {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    transition: 0.3s;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-red);
    text-decoration: none;
    display: inline-block;
}

.logo h1 {
    font-size: inherit;
    margin: 0;
}

.logo a {
    text-decoration: none;
    color: inherit;
}

.nav-desktop {
    flex: 1;
    margin: 0 30px;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 30px;
    justify-content: center;
}

.nav-list a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-list a:hover {
    color: var(--primary-red);
}

.nav-list a.active {
    color: var(--primary-red);
    position: relative;
}

.nav-list a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-red);
    border-radius: 1px;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown .arrow {
    font-size: 10px;
    margin-left: 5px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--header-bg);
    box-shadow: 0 4px 6px var(--shadow-heavy);
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    min-width: 400px;
    border: 1px solid var(--border-light);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.dropdown-grid a {
    color: var(--white);
    text-decoration: none;
    padding: 5px 10px;
    transition: 0.3s;
    white-space: nowrap;
}

.dropdown-grid a:hover {
    background-color: rgba(220, 38, 38, 0.2);
    color: var(--primary-red);
    border-radius: 4px;
}

/* Search bar */
.search-bar-desktop {
    display: flex;
    background-color: var(--border-light);
    overflow: hidden;
    width: 250px;
    border: 1px solid var(--border-medium);
}

.search-bar-desktop input {
    flex: 1;
    border: none;
    padding: 8px 15px;
    background: none;
    outline: none;
    color: var(--white);
}

.search-bar-desktop input::placeholder {
    color: var(--text-muted);
}

.search-bar-desktop button {
    background: none;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    color: var(--white);
}

.search-icon-mobile {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    color: var(--white);
}

.search-bar-mobile {
    display: none;
    padding: 10px 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.search-bar-mobile.active {
    max-height: 60px;
    display: block;
}

.search-bar-mobile input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-medium);
    background-color: var(--border-light);
    outline: none;
    color: var(--white);
}

.search-bar-mobile input::placeholder {
    color: var(--text-muted);
}

.search-bar-mobile button {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--white);
}

/* Ad area */
.ad-area {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.ad-placeholder {
    width: 100%;
    max-width: 450px;
    aspect-ratio: 2/1;
    background-color: var(--border-light);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 3px dashed var(--border-light);
}

/* Sidebar */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--header-bg);
    z-index: 201;
    transition: 0.3s;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.sidebar-header .logo {
    margin-bottom: 15px;
    display: block;
}

.sidebar-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.sidebar-close:hover {
    color: var(--primary-red);
}

.sidebar-search {
    display: flex;
    background-color: var(--border-light);
    overflow: hidden;
    border: 1px solid var(--border-medium);
}

.sidebar-search input {
    flex: 1;
    border: none;
    padding: 8px 15px;
    background: none;
    outline: none;
    color: var(--white);
}

.sidebar-search input::placeholder {
    color: var(--text-muted);
}

.sidebar-search button {
    background: none;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    color: var(--white);
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav > ul > li > a {
    display: block;
    padding: 15px 20px;
    color: var(--white);
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
    transition: 0.3s;
}

.sidebar-nav > ul > li > a:hover {
    background-color: rgba(220, 38, 38, 0.2);
    color: var(--primary-red);
}

.sidebar-nav > ul > li > a.active {
    background-color: var(--primary-red);
    color: var(--white);
    border-left: 4px solid var(--dark-red);
}

.sidebar-dropdown .dropdown-toggle {
    position: relative;
}

.sidebar-dropdown .arrow {
    position: absolute;
    right: 20px;
    transition: 0.3s;
}

.sidebar-dropdown .dropdown-toggle.active .arrow {
    transform: rotate(180deg);
}

.sidebar-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: 0.3s;
    background-color: var(--dropdown-bg);
}

.sidebar-dropdown-menu.active {
    max-height: 448px;
    overflow-y: auto;
}

.sidebar-dropdown-menu li a {
    display: block;
    padding: 10px 20px 10px 40px;
    color: var(--white);
    text-decoration: none;
    transition: 0.3s;
}

.sidebar-dropdown-menu li a:hover {
    background-color: rgba(220, 38, 38, 0.2);
    color: var(--primary-red);
}

/* Main content */
.wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 300px);
}

/* Main header */
.main-header {
    margin-bottom: 25px;
}

.main-header h2 {
    color: var(--white);
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-align: center;
    position: relative;
}

.main-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-red), var(--dark-red));
    border-radius: 2px;
}

/* Keywords */
.keywords {
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.keyword-btn {
    background-color: var(--black);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.3s;
}

.keyword-btn:hover {
    background-color: var(--primary-red);
    transform: translateY(-2px);
}

/* Filter tabs */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    background-color: var(--dark-gray);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: 0.3s;
    border-radius: 4px;
}

.tab-btn:hover {
    background-color: var(--light-red);
    transform: translateY(-2px);
}

.tab-btn.active {
    background-color: var(--primary-red);
    box-shadow: 0 2px 4px var(--shadow-medium);
}

/* Loading */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 300px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-faded);
    font-size: 16px;
    font-weight: 500;
}

/* Movie grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.movie-card {
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.movie-card:hover {
    transform: translateY(-5px);
}

.movie-poster {
    position: relative;
    width: 100%;
    aspect-ratio: var(--img-aspect-ratio);
    overflow: hidden;
    margin-bottom: 10px;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-ribbon {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 75px;
    height: 75px;
    overflow: hidden;
}

.badge-ribbon span {
    position: absolute;
    display: block;
    width: 100px;
    background-color: var(--primary-red);
    box-shadow: 0 2px 4px var(--shadow-dark);
    color: var(--white);
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    transform: rotate(45deg);
    top: 15px;
    right: -30px;
}

.badge-ribbon::before {
    content: '';
    position: absolute;
    left: 0;
    top: 100%;
    z-index: -1;
    border-left: 3px solid var(--dark-red);
    border-right: 3px solid transparent;
    border-bottom: 3px solid transparent;
    border-top: 3px solid var(--dark-red);
}

.badge-ribbon::after {
    content: '';
    position: absolute;
    right: 0;
    top: 100%;
    z-index: -1;
    border-left: 3px solid transparent;
    border-right: 3px solid var(--dark-red);
    border-bottom: 3px solid transparent;
    border-top: 3px solid var(--dark-red);
}

.movie-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--white);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.page-btn {
    background-color: var(--primary-red);
    color: var(--white);
    border: none;
    padding: 8px 12px;
    min-width: 35px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.3s;
	text-decoration: none;
}

.page-btn:hover {
    background-color: var(--dark-red);
    color: var(--white);
}

.page-btn.active {
    background-color: var(--dark-red);
    color: var(--white);
}

.dots {
    padding: 0 10px;
    color: var(--gray);
	text-decoration: none;
}

/* Footer */
.footer {
    background-color: var(--header-bg);
    color: var(--white);
    padding: 30px 0 20px;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-bottom: 30px;
}

.footer-nav a {
    color: var(--white);
    text-decoration: none;
    transition: 0.3s;
}

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

.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    gap: 4rem;
}

.footer-bottom .logo {
    font-size: 20px;
    display: inline-block;
}

.copyright {
    font-size: 14px;
    color: var(--text-faded);
}

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 6px var(--shadow-light);
    transition: 0.3s;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--dark-red);
    transform: translateY(-3px);
    box-shadow: 0 6px 8px var(--shadow-medium);
}

/* Video player */
.video-section {
    margin-bottom: 30px;
}

.video-container {
    position: relative;
    aspect-ratio: 16/9;
    background-color: var(--black);
    overflow: hidden;
    max-width: 900px;
    margin: 20px auto;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.server-controls {
    display: flex;
    gap: 10px;
}

.server-btn {
    background-color: var(--dark-gray);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.3s;
}

.server-btn:hover {
    background-color: var(--primary-red);
}

.server-btn.active {
    background-color: var(--primary-red);
}

.video-stats {
    display: flex;
    gap: 15px;
    align-items: center;
}

.like-btn, .view-count {
    background-color: var(--dark-gray);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.like-btn:hover {
    background-color: var(--primary-red);
}

.like-btn.liked {
    background-color: var(--primary-red);
    cursor: default;
}

.like-btn.liked svg path {
    fill: var(--white);
}

.view-count {
    cursor: default;
}

.view-count:hover {
    background-color: var(--dark-gray);
}

/* Video description */
.video-description {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--dark-gray);
    border-radius: 4px;
    color: var(--text-faded);
    line-height: 1.6;
}

.video-description p {
    margin: 0;
}

/* Load more button */
.load-more {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.load-more-btn {
    background-color: var(--primary-red);
    color: var(--white);
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: 0.3s;
}

.load-more-btn:hover {
    background-color: var(--dark-red);
    transform: translateY(-2px);
}

.load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner-inline {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--white);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 5px;
}

/* Responsive */
@media (max-width: 1024px) {
    .header-main {
        position: relative;
    }
    
    .menu-btn {
        display: flex;
    }
    
    .header-main .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .nav-desktop,
    .search-bar-desktop {
        display: none;
    }
    
    .search-icon-mobile {
        display: block;
    }
    
    .search-bar-mobile {
        display: none;
        position: relative;
    }
    
    .movie-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .dropdown-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wrapper{
        padding: 30px 15px;
    }
}

@media (max-width: 480px) {
    .keywords {
        justify-content: center;
    }
    
    .keyword-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .filter-tabs {
        gap: 8px;
    }
    
    .tab-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .footer-nav {
        gap: 15px;
        font-size: 14px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

}
