/*
Theme Name: Giao Dien 19
Theme URI: https://example.com/giaodien19
Author: Developer
Author URI: https://example.com
Description: PhimHay - Dark Elegant Theme với sidebar navigation và modern dark styling
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: giaodien19
*/

/* ============================================
   PhimHay - Dark Elegant Theme
   Web xem phim lẻ miễn phí, phi lợi nhuận
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Dark Color Palette */
    --color-bg: #0f1419;
    --color-bg-secondary: #1a1f26;
    --color-bg-elevated: #232a33;

    /* Accent Colors */
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --accent-gradient: linear-gradient(135deg, #3b82f6, #60a5fa);

    /* Text */
    --color-text: #f1f5f9;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;

    /* Border & Shadows */
    --color-border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Layout */
    --container-width: 1320px;
    --sidebar-width: 64px;
    --sidebar-width-expanded: 240px;
    --header-height: 68px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Animation */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   CSS Reset
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

button,
input {
    font-family: inherit;
    border: none;
    outline: none;
}

button {
    cursor: pointer;
    background: none;
}

/* ============================================
   Layout Container
   ============================================ */
.layout {
    display: flex;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   Sidebar Navigation - Text-Based (No Icons)
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-bg-secondary);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    padding: 16px 10px 16px 4px;
    z-index: 100;
    transition: width var(--transition);
    overflow: hidden;
}

.sidebar:hover,
.sidebar.expanded {
    width: var(--sidebar-width-expanded);
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 6px;
    margin-bottom: 20px;
    min-height: 44px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    transition: transform var(--transition);
}

.sidebar-logo:hover {
    transform: scale(1.05);
}

/* Expand Button - shows when sidebar is collapsed (desktop only) */
.sidebar-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--color-bg-elevated);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: all var(--transition);
    cursor: pointer;
}

.sidebar-expand-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-secondary);
}

/* By default (collapsed): show arrow, hide logo */
.sidebar-logo {
    display: none;
    pointer-events: none;
    /* Prevent clicks even if visible during hover */
}

/* When expanded: hide arrow, show logo */
.sidebar:hover .sidebar-expand-btn,
.sidebar.expanded .sidebar-expand-btn {
    display: none;
}

.sidebar:hover .sidebar-logo,
.sidebar.expanded .sidebar-logo {
    display: flex;
}

/* Only allow logo clicks when sidebar is truly expanded (not just hovered) */
.sidebar.expanded .sidebar-logo {
    pointer-events: auto;
}

.sidebar-brand {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar:hover .sidebar-brand,
.sidebar.expanded .sidebar-brand {
    opacity: 1;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-height: 0;
    /* Important: allows flex child to shrink and enable scrolling */
    overflow-y: hidden;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

/* Show scrollbar only when sidebar is expanded/hovered */
.sidebar:hover .sidebar-nav,
.sidebar.expanded .sidebar-nav {
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

/* Mobile-only links (hidden on desktop by default) */
.sidebar-link.sidebar-link-mobile {
    display: none;
}

/* Text-Based Navigation Links with First Letter */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 12px;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
}

/* First Letter Indicator (replaces icon) */
.sidebar-link::before {
    content: attr(data-initial);
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-secondary);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.sidebar-link:hover {
    background: var(--color-bg-elevated);
    color: var(--color-text);
}

.sidebar-link:hover::before {
    color: var(--accent-secondary);
    background: rgba(59, 130, 246, 0.15);
}

.sidebar-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-text);
    border-left: 3px solid var(--accent-primary);
    margin-left: -3px;
}

.sidebar-link.active::before {
    background: var(--accent-gradient);
    color: white;
}

/* SVG icon variant (no ::before, uses span instead) */
.sidebar-link-svg::before {
    content: none !important;
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
}

.sidebar-link-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-elevated);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.sidebar-link-svg:hover .sidebar-link-icon {
    color: var(--accent-secondary);
    background: rgba(59, 130, 246, 0.15);
}

.sidebar-link-svg.active .sidebar-link-icon {
    background: var(--accent-gradient);
    color: white;
}

.sidebar-link-text {
    opacity: 0;
    transition: opacity var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.sidebar:hover .sidebar-link-text,
.sidebar.expanded .sidebar-link-text {
    opacity: 1;
}

.sidebar-divider {
    height: 1px;
    background: var(--color-border);
    margin: 12px 0;
}

/* Sidebar Section Header (for categories) */
.sidebar-section-header {
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar:hover .sidebar-section-header,
.sidebar.expanded .sidebar-section-header {
    opacity: 1;
}

/* Sidebar Category Links (with dot indicator instead of text) */
.sidebar-category {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: all var(--transition);
    white-space: nowrap;
}

/* Dot indicator for collapsed state */
.sidebar-category::before {
    content: '';
    width: 8px;
    height: 8px;
    min-width: 8px;
    background: var(--color-text-muted);
    border-radius: 50%;
    margin: 0 12px;
    transition: all var(--transition);
}

.sidebar-category:hover {
    background: var(--color-bg-elevated);
    color: var(--color-text);
}

.sidebar-category:hover::before {
    background: var(--accent-secondary);
}

.sidebar-category.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-text);
}

