/*
Theme Name: 11. Coral Pulse
Tested up to: 6.5
Requires at least: 5.9
License: GPL v2 or later
Author URI: https://pixelcraftlabs.io
Author: PixelCraft Labs
Version: 1.2.3
Tags: video, coral, pink, energetic, dark
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires PHP: 7.4
Description: Energetic coral pink brings warmth to dark interfaces. Pulsing with life and designed for engaging content experiences.
*/

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

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #282828;
    border: 1px solid #404040;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #e5e5e5;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--theme-color);
    color: #fff;
}

.autocomplete-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}

/* Time Filter Buttons */
.time-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.time-btn {
    padding: 8px 16px;
    background: #282828;
    color: #b3b3b3;
    border: 1px solid #404040;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

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

/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}

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

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;
}

/* Visually hidden - for SEO h1 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 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 {
    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 {
    color: 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;
    align-items: start;
}

.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(--fv-thumb-aspect-ratio, 16/9);
    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%;
    position: sticky;
    top: 20px;
    align-self: start;
}

/* Time Filter Tabs */
.time-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: center;
}

.time-tab {
    padding: 6px 14px;
    background: #282828;
    color: #b3b3b3;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.time-tab:hover {
    background: #333;
    color: #fff;
}

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

.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(--fv-thumb-aspect-ratio, 16/9);
    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;
}

.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;
    }
}

@media (max-width: 768px) {

    /* 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 {
    position: relative;
    width: 100%;
    aspect-ratio: var(--fv-thumb-aspect-ratio, 16/9);
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.video-player video,
.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

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

/* 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: 20px;
}

.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;
}

/* Keyword Tags */
.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.keyword-tag {
    display: inline-block;
    padding: .4rem .7rem;
    font-size: .75rem;
    line-height: 1rem;
    border: 1px solid #444;
    color: #ccc;
    background-color: #282828;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.keyword-tag:hover {
    background-color: #333;
    color: #fff;
    border-color: var(--theme-color);
}

/* See More Button */
.load-more-wrapper {
    text-align: center;
    margin-top: 20px;
}

.see-more-btn {
    margin-top: .75rem;
    border-radius: .25rem;
    padding: .5rem 1.5rem;
    color: #fff;
    background-color: var(--theme-color);
    cursor: pointer;
    font-size: 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    transition: opacity 0.3s ease;
}

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

.see-more-btn:disabled {
    cursor: not-allowed;
}

/* 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;
}

/* Video Stats (Like/Views) */
.video-stats {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

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

.stat-btn svg {
    flex-shrink: 0;
}

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

.view-stat {
    cursor: default;
}

/* Sidebar View More Button */
.sidebar-more {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.btn-view-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--theme-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-view-more:hover {
    filter: brightness(0.9);
    transform: translateY(-2px);
}

.btn-view-more svg {
    flex-shrink: 0;
}