/* --- Variables & Reset --- */
:root {
    --primary-color: #ff0000;
    /* YouTube Red */
    --primary-hover: #cc0000;
    --bg-color: #0f0f0f;
    /* YouTube Dark BG */
    --bg-secondary: #272727;
    /* YouTube Sidebar/Card BG */
    --text-color: #f1f1f1;
    /* YouTube Text */
    --text-secondary: #aaaaaa;
    --nav-bg: rgba(15, 15, 15, 0.9);
    /* High opacity for better contrast */
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --neon-glow: 0 0 10px rgba(255, 0, 0, 0.4);
    --border-radius: 12px;
    /* More rounded like mod YT */
    --transition: all 0.3s ease;
    --container-width: 1400px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    /* YouTube uses Roboto */
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.4;
    overflow-x: hidden;
}

/* --- Custom Scrollbar (YouTube Style) --- */
::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #717171;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* --- Filter Box Fix --- */
.filter-box select {
    background-color: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 18px;
    /* Chip style */
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

.filter-box select:hover {
    background-color: #3f3f3f;
}

.filter-box select option {
    background-color: var(--bg-secondary);
    color: var(--text-color);
}



/* --- Loading Animation --- */
.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    font-size: 1.2rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.loading-placeholder::before {
    content: '';
    width: 25px;
    height: 25px;
    border: 3px solid rgba(229, 9, 20, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

a {
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* --- YouTube Clone Layout --- */

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 65px;
    background-color: var(--nav-bg);
    border-bottom: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-icon {
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-color);
}

.menu-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 720px;
}

.search-box {
    display: flex;
    width: 100%;
    align-items: center;
    background: #121212;
    border: 1px solid #303030;
    border-radius: 40px;
    overflow: hidden;
    margin-left: 40px;
    /* Offset for balance */
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 0 16px;
    height: 40px;
    flex: 1;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    width: auto;
    /* Reset old transition */
    opacity: 1;
    /* Reset old transition */
}

.search-box button {
    height: 40px;
    width: 64px;
    background: #222;
    border: none;
    border-left: 1px solid #303030;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    background: #303030;
    color: var(--text-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 48px;
    justify-content: flex-end;
}

.header-ad-email {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff5c3a, #ff1f57);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(255, 31, 87, 0.2);
}

.header-ad-email:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(255, 31, 87, 0.28);
    color: #fff;
}

.mobile-ad-email-chip {
    display: none;
}

.header-right i {
    font-size: 20px;
    color: var(--text-color);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
}

.header-right i:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* --- Mobile Search Icon (YouTube style) --- */
.mobile-search-icon {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-search-icon:hover,
.mobile-search-icon:active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* --- Mobile Search Overlay (YouTube style) --- */
.mobile-search-overlay {
    display: none;
    /* Hidden by default, shown via @media */
}

.mobile-search-overlay.active {
    display: flex;
}

.mobile-search-bar {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 8px;
    gap: 4px;
}

.mobile-search-back {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    padding: 8px 12px;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 50%;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-search-back:hover,
.mobile-search-back:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-search-input-wrapper {
    flex: 1;
    background: #272727;
    border-radius: 40px;
    overflow: hidden;
    border: 1px solid #404040;
    transition: border-color 0.2s;
}

.mobile-search-input-wrapper:focus-within {
    border-color: #606060;
}

.mobile-search-input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 16px;
    padding: 10px 16px;
    font-family: 'Roboto', sans-serif;
    outline: none;
}

.mobile-search-input-wrapper input::placeholder {
    color: #717171;
}

.mobile-search-submit {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    padding: 8px 12px;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 50%;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-search-submit:hover,
.mobile-search-submit:active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.user-avatar-placeholder {
    width: 32px;
    height: 32px;
    background-color: #8e24aa;
    /* Purple like generic avatar */
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
}

/* App Container */
.app-container {
    display: flex;
    margin-top: 56px;
    /* Below Header */
    min-height: calc(100vh - 56px);
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: var(--bg-color);
    overflow-y: auto;
    padding: 12px;
    /* Hide scrollbar */
    scrollbar-width: thin;
    transition: width 0.2s ease;
    /* Smooth toggle animation */
}

.sidebar:hover {
    overflow-y: auto;
}

/* Collapsed Sidebar (Mini Mode) */
.sidebar.collapsed {
    width: 72px;
}

.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .divider {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .nav-item i {
    margin-right: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 40px;
    border-radius: 10px;
    color: var(--text-color);
    margin-bottom: 4px;
    font-size: 14px;
    cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

.nav-item i {
    margin-right: 24px;
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.nav-section-title {
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
}

.divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 12px 0;
}

/* Main Content */
.main-content {
    flex: 1;
    background-color: var(--bg-color);
    padding: 24px;
}

/* Chips Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    /* overflow-x: auto;  REMOVED to allow dropdown to show */
    flex-wrap: wrap;
    /* Allow wrapping if needed */
    padding-bottom: 8px;
    align-items: center;
}

/* Sort Dropdown */
.sort-dropdown {
    position: relative;
    display: inline-block;
}

.sort-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background-color: #282828;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 100;
    min-width: 180px;
    padding: 8px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sort-menu.show {
    display: block;
}

.sort-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: background 0.2s;
}

.sort-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sort-item.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.chip {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'Roboto', sans-serif;
    display: flex;
    align-items: center;
}

.chip:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chip.active {
    background-color: #f1f1f1;
    color: #0f0f0f;
}

/* Movie Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Always 3 columns on desktop - cards scale up when sidebar collapses */
    gap: 20px 16px;
    /* Row gap, Col gap */
}

/* --- Pagination Pro Max --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0 60px 0;
}

.pagination button {
    background-color: #2a2a2a;
    color: #fff;
    border: 1px solid transparent;
    padding: 10px 16px;
    border-radius: 50px;
    /* Pill shape */
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
}

.pagination button:hover:not(:disabled) {
    background-color: #3a3a3a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pagination button.active {
    background-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    /* Neon Glow */
    border-color: transparent;
    transform: scale(1.05);
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background-color: #1a1a1a;
}

.pagination .dots {
    color: #666;
    align-self: flex-end;
    padding-bottom: 10px;
    font-size: 18px;
}

/* Go To Page Input */
.goto-page {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    padding-left: 15px;
    border-left: 1px solid #333;
}

.goto-page input {
    width: 60px;
    padding: 10px;
    border-radius: 50px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #fff;
    text-align: center;
    outline: none;
    font-family: inherit;
}

.goto-page input:focus {
    border-color: var(--primary-color);
}

.goto-page button {
    padding: 10px 15px;
    /* Adjust for go button */
}

/* Video Card (YouTube Style) */
.movie-card {
    position: relative;
    /* Fix: Constrain absolute children (hitbox) */
    background-color: transparent;
    cursor: pointer;
    transition: none;
    /* YouTube no hover scale usually */
    border-radius: 0;
    overflow: visible;
    display: block;
    /* Ensure anchor behaves like block */
    text-decoration: none;
    color: inherit;
}

.movie-card:hover {
    transform: none;
    /* Disable zoom */
    box-shadow: none;
    z-index: 1;
}

.poster-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    /* YouTube Standard */
    border-radius: 12px;
    overflow: hidden;
    background-color: #2a2a2a;
    /* Placeholder gray */
}

.poster-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Crop to fit 16:9 */
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 3px 4px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Card Metadata */
.movie-info {
    display: flex;
    padding: 12px 0 0 0;
    background: transparent;
    gap: 12px;
}

.channel-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #555;
    /* Default gray */
    flex-shrink: 0;
}

