:root {
    --theme-color: #ff3565;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1a1a1a;
    color: #e5e5e5;
    line-height: 1.6;
}

.container {
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #1a1a1a;
    padding: 15px 0;
    /*position: sticky;*/
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo h1 {
    color: var(--theme-color);
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 1px;
    white-space: nowrap;
}

.logo h1 a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
    padding-left: 80px;
}


.search-bar {
    display: flex;
    flex: 1;
    max-width: 500px;
    position: relative;
    margin-right: 180px;
}

.search-bar input {
    flex: 1;
    background-color: #282828;
    border: 1px solid #282828;
    color: #ccc;
    padding: 0 .8em;
    height: 40px;
    box-shadow: 0 0 1px #ffffff4d, inset 0 0 5px #000;
    border-radius: 4px;
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--theme-color);
}

.search-bar button {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 20px;
    background: var(--theme-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: var(--theme-color);
    filter: brightness(0.9);
}

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

.menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: #e5e5e5;
    transition: 0.3s;
}

/* Navigation */
.navigation {
    background: #1a1a1a;
}

.nav-list {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-list li a, .nav-list > a {
    display: block;
    cursor: pointer;
    align-content: center;
    height: 50px;
    padding: 0 1.5em;
    font-size: .875em;
    color: #fff;
    background: linear-gradient(180deg, #0000004d 0, #0000 70%);
    margin-right: 2px;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}

.nav-list li a:hover, .nav-list > a:hover, .nav-list li.active a:hover {
    color: var(--theme-color);
}

/* Active state for navigation items */
.nav-list li a.active, .nav-list > a.active, .nav-list li.active a {
    color: var(--theme-color);
    background: linear-gradient(180deg, #00000080 0, #0000 70%);
    position: relative;
}

.nav-list li a.active::after, .nav-list > a.active::after, .nav-list li.active a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--theme-color);
}

/* Sidebar Mobile */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: rgba(26, 26, 26, 0.95);
    z-index: 1001;
    transition: left 0.3s ease;
    overflow-y: auto;
    border-radius: 0 20px 20px 0;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
}

.sidebar-header h2 {
    color: var(--theme-color);
    font-size: 28px;
}

.sidebar-header h2 a {
    color: inherit;
    text-decoration: none;
}

.close-btn {
    background: none;
    border: none;
    color: #e5e5e5;
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
}

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

.sidebar-nav li a {
    display: block;
    padding: 15px 20px;
    color: var(--theme-color);
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}

.sidebar-nav li a:hover {
    background: #2a2a2a;
    color: var(--theme-color);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
}

.overlay.active {
    display: block;
}

/* Main Content */
.main-content {
    padding: 20px 0;
    min-height: calc(100vh - 200px);
}

.content-wrapper {
    display: grid;
    grid-template-columns: 7fr 2fr;
    gap: 30px;
}

.section-header {
    color: #e5e5e5;
    font-size: 20px;
    margin: 20px 0;
    padding-left: 10px;
    border-left: 6px solid var(--theme-color);
    background: #282828;
}

.section-count {
    color: #b3b3b3;
    font-size: 14px;
    margin: 10px 0;
}

/* Movie Grid */
.movie-section {
    width: 100%;
}

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

.movie-item {
    cursor: pointer;
    transition: transform 0.3s;
    text-decoration: none;
    color: inherit;
}

.movie-item:hover {
    transform: scale(1.05);
}

.movie-poster {
    aspect-ratio: var(--img-aspect-ratio);
    overflow: hidden;
    border-radius: 8px;
    background: #2a2a2a;
    margin-bottom: 10px;
    position: relative;
}

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

.movie-title {
    font-size: 14px;
    color: #e5e5e5;
    font-weight: 500;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: calc(1.4em * 2);
}

/* Sidebar Section */
.sidebar-section {
    width: 100%;
}