.sidebar-category.active::before {
    background: var(--accent-primary);
}

.sidebar-category-text {
    opacity: 0;
    transition: opacity var(--transition);
    font-size: 13px;
    font-weight: 500;
}

.sidebar:hover .sidebar-category-text,
.sidebar.expanded .sidebar-category-text {
    opacity: 1;
}

.sidebar-bottom {
    flex-shrink: 0;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.sidebar-info {
    padding: 10px 12px;
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar:hover .sidebar-info,
.sidebar.expanded .sidebar-info {
    opacity: 1;
}

.sidebar-info-text {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* ============================================
   Main Content Area
   ============================================ */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}

/* ============================================
   Top Header Bar
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
    padding: 0;
    background: rgba(26, 31, 38, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
}

/* Header Brand (Logo + Name) */
.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    transition: transform var(--transition);
}

.header-brand:hover .header-logo {
    transform: scale(1.05);
}

.header-brand-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
}

/* Search Box */
.search-wrapper {
    flex: 1;
    max-width: 560px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 14px;
    color: var(--color-text);
    transition: all var(--transition);
}

.search-input::placeholder {
    color: var(--color-text-muted);
}

.search-input:focus {
    border-color: var(--accent-primary);
    background: var(--color-bg-elevated);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: color var(--transition);
}

.search-input:focus+.search-icon {
    color: var(--accent-primary);
}

.search-btn {
    position: absolute;
    right: 5px;
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    opacity: 0;
    transform: scale(0.8);
}

.search-input:focus~.search-btn,
.search-input:not(:placeholder-shown)~.search-btn {
    opacity: 1;
    transform: scale(1);
}

.search-btn:hover {
    transform: scale(1.05);
}

/* Search toggle - hidden by default, shown only on mobile ≤425px */
.search-toggle {
    display: none;
}

/* Header Quick Navigation */
.header-nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.header-nav-link {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.header-nav-link:hover {
    background: var(--color-bg-elevated);
    color: var(--color-text);
}

.header-nav-link.active {
    background: var(--accent-gradient);
    color: white;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Main Content
   ============================================ */
.main {
    flex: 1;
    padding: 32px 0 80px;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.section-subtitle {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* ============================================
   Movie Grid
   ============================================ */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Movie Card */
.movie-card {
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
}

.movie-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.movie-thumb {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.movie-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.movie-card:hover .movie-thumb img {
    transform: scale(1.05);
}

/* Play Overlay */
.movie-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(15, 20, 25, 0.95) 0%,
            rgba(15, 20, 25, 0.3) 50%,
            transparent 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.movie-card:hover .movie-overlay {
    opacity: 1;
}

.play-btn {
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transform: scale(0.5);
    opacity: 0;
    transition: all var(--transition);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.movie-card:hover .play-btn {
    transform: scale(1);
    opacity: 1;
}

.play-btn svg {
    width: 22px;
    height: 22px;
    margin-left: 2px;
}

/* Badge */
.movie-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-full);
}

.movie-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: var(--radius-sm);
}

/* Card Content */
.movie-info {
    padding: 14px;
}

.movie-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    line-height: 1.4;
    transition: color var(--transition);
}

.movie-card:hover .movie-title {
    color: var(--accent-secondary);
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.page-btn:hover:not(:disabled):not(.active) {
    background: var(--color-bg-elevated);
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
}

.page-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-dots {
    padding: 0 8px;
    color: var(--color-text-muted);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    padding: 40px 0 24px;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.footer-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
}

.footer-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    max-width: 500px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--transition);
}

.footer-link:hover {
    color: var(--accent-secondary);
}

.footer-copy {
    font-size: 12px;
    color: var(--color-text-muted);
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
    width: 100%;
}

/* ============================================
   Video Page Styles
   ============================================ */
.video-player-container {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    margin-bottom: 24px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-info-card {
    padding: 20px;
}

.video-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 16px;
}

.video-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.video-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.video-stat svg {
    width: 16px;
    height: 16px;
}

.video-actions {
    display: flex;
    gap: 10px;
    padding: 16px 0;
    border-top: 1px solid var(--color-border);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.action-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-secondary);
}

.action-btn.primary {
    background: var(--accent-gradient);
    color: white;
}

.action-btn.primary:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Video Tags (Genre & Keywords) */
.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.video-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.video-tag:hover {
    color: var(--accent-secondary);
    background: rgba(59, 130, 246, 0.15);
}