.movie-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.movie-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    /* Allow wrap */
}

.channel-name {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.channel-name:hover {
    color: var(--text-color);
}

.channel-name i {
    margin-left: 4px;
    font-size: 12px;
}

.movie-meta-text {
    font-family: 'Roboto', sans-serif;
    /* Explicitly set YouTube font */
    font-size: 14px;
    /* Standard YouTube metadata size */
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 400;
}

/* Footer */
footer {
    background-color: #000;
    padding: 50px 4% 20px;
    text-align: center;
    margin-top: 50px;
}

.footer-logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.footer-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.social-links a {
    font-size: 20px;
    margin: 0 10px;
    color: #fff;
}

.footer-bottom {
    margin-top: 30px;
    border-top: 1px solid #333;
    padding-top: 20px;
    font-size: 12px;
    color: #555;
}

/* Responsive */
@media (max-width: 768px) {

    /* === MOBILE PLAYER CONTROLS — Reference Layout === */
    /* Layout: 🔊 00:00/00:00  (spacer)  ⏪10  10⏩  ⛶ */

    /* Ẩn nút Play/Pause nhỏ (có nút giữa màn hình rồi) */
    .plyr__controls .plyr__control[data-plyr="play"] {
        display: none !important;
    }

    /* Ẩn nút play-large Plyr (dùng mobile-center-btn custom) */
    .plyr__control--overlaid {
        display: none !important;
    }

    /* Ẩn Settings gear trên mobile (không cần) */
    .plyr__controls .plyr__control[data-plyr="settings"],
    .plyr__controls .plyr__menu {
        display: none !important;
    }

    /* Ẩn volume slider (giữ icon mute) */
    .plyr__controls .plyr__volume input[type="range"] {
        display: none !important;
    }

    /* Thanh controls tổng: flex-wrap để progress riêng hàng */
    .plyr__controls {
        padding: 0 8px 4px !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 0 !important;
    }

    /* Progress bar: chiếm 100% hàng trên cùng */
    .plyr__controls>.plyr__progress__container {
        flex: 0 0 100% !important;
        width: 100% !important;
        order: -1 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Progress bar mỏng, hiện đại */
    .plyr__progress input[type="range"],
    .plyr__progress__buffer {
        height: 3px !important;
    }

    /* Nút tròn (thumb) nhỏ gọn */
    .plyr__progress input[type="range"]::-webkit-slider-thumb {
        width: 10px !important;
        height: 10px !important;
        background: #fff !important;
        border: none !important;
        box-shadow: 0 0 3px rgba(0, 0, 0, 0.5) !important;
    }

    .plyr__progress input[type="range"]::-moz-range-thumb {
        width: 10px !important;
        height: 10px !important;
        background: #fff !important;
        border: none !important;
    }

    /* Tất cả nút controls: icon 20px */
    .plyr__controls .plyr__control {
        padding: 6px !important;
        width: auto !important;
        height: auto !important;
        min-width: 0 !important;
    }

    .plyr__controls .plyr__control svg {
        width: 20px !important;
        height: 20px !important;
        fill: rgba(255, 255, 255, 0.85) !important;
    }

    /* Nút tua 10s & mute — buộc hiện */
    .plyr__controls .plyr__control[data-plyr="rewind"],
    .plyr__controls .plyr__control[data-plyr="fast-forward"],
    .plyr__controls .plyr__control[data-plyr="mute"] {
        display: inline-flex !important;
    }

    /* Ẩn SVG mặc định của Plyr cho nút tua */
    .plyr__controls .plyr__control[data-plyr="rewind"] svg,
    .plyr__controls .plyr__control[data-plyr="fast-forward"] svg {
        display: none !important;
    }

    /* Icon tua lùi 10s: mũi tên ngược chiều kim đồng hồ + "10" */
    .plyr__controls .plyr__control[data-plyr="rewind"]::after {
        content: '';
        display: block;
        width: 24px;
        height: 24px;
        background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z' fill='white'/%3E%3Ctext x='12' y='16.5' text-anchor='middle' font-size='8' font-weight='700' fill='white' font-family='Arial,sans-serif'%3E10%3C/text%3E%3C/svg%3E") no-repeat center;
        background-size: contain;
    }

    /* Icon tua tới 10s: mũi tên xuôi chiều kim đồng hồ + "10" */
    .plyr__controls .plyr__control[data-plyr="fast-forward"]::after {
        content: '';
        display: block;
        width: 24px;
        height: 24px;
        background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform='translate(24,0) scale(-1,1)'%3E%3Cpath d='M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z' fill='white'/%3E%3C/g%3E%3Ctext x='12' y='16.5' text-anchor='middle' font-size='8' font-weight='700' fill='white' font-family='Arial,sans-serif'%3E10%3C/text%3E%3C/svg%3E") no-repeat center;
        background-size: contain;
    }

    /* Volume container */
    .plyr__controls .plyr__volume {
        display: flex !important;
        min-width: auto !important;
        max-width: none !important;
    }

    /* Thời gian — font nhỏ, sáng */
    .plyr__controls .plyr__time {
        font-size: 13px !important;
        padding: 0 2px !important;
        color: rgba(255, 255, 255, 0.8) !important;
    }

    /* === Sắp xếp lại thứ tự: 🔊 00:00/00:00  (spacer)  ⏪10  10⏩  ⛶ === */
    .plyr__controls .plyr__volume {
        order: 1 !important;
    }

    .plyr__controls .plyr__time--current {
        order: 2 !important;
    }

    .plyr__controls .plyr__time--duration {
        order: 3 !important;
    }

    .plyr__controls>.plyr__progress__container {
        order: 0 !important;
    }

    /* Progress trên cùng */
    .plyr__controls .plyr__control[data-plyr="rewind"] {
        order: 5 !important;
        margin-left: auto !important;
        margin-right: 0 !important;
        padding: 2px !important;
    }

    .plyr__controls .plyr__control[data-plyr="fast-forward"] {
        order: 6 !important;
        margin: 0 !important;
        padding: 2px !important;
    }

    .plyr__controls .plyr__control[data-plyr="fullscreen"] {
        order: 7 !important;
        margin: 0 !important;
        padding: 2px !important;
    }

    /* Loại bỏ margin mặc định của Plyr trên mobile */
    .plyr__controls .plyr__controls__item {
        margin-left: 0 !important;
    }

    /* Ẩn error overlay (lỗi cross-origin) */
    .error-overlay,
    [class*="error-banner"],
    .error-bar {
        display: none !important;
    }

    /* Movie grid: 1 column on mobile (YouTube-style) */
    .movie-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Page title: hidden on mobile (still read by Google for SEO) */
    .section-header {
        display: none;
    }

    /* Sort bar: compact, full-width */
    .filter-bar {
        margin-bottom: 12px;
        padding-bottom: 0;
        gap: 8px;
    }

    .filter-bar .chip {
        font-size: 13px;
        padding: 6px 14px;
        border-radius: 18px;
        background-color: rgba(255, 255, 255, 0.08);
    }

    /* Header adjustments */
    .header {
        padding: 0 10px;
    }

    .header-left {
        gap: 10px;
    }

    .logo a {
        font-size: 18px;
    }

    .logo span {
        display: none;
    }

    /* Hide desktop search on mobile */
    .search-box {
        display: none;
    }

    .header-center {
        display: none;
    }

    .nav-links,
    .user-menu {
        display: none;
    }

    /* Show mobile search icon (YouTube style) */
    .mobile-search-icon {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile Search Overlay */
    .mobile-search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 56px;
        background-color: #0f0f0f;
        z-index: 2000;
        display: none;
        align-items: center;
        animation: mobileSearchSlideDown 0.15s ease-out;
    }

    .mobile-search-overlay.active {
        display: flex;
    }

    @keyframes mobileSearchSlideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Show hamburger always on mobile */
    .menu-icon {
        display: block;
    }

    /* Sidebar - Off-canvas Drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 2000;
        transform: translateX(-100%);
        /* Hidden by default */
        width: 250px;
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        /* Slide in */
    }

    /* Remove collapse logic styles for mobile since we use drawer */
    .sidebar.collapsed {
        width: 250px;
        /* Reset */
    }

    /* Overlay Backdrop */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1500;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Main Content */
    .app-container {
        display: block;
        /* Stack vertically if needed, but flex is fine. Just sidebar is absolute now */
    }

    .main-content {
        width: 100%;
        padding: 15px 10px;
    }

    /* Grid - 1 Column (YouTube-style) */
    .movie-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .movie-card {
        margin-bottom: 10px;
    }

    .poster-box {
        border-radius: 8px;
    }

    /* Player Page */
    .player-container {
        padding: 0 10px;
        margin-top: 10px;
    }

    .video-wrapper {
        border-radius: 0;
        /* Full edge on very small screens? Nah keep radius 8px looks nice */
    }

    /* Buttons */
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
        margin: 30px 0 40px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px 0;
    }

    .pagination button {
        padding: 6px 10px;
        min-width: 36px;
        min-height: 36px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .goto-page {
        display: none;
        /* Hide GoTo on mobile to save space */
    }

    /* Footer */
    footer {
        padding: 30px 15px;
    }
}

/* --- Cross Promo Banner (QMH <-> VLXX) --- */
.cross-promo-banner {
    display: block;
    width: 100%;
    margin-bottom: 20px;
    padding: 15px 20px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: linear-gradient(45deg, #d32f2f, #f44336, #ff9800, #d32f2f);
    background-size: 300% 300%;
    animation: gradientShift 4s ease infinite, pulseGlow 2s infinite;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.cross-promo-banner:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.6);
    color: #fff;
}

.cross-promo-banner strong {
    color: #ffeb3b;
    text-shadow: 0 0 8px rgba(255, 235, 59, 0.6);
}

.cross-promo-banner i {
    margin: 0 8px;
    animation: bounceIcon 1s infinite alternate;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px rgba(244, 67, 54, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(244, 67, 54, 0.8);
    }

    100% {
        box-shadow: 0 0 10px rgba(244, 67, 54, 0.4);
    }
}

@keyframes bounceIcon {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(5px);
    }
}

@media (max-width: 768px) {
    .header-ad-email {
        display: none;
    }

    .filter-bar {
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    .sort-dropdown {
        flex-shrink: 0;
    }

    .mobile-ad-email-chip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        min-width: 0;
        max-width: 48%;
        padding: 6px 12px;
        border-radius: 999px;
        background: linear-gradient(135deg, #ff5c3a, #ff1f57);
        color: #fff;
        font-size: 12px;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        box-shadow: 0 8px 18px rgba(255, 31, 87, 0.22);
    }

    .cross-promo-banner {
        font-size: clamp(10px, 3.5vw, 14px);
        padding: 10px 5px;
        margin-bottom: 15px;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }

    .cross-promo-banner i {
        margin: 0;
    }
}