.sidebar-movies {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-movie {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    transition: transform 0.3s;
    text-decoration: none;
    color: inherit;
}

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

.sidebar-poster {
    flex-shrink: 0;
    width: 120px;
    aspect-ratio: var(--img-aspect-ratio);
    overflow: hidden;
    border-radius: 8px;
    background: #2a2a2a;
    position: relative;
}

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

.sidebar-title {
    flex: 1;
    font-size: 14px;
    color: #e5e5e5;
    font-weight: 500;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: calc(1.4em * 2);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    margin-bottom: 20px;
	flex-wrap: wrap;
}

.page-link {
    padding: 8px 12px;
    background: #2a2a2a;
    color: #b3b3b3;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s, color 0.3s;
    min-width: 40px;
    text-align: center;
}

.page-link:hover,
.page-link.active {
    background: var(--theme-color);
    color: white;
}

.page-dots {
    color: #b3b3b3;
    font-size: 14px;
    padding: 8px 4px;
    font-weight: bold;
}

/* External Links Section */

.external-links .section-header {
    font-size: 18px;
}

.link-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-list li a {
    display: block;
    color: #b3b3b3;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s, color 0.3s;
}

.link-list li a:hover {
    background: #2a2a2a;
}

/* Footer */
.footer {
    background: #1a1a1a;
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid #333;
}

.footer-logo h2 {
    color: var(--theme-color);
    font-size: 24px;
    margin-bottom: 10px;
}

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

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 15px 0;
}

.footer-nav a {
    color: var(--theme-color);
    text-decoration: none;
    font-size: 14px;
}

.copyright {
    color: #666;
    font-size: 14px;
}

/* Responsive Design */
/* Tablet - max width 1024px */
@media (max-width: 1024px) {
    /* Main Content */
    .content-wrapper {
        grid-template-columns: 8fr 2fr;
        gap: 25px;
    }
    
    .logo h1 a {
        padding: 0;
    }
    
.search-bar {
    margin-right: 0;
    }

    /* Movie Grid - 3 columns */
    .movie-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
    
    /* Sidebar - vertical layout */
    .sidebar-movie {
        display: block;
        text-align: center;
    }
    
    .sidebar-poster {
        width: auto;
        max-width: 200px;
        margin: 0 auto 8px auto;
    }
    
    .sidebar-title {
        text-align: center;
        font-size: 13px;
    }
}