.video-tag.genre {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-secondary);
}

.video-tag.genre:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* Server Select */
.server-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.server-btn {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.server-btn:hover {
    color: var(--color-text);
    background: var(--color-bg-secondary);
}

.server-btn.active {
    background: var(--accent-gradient);
    color: white;
}

.video-description {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin-bottom: 16px;
}

/* 404 Error Page */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.error-content {
    text-align: center;
    max-width: 400px;
}

.error-icon {
    color: var(--accent-primary);
    opacity: 0.7;
    margin-bottom: 24px;
}

.error-code {
    font-size: 72px;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1;
    margin-bottom: 16px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-message {
    font-size: 16px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
}

.error-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.error-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

/* Load More Button (centered at bottom) */
.load-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.load-more-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-secondary);
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.load-more-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

/* ============================================
   Responsive - Media Queries
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        width: var(--sidebar-width-expanded);
        transition: left var(--transition);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    /* Show all text elements when sidebar is open on mobile */
    .sidebar .sidebar-brand,
    .sidebar .sidebar-link-text,
    .sidebar .sidebar-info,
    .sidebar .sidebar-section-header,
    .sidebar .sidebar-category-text {
        opacity: 1;
    }

    /* On mobile: hide expand button, always show logo */
    .sidebar .sidebar-expand-btn {
        display: none;
    }

    .sidebar .sidebar-logo {
        display: flex;
    }

    /* Show mobile-only nav links ONLY when menubar exists (≤1024px) */
    .sidebar-link.sidebar-link-mobile {
        display: flex;
    }

    /* Enable scroll when sidebar is open on mobile */
    .sidebar.mobile-open .sidebar-nav {
        overflow-y: auto;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .movie-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .header-nav {
        display: none;
    }

    .search-wrapper {
        margin-left: auto;
    }

    .menu-toggle {
        display: flex;
    }

    /* Overlay when sidebar open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 99;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .movie-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .section-title {
        font-size: 20px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .search-wrapper {
        max-width: 100%;
    }

    .header-inner {
        gap: 12px;
    }
}

@media (max-width: 425px) {
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .movie-info {
        padding: 10px;
    }

    .movie-title {
        font-size: 12px;
    }

    .movie-badge {
        padding: 3px 6px;
        font-size: 9px;
    }

    .main {
        padding: 20px 0 60px;
    }

    .container {
        padding: 0 14px;
    }

    .pagination {
        gap: 4px;
    }

    .page-btn {
        min-width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .footer {
        padding: 28px 0 16px;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
    }

    .video-title {
        font-size: 16px;
    }

    .video-actions {
        flex-wrap: wrap;
    }

    .action-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Mobile Header - Optimized layout */
    .header {
        height: 56px;
    }

    .header-inner {
        justify-content: space-between;
        gap: 12px;
    }

    .header-brand {
        flex: 1;
    }

    .search-wrapper {
        position: static;
        flex: none;
    }

    /* Mobile Search Toggle */
    .search-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--color-bg-elevated);
        border-radius: var(--radius-full);
        color: var(--color-text-secondary);
        transition: all var(--transition);
    }

    .search-toggle:hover {
        background: rgba(59, 130, 246, 0.15);
        color: var(--accent-secondary);
    }

    .search-box {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        padding: 12px 16px;
        background: var(--color-bg-secondary);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all var(--transition);
        z-index: 100;
    }

    .search-wrapper.active .search-box {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Hide inner search icon on mobile - toggle icon is visible */
    .search-icon {
        display: none;
    }

    .search-input {
        padding: 14px 50px 14px 16px;
        font-size: 16px;
    }

    .search-btn {
        opacity: 1;
        transform: scale(1);
        right: 25px;
    }
}

/* ============================================
   WordPress Integration Styles
   ============================================ */

/* Thumbnail aspect ratio variable */
.movie-thumb {
    aspect-ratio: var(--fv-thumb-aspect-ratio, 16/9);
}

/* Disable tap highlight on mobile */
*,
*::before,
*::after {
    -webkit-tap-highlight-color: transparent;
}

/* Video iframe */
.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-wrapper .player-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 320px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}

.autocomplete-dropdown.active {
    display: block;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--color-text);
    transition: background var(--transition);
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: rgba(59, 130, 246, 0.1);
}

.autocomplete-thumb {
    width: 60px;
    height: 34px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.autocomplete-info {
    flex: 1;
    min-width: 0;
}

.autocomplete-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-meta {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

/* Time Filter Buttons */
.time-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.time-filter-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-full);
    transition: all var(--transition);
    text-decoration: none;
}

.time-filter-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-secondary);
}

.time-filter-btn.active {
    background: var(--accent-gradient);
    color: white;
}

/* Liked state for action button */
.action-btn.liked {
    background: var(--accent-gradient);
    color: white;
}