/* Mobile - max width 767px */
@media (max-width: 767px) {
    /* Container */
    .container {
        padding: 0 10px;
    }


    .footer {
        margin-top: 0;
    }
    
    /* Header - 2 dòng layout */
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    /* Dòng 1: Logo và Menu button */
    .header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    /* Menu button - show trên mobile */
    .menu-btn {
        display: flex;
    }
    
    /* Search bar - full width trên dòng thứ 2 */
    .search-bar {
        margin-right: 0;
        max-width: none;
        width: 100%;
    }
    
    /* Navigation - ẩn trên mobile */
    .navigation {
        display: none;
    }
    
    /* Content Layout - single column, sidebar below movie section */
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* Movie Grid - 2 columns */
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Sidebar Movies - use grid layout like movie section */
    .sidebar-movies {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .sidebar-movie {
        display: block;
        text-align: center;
    }
    
    .sidebar-poster {
        width: auto;
        max-width: none;
        margin: 0 auto 8px auto;
    }
    
    .sidebar-title {
        text-align: center;
        font-size: 13px;
    }
}


/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.movie-item {
    animation: fadeIn 0.5s ease forwards;
}

.sidebar-movie {
    animation: fadeIn 0.5s ease forwards;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f0f0f;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Video Player Section */
.video-player-container {
    width: 100%;
    margin-bottom: 20px;
}

.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.video-player video,
.video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Server Buttons */
.server-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.server-btn {
    padding: 8px 16px;
    background: #282828;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.server-btn:hover,
.server-btn.active {
    background: var(--theme-color);
    border-color: var(--theme-color);
}

/* Movie Info */
.movie-info {
    margin-bottom: 30px;
}

.movie-description {
    font-size: 11pt;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Genre Tags */
.genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.genre-tag {
    margin-right: .5rem;
    display: inline-block;
    gap: .25rem;
    padding: .5rem .75rem;
    font-size: .75rem;
    line-height: 1rem;
    border: 1px solid;
    color: #fff;
    background-color: var(--theme-color);
    background: linear-gradient(180deg, #0000004d 0, #0000 70%), var(--theme-color);
    border-color: var(--theme-color);
    box-shadow: 0 1px 6px 0 #0000001f;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.genre-tag:hover {
    opacity: 0.8;
}

/* See More Button */
.see-more-btn {
    margin-top: .75rem;
    border-radius: .25rem;
    padding: .25rem .75rem;
    color: #fff;
    background-color: var(--theme-color);
    cursor: pointer;
    font-size: 15px;
    text-decoration: none;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    transition: opacity 0.3s ease;
}

.see-more-btn:hover {
    opacity: 0.8;
}

/* Vietsub Label */
.vietsub-label {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    padding: 2px;
    font-size: 10px;
    color: #fff;
    border-color: var(--theme-color);
    background: linear-gradient(180deg, #0000004d 0, #0000 70%), var(--theme-color);
    box-shadow: 0 1px 6px 0 #0000001f;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.tab-btn {
    padding: 8px 20px;
    background: #282828;
    border: 1px solid #444;
    border-radius: 4px;
    color: #b3b3b3;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255, 53, 101, 0.2);
    border-color: var(--theme-color);
    color: #fff;
}

.tab-btn.active {
    background: var(--theme-color);
    border-color: var(--theme-color);
    color: #fff;
}

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 53, 101, 0.2);
    border-top: 4px solid var(--theme-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: #e5e5e5;
    font-size: 16px;
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
    font-weight: 500;
}

.loading-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: var(--theme-color);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Pagination Container */
.pagination-container {
    margin-top: 30px;
}

/* Responsive Filter Tabs */
@media (max-width: 767px) {
    .filter-tabs {
        justify-content: center;
        gap: 8px;
        margin: 15px 0;
    }
    
    .tab-btn {
        padding: 6px 16px;
        font-size: 13px;
    }
}

/* Hot Keywords Section */
.hot-keywords-section {
    margin-top: 30px;
}

.hot-keywords-section .section-header {
    margin-bottom: 15px;
}

.keywords-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: #282828;
    color: #b3b3b3;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid #333;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.keyword-tag span {
    color: var(--theme-color);
    font-weight: 600;
}

.keyword-tag:hover {
    background: rgba(255, 53, 101, 0.15);
    border-color: var(--theme-color);
    color: #fff;
    transform: translateY(-2px);
}

/* Responsive Keywords */
@media (max-width: 767px) {
    .keywords-grid {
        gap: 6px;
    }
    
    .keyword-tag {
        padding: 5px 12px;
        font-size: 12px;
    }
}

/* Video Stats (Like & View) */
.video-stats {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.stat-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #282828;
    border: 1px solid #333;
    border-radius: 4px;
    color: #e5e5e5;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 100px;
    justify-content: center;
}

.stat-btn .stat-icon {
    font-size: 18px;
}

.stat-btn .stat-text {
    font-weight: 500;
}

/* Like Button - Clickable */
.like-btn {
    cursor: pointer;
}

.like-btn:hover {
    background: var(--theme-color);
    border-color: var(--theme-color);
    transform: translateY(-2px);
}

.like-btn.liked {
    background: var(--theme-color);
    border-color: var(--theme-color);
    cursor: not-allowed;
}

/* View Button - Disabled */
.view-btn.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Responsive Stats */
@media (max-width: 767px) {
    .video-stats {
        gap: 8px;
        margin-top: 12px;
    }
    
    .stat-btn {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 90px;
    }
    
    .stat-btn .stat-icon {
        font-size: 16px;
    }
}

/* See More Button - Improved Design */
.see-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 300px;
    margin: 30px auto 0;
    padding: 12px 24px;
    background: linear-gradient(135deg, #282828 0%, #1a1a1a 100%);
    border: 2px solid #333;
    border-radius: 8px;
    color: #e5e5e5;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.see-more-btn:hover {
    background: linear-gradient(135deg, var(--theme-color) 0%, #d62d5a 100%);
    border-color: var(--theme-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 53, 101, 0.3);
}

.see-more-btn:active {
    transform: translateY(0);
}

.see-more-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.see-more-btn .btn-text {
    font-size: 15px;
}

.see-more-btn .btn-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.see-more-btn:hover .btn-icon {
    transform: translateY(2px);
}

/* Loading spinner for button */
.loading-spinner-btn {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive See More Button */
@media (max-width: 767px) {
    .see-more-btn {
        max-width: 100%;
        padding: 10px 20px;
        font-size: 14px;
        margin-top: 20px;
    }
}
