/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* ====================================
       Design Token System
       ==================================== */

    /* Primary Color Palette */
    --color-primary-400: #fbbf24;
    --color-primary-500: #ffcc00;
    --color-primary-600: #d97706;

    /* Neutral Color Palette */
    --color-neutral-0: #000000;
    --color-neutral-50: #0a0a0a;
    --color-neutral-100: #111111;
    --color-neutral-200: #1a1a1a;
    --color-neutral-300: #222222;
    --color-neutral-400: #292929;
    --color-neutral-500: #333333;
    --color-neutral-600: #444444;
    --color-neutral-700: #666666;
    --color-neutral-800: #888888;
    --color-neutral-900: #999999;
    --color-neutral-950: #a0a0a0;
    --color-neutral-white: #ffffff;

    /* Semantic Colors */
    --color-error: #ff4444;
    --color-error-light: #ff6b6b;
    --color-warning: #ff9800;
    --color-success: #22c55e;

    /* Legacy mappings (backwards compatibility) */
    --primary: var(--color-primary-500);
    --primary-hover: var(--color-primary-400);
    --gradient-primary: linear-gradient(135deg, var(--color-primary-500) 0%, #ff9500 100%);

    /* Background surfaces */
    --bg-color: var(--color-neutral-0);
    --surface-0: var(--color-neutral-0);
    --surface-1: var(--color-neutral-50);
    --surface-2: #141414;
    --surface-3: #1f1f1f;
    --surface-4: var(--color-neutral-400);
    --header-bg: var(--color-neutral-100);
    --card-bg: var(--color-neutral-0);

    /* Semantic background tokens */
    --bg-page: var(--color-neutral-0);
    --bg-surface: var(--color-neutral-100);
    --bg-surface-raised: var(--color-neutral-200);
    --bg-surface-overlay: rgba(0, 0, 0, 0.9);

    /* Text colors */
    --text-primary: var(--color-neutral-white);
    --text-secondary: var(--color-neutral-950);
    --text-tertiary: var(--color-neutral-700);
    --text-muted: var(--color-neutral-700);

    /* Legacy accent colors */
    --accent-color: var(--color-primary-500);
    --accent-hover: var(--color-neutral-white);
    --link-color: var(--color-neutral-white);
    --link-hover: var(--color-primary-500);

    /* ====================================
       Spacing System (4px base unit)
       ==================================== */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* ====================================
       Typography System
       ==================================== */
    --text-xs: 10px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* ====================================
       Transition System
       ==================================== */
    --transition-fast: 0.1s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* ====================================
       Z-Index Layers
       ==================================== */
    --z-dropdown: 10;
    --z-sticky: 20;
    --z-overlay: 50;
    --z-modal: 100;
    --z-toast: 1000;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --shadow-xl: 0 12px 32px rgba(0,0,0,0.5);

    /* Typography */
    --font-family: 'Inter', 'Roboto', 'Noto Sans Vietnamese', 'Arial', sans-serif;
    --nav-height: 44px;
    --header-height: 60px;

    /* Mobile bottom nav */
    --mobile-nav-height: 56px;
}

/* Prevent layout shift when scrollbar appears/disappears */
html {
    overflow-y: scroll; /* Always show scrollbar to prevent layout shift */
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: var(--link-color);
    transition: color 0.1s ease;
}

a:hover {
    color: var(--link-hover);
}

ul {
    list-style: none;
}

/* Header */
.main-header {
    background-color: var(--header-bg);
    border-bottom: 2px solid var(--color-neutral-300);
    padding-bottom: 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    max-width: 100%;
    padding: 0 var(--space-5);
    margin: 0 auto;
}

/* Specific Logo Style matching iXXX */
.logo-section .logo {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -2px;
    display: flex;
    align-items: baseline;
    font-style: italic;
}

.logo-i {
    color: var(--color-primary-500);
    margin-right: -2px;
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
}

.logo-xxx {
    color: var(--color-neutral-white);
}

.search-section {
    flex: 1;
    max-width: 500px;
    margin: 0 var(--space-8);
}

.search-form {
    display: flex;
    background-color: var(--color-neutral-300);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: all var(--transition-normal);
}

.search-form:focus-within {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.15);
}

.search-form input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-neutral-white);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-base);
    outline: none;
}

.search-form input::placeholder {
    color: var(--color-neutral-700);
}

.search-btn {
    background-color: var(--color-neutral-500);
    border: none;
    color: var(--color-neutral-900);
    padding: 0 var(--space-4);
    cursor: pointer;
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.search-btn:hover {
    color: var(--color-neutral-white);
    background-color: var(--color-primary-500);
}

.header-actions {
    display: flex;
    gap: var(--space-4);
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.action-link {
    color: var(--color-neutral-900);
    transition: color var(--transition-fast);
}

.action-link:hover {
    color: var(--color-neutral-white);
}

.signup-btn {
    background-color: var(--color-primary-500);
    color: var(--color-neutral-0);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-weight: 700;
    transition: all var(--transition-normal);
}

.signup-btn:hover {
    background-color: var(--color-primary-400);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 204, 0, 0.3);
}

/* Mobile Header Adaptations */
@media (max-width: 768px) {
    .main-header {
        --header-height: 56px; /* Reduce height for mobile */
    }

    .header-container {
        padding: 0 var(--space-3); /* 20px → 12px */
        flex-wrap: wrap; /* Allow wrapping */
    }

    .search-section {
        order: 3; /* Move search to second row */
        flex-basis: 100%;
        max-width: 100%;
        margin: var(--space-2) 0 0 0; /* 8px top margin */
    }

    .logo-section .logo {
        font-size: 24px; /* 32px → 24px */
    }

    .header-actions {
        gap: var(--space-2); /* Reduce gap */
        font-size: 12px;
    }

    .header-actions .button {
        padding: var(--space-2) var(--space-3);
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .main-header {
        --header-height: 48px; /* Further reduce for small phones */
    }

    .logo-section .logo {
        font-size: 20px;
    }

    .header-actions {
        font-size: 11px;
    }
}

/* Nav */
.main-nav {
    background-color: var(--color-neutral-200);
    border-bottom: 1px solid var(--color-neutral-500);
    height: var(--nav-height);
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    padding: 0 var(--space-5);
}

.nav-list {
    display: flex;
    gap: var(--space-6);
    height: 100%;
    align-items: center;
}

.nav-item a {
    color: var(--color-neutral-800);
    font-weight: 700;
    text-transform: uppercase;
    font-size: var(--text-sm);
    padding: 0;
    display: block;
    line-height: var(--nav-height);
    border-bottom: 3px solid transparent;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--color-primary-500);
    transition: width var(--transition-normal);
}

.nav-item.active a,
.nav-item a:hover {
    color: var(--color-neutral-white);
}

.nav-item.active a::after,
.nav-item a:hover::after {
    width: 100%;
}

/* Main Content */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-5);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-neutral-300);
    padding-bottom: var(--space-2);
}

.section-header h2 {
    font-size: var(--text-lg);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-neutral-white);
    margin: 0;
    padding: 0;
    border-left: 3px solid var(--color-primary-500);
    padding-left: var(--space-3);
    line-height: 1;
}

.filter-tabs button {
    background: none;
    border: none;
    color: var(--color-neutral-700);
    cursor: pointer;
    font-size: var(--text-sm);
    margin-left: var(--space-3);
    padding: var(--space-1) var(--space-2);
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.filter-tabs button:hover {
    color: var(--color-neutral-white);
    background: var(--color-neutral-300);
}

.filter-tabs button.active {
    color: var(--color-primary-500);
    background: rgba(255, 204, 0, 0.1);
}

/* Categories Grid */
.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.category-pill {
    background-color: var(--color-neutral-200);
    color: var(--color-neutral-900);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    border: 1px solid var(--color-neutral-300);
    transition: all var(--transition-normal);
}

.category-pill:hover {
    background-color: var(--color-primary-500);
    color: var(--color-neutral-0);
    border-color: var(--color-primary-500);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 204, 0, 0.2);
}

/* Category & Video Card Titles */
.category-title,
.video-title,
.collection-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
    margin: 0;
    /* Allow text to wrap to multiple lines */
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-wrap: break-word;
    word-break: break-word;
}

.card .category-title,
.card .video-title {
    transition: color var(--transition-fast);
    min-height: 2.8em; /* Reserve space for 2 lines */
}

.card:hover .category-title,
.card:hover .video-title {
    color: var(--color-primary-500);
}

/* Video Grid - Mobile First Approach */
.video-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default: 1 column for mobile */
    gap: var(--space-3); /* 12px for mobile */
    margin-bottom: var(--space-10);
}

/* Small phones: 2 columns */
@media (min-width: 480px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4); /* 16px */
    }
}

/* Tablets portrait: 3 columns */
@media (min-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop: 4 columns */
@media (min-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large desktop: 5 columns */
@media (min-width: 1400px) {
    .video-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.video-card {
    display: flex;
    flex-direction: column;
    background-color: transparent;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border-radius: var(--radius-md);
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

/* Quality badge */
.quality-badge {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    background: var(--gradient-primary);
    color: var(--color-neutral-0);
    padding: 3px 8px;
    font-size: var(--text-xs);
    font-weight: 800;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.thumbnail-wrapper {
    position: relative;
    display: block;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    background-color: var(--color-neutral-100);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-md);
}

.thumbnail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform var(--transition-slow), opacity var(--transition-normal);
}

.thumbnail-wrapper:hover .thumbnail-placeholder {
    transform: scale(1.08);
    opacity: 0.9;
}

.duration {
    position: absolute;
    bottom: var(--space-2);
    right: var(--space-2);
    background-color: rgba(0, 0, 0, 0.85);
    color: var(--color-neutral-white);
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
}

.hd-badge {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: var(--gradient-primary);
    color: var(--color-neutral-0);
    padding: 2px 6px;
    font-size: var(--text-xs);
    font-weight: 800;
    border-radius: var(--radius-sm);
}

.video-info {
    padding: 0 var(--space-1);
}

.video-title {
    display: block;
    color: var(--color-neutral-white);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: var(--space-1);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition-fast);
}

.video-card:hover .video-title {
    color: var(--color-primary-500);
}

.video-meta {
    font-size: 11px;
    color: var(--color-neutral-700);
    display: flex;
    align-items: center;
}

.uploader {
    display: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin: var(--space-10) 0;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background-color: var(--color-neutral-300);
    color: var(--color-neutral-900);
    font-size: var(--text-sm);
    font-weight: 700;
    border-radius: var(--radius-md);
    padding: 0 var(--space-3);
    transition: all var(--transition-normal);
    border: 1px solid transparent;
}

.page-link:hover {
    background-color: var(--color-neutral-400);
    color: var(--color-neutral-white);
    border-color: var(--color-neutral-500);
}

.page-link.active {
    background: var(--gradient-primary);
    color: var(--color-neutral-0);
    box-shadow: 0 4px 12px rgba(255, 204, 0, 0.3);
}

/* Footer */
.main-footer {
    background-color: var(--color-neutral-100);
    padding: var(--space-10) 0;
    border-top: 3px solid var(--color-primary-500);
    margin-top: var(--space-5);
    text-align: left;
    color: var(--color-neutral-700);
    font-size: var(--text-sm);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.footer-top {
    margin-bottom: var(--space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-neutral-200);
    padding-bottom: var(--space-5);
}

.footer-links {
    display: flex;
    justify-content: flex-start;
    gap: var(--space-16);
    margin-bottom: var(--space-8);
}

.footer-column h4 {
    color: var(--color-neutral-white);
    margin-bottom: var(--space-3);
    font-size: var(--text-base);
    text-transform: uppercase;
    position: relative;
    padding-bottom: var(--space-2);
}

.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--color-primary-500);
}

.footer-column a {
    display: block;
    color: var(--color-neutral-700);
    margin-bottom: var(--space-2);
    transition: all var(--transition-fast);
}

.footer-column a:hover {
    color: var(--color-primary-500);
    padding-left: var(--space-2);
}

.footer-disclaimer,
.copyright {
    text-align: center;
    margin-top: var(--space-5);
    color: var(--color-neutral-700);
}

/* ===== New Footer Redesign Styles ===== */

/* Footer Container */
.footer-container {
    background: #000000;
    border-top: 1px solid rgba(255, 204, 0, 0.1);
}

.footer-container .footer {
    max-width: 1200px;
    margin: 0 auto;
}

/* Footer Content Grid - Force 3 columns on desktop */
.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Footer Column Logo */
.footer-column-logo {
    max-width: 100%;
}

.footer-column-logo .logo-container {
    display: inline-block;
}

.footer-column-logo .logo {
    max-height: 40px;
    width: auto;
}

/* Footer Links - Standard */
.footer-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #999999;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 2px 0;
}

.footer-link i {
    font-size: 12px;
    width: 16px;
    color: #666666;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #ffcc00;
    transform: translateX(4px);
}

.footer-link:hover i {
    color: #ffcc00;
}

/* Footer Link - "View All" Style */
.footer-link-all {
    display: inline-block;
    color: #ffcc00;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 4px;
    transition: all 0.3s ease;
}

.footer-link-all:hover {
    color: #ffd700;
    transform: translateX(4px);
}

/* Footer Link - Small Legal Links */
.footer-link-small {
    display: block;
    color: #666666;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 2px 0;
}

.footer-link-small:hover {
    color: #ffcc00;
    padding-left: 4px;
}

/* Footer Column Headers */
.footer-column h3 {
    color: #ffffff;
    margin: 0 0 8px 0;
}

/* RTA Badge */
.rta-badge {
    text-decoration: none;
    color: #999999;
    transition: all 0.3s ease;
}

.rta-badge:hover {
    border-color: #ffcc00 !important;
    color: #ffcc00;
}

.rta-badge span {
    color: inherit;
}

/* Footer Bottom Bar */
.footer-bottom {
    color: #666666;
    font-size: 14px;
}

.footer-bottom a {
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-column-logo .logo {
        max-height: 32px;
    }

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

    .rta-badge {
        width: 100%;
        justify-content: center;
    }
}

/* Light Mode Adjustments */
.light .footer-container {
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.light .footer-link,
.light .footer-bottom {
    color: #666666;
}

.light .footer-link:hover {
    color: #ffcc00;
}

.light .footer-column h3 {
    color: #000000;
}

.light .footer-link-small {
    color: #999999;
}

.light .rta-badge {
    color: #666666;
    border-color: #e0e0e0;
}

/* ===== End Footer Redesign Styles ===== */

/* Video Page Styles */
.video-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-5) 0;
}

.video-player-container {
    width: 100%;
    background: var(--color-neutral-0);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.video-player-container video {
    width: 100%;
    aspect-ratio: 16/9;
    display: block;
}

.video-info h1 {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-3);
    color: var(--color-neutral-white);
    line-height: 1.3;
}

.video-info .tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.video-info .tags span {
    background: var(--color-neutral-300);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--color-neutral-900);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.video-info .tags span:hover {
    background: var(--color-primary-500);
    color: var(--color-neutral-0);
}

.related-videos {
    margin-top: var(--space-8);
}

.related-videos h2 {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-4);
    color: var(--color-neutral-white);
    border-left: 3px solid var(--color-primary-500);
    padding-left: var(--space-3);
}

.related-videos .cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* Video Card Styles */
.card {
    display: block;
    position: relative;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border-radius: var(--radius-md);
}

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

.card .item-link {
    display: block;
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--color-neutral-300);
}

.card .item-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.card:hover .item-image {
    transform: scale(1.08);
}

.card .badge {
    position: absolute;
    right: var(--space-2);
    bottom: var(--space-2);
    background: rgba(0, 0, 0, 0.85);
    color: var(--color-neutral-white);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.card h3 {
    margin: var(--space-2) 0 var(--space-1) 0;
    font-size: var(--text-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-neutral-white);
    transition: color var(--transition-fast);
}

.card:hover h3 {
    color: var(--color-primary-500);
}

.card .text-zinc-500 {
    color: var(--color-neutral-800);
    font-size: var(--text-sm);
}

/* ====================================
   Skeleton Loading Animation
   ==================================== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-card {
    display: flex;
    flex-direction: column;
}

.skeleton-thumbnail {
    width: 100%;
    padding-top: 56.25%;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-title {
    height: 16px;
    margin-top: 10px;
    width: 90%;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-meta {
    height: 12px;
    margin-top: 8px;
    width: 60%;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ====================================
   Mobile Bottom Navigation
   ==================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 204, 0, 0.2);
    z-index: 10000 !important;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.mobile-bottom-nav ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
}

.mobile-bottom-nav li {
    flex: 1;
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 11px;
    gap: 4px;
    transition: all 0.3s ease;
    min-height: 44px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-nav a i {
    font-size: 22px;
    transition: all 0.3s ease;
}

/* Hover and active states */
.mobile-bottom-nav a:hover,
.mobile-bottom-nav a.active {
    color: #ffcc00;
}

.mobile-bottom-nav a.active i {
    transform: scale(1.1);
}

.mobile-bottom-nav a.active {
    font-weight: 600;
}

/* Active indicator */
.mobile-bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: #ffcc00;
    border-radius: 0 0 3px 3px;
}

/* Touch feedback */
.mobile-bottom-nav a:active {
    transform: scale(0.95);
    color: #ffcc00;
}

.mobile-bottom-nav a:active i {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }

    body {
        padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    }

    .main-footer {
        margin-bottom: calc(var(--mobile-nav-height) + 20px);
    }
}

/* ====================================
   Enhanced Card Styles
   ==================================== */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card .item-link {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.card h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    line-height: 1.4;
    min-height: 2.8em;
}

/* Video title 2 line clamp */
.video-title-2line {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    line-height: 1.4;
}

/* ====================================
   Enhanced Category Cards
   ==================================== */
.category-card-enhanced {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
}

.category-card-enhanced::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    pointer-events: none;
}

.category-card-enhanced .category-name {
    position: absolute;
    bottom: 12px;
    left: 12px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 1;
}

.category-card-enhanced .category-count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    z-index: 1;
}

/* ====================================
   Quick Filters
   ==================================== */
.quick-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 0;
    margin-bottom: 16px;
}

.filter-chip {
    background: var(--surface-3);
    color: var(--text-secondary);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-chip:hover {
    background: var(--surface-4);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--primary);
    color: #000;
    font-weight: 600;
}

/* ====================================
   Enhanced Video Player
   ==================================== */
.video-player-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.quality-selector {
    position: absolute;
    bottom: 60px;
    right: 12px;
    background: rgba(0,0,0,0.95);
    border-radius: var(--radius-md);
    padding: 8px 0;
    min-width: 150px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.quality-option {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.2s ease;
}

.quality-option:hover {
    background: rgba(255,204,0,0.2);
}

.quality-option.active::after {
    content: "✓";
    color: var(--primary);
    font-weight: bold;
}

/* ====================================
   Social Share Buttons
   ==================================== */
.share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-btn:active {
    transform: scale(0.95);
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.messenger {
    background: linear-gradient(135deg, #0078ff 0%, #00c6ff 100%);
}

.share-btn.telegram {
    background: #0088cc;
}

.share-btn.copy-link {
    background: var(--surface-4);
}

.share-btn.copy-link.copied {
    background: #22c55e;
}

/* ====================================
   Touch-Friendly Improvements
   ==================================== */
@media (max-width: 768px) {
    /* Larger touch targets */
    .page-link {
        min-width: 44px;
        height: 44px;
        padding: 0 12px;
    }

    .filter-chip {
        padding: 12px 20px;
    }

    .nav-item a {
        padding: 12px 8px;
    }

    /* Single column grid on small screens */
    .video-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Larger video info on mobile */
    .video-info h1 {
        font-size: 1.25rem;
    }

    /* Better card spacing */
    .cards-container {
        gap: 16px;
    }
}

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

.page-transition {
    animation: fadeIn 0.3s ease;
}

/* ====================================
   Button Press Feedback
   ==================================== */
.button:active,
button:active {
    transform: scale(0.96);
}

/* ====================================
   Search History Dropdown
   ==================================== */
.search-history {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-2);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border: 1px solid var(--surface-3);
    border-top: none;
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
}

.search-history-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-history-item:hover {
    background: var(--surface-3);
}

.search-history-item i {
    color: var(--text-tertiary);
}

.search-history-clear {
    padding: 12px 16px;
    text-align: center;
    color: var(--primary);
    cursor: pointer;
    border-top: 1px solid var(--surface-3);
}

/* ====================================
   Toast Notification
   ==================================== */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-3);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    z-index: 2000;
    animation: toastSlideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* ====================================
   Responsive Video Grid Improvements
   ==================================== */
@media (max-width: 480px) {
    .video-grid,
    .cards-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card .item-link {
        border-radius: var(--radius-lg);
    }
}

/* ====================================
   Button Component System
   ==================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-weight: 600;
    font-size: var(--text-base);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--color-primary-500);
    color: var(--color-neutral-0);
}

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

.btn-secondary {
    background: var(--color-neutral-500);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--color-neutral-600);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
}

.btn-ghost:hover {
    background: var(--color-neutral-300);
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-lg);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-sm);
}

/* ====================================
   Player UI Components
   ==================================== */
.player__play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 204, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    z-index: var(--z-dropdown);
    border: none;
    pointer-events: auto;
}

.player__play-btn:hover {
    background: var(--color-primary-500);
    transform: translate(-50%, -50%) scale(1.1);
}

.player__play-btn--hidden {
    opacity: 0;
    pointer-events: none;
}

.player__quality-btn {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    background: rgba(0, 0, 0, 0.8);
    color: var(--color-neutral-white);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-normal);
    z-index: var(--z-dropdown);
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.player__quality-btn:hover {
    background: rgba(255, 204, 0, 0.9);
    color: var(--color-neutral-0);
}

.player__quality-menu {
    position: absolute;
    top: 60px;
    right: var(--space-3);
    background: rgba(0, 0, 0, 0.95);
    border-radius: var(--radius-md);
    min-width: 160px;
    z-index: calc(var(--z-dropdown) + 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.player__quality-option {
    padding: var(--space-3) var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--color-neutral-white);
    font-size: var(--text-base);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all var(--transition-fast);
}

.player__quality-option:last-child {
    border-bottom: none;
}

.player__quality-option:hover {
    background: rgba(255, 204, 0, 0.3);
    padding-left: var(--space-5);
}

.player__quality-option--active {
    background: rgba(255, 204, 0, 0.15);
}

.player__quality-option--active::after {
    content: "✓";
    color: var(--color-primary-500);
}

.player__error-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-surface-overlay);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: var(--z-overlay);
    padding: var(--space-5);
}

.player__error-icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-5);
}

.player__error-title {
    color: var(--color-error-light);
    font-size: var(--text-xl);
    font-weight: bold;
    margin-bottom: var(--space-3);
}

.player__error-message {
    color: var(--color-neutral-900);
    font-size: var(--text-base);
    margin-bottom: var(--space-5);
    max-width: 400px;
}

.player__error-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    justify-content: center;
}

/* ====================================
   Category Page Components
   ==================================== */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    padding: 0 var(--space-3);
}

.category-header__title {
    font-size: var(--text-2xl);
    font-weight: bold;
    color: var(--text-primary);
}

.sort-selector {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sort-selector__label {
    color: var(--color-neutral-900);
    font-size: var(--text-base);
}

.sort-selector__select {
    background: var(--bg-surface-raised);
    color: var(--text-primary);
    border: 1px solid var(--color-neutral-600);
    padding: var(--space-2) var(--space-8) var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%278%27 viewBox=%270 0 12 8%27%3e%3cpath fill=%27%23999%27 d=%27M6 8L0 2h12z%27/%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color var(--transition-fast);
}

.sort-selector__select:hover {
    border-color: var(--color-neutral-700);
}

.sort-selector__select:focus {
    border-color: var(--color-primary-500);
    outline: none;
}

/* ====================================
   History Page Components
   ==================================== */
.history-empty {
    text-align: center;
    padding: var(--space-16) var(--space-5);
}

.history-empty__icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: var(--space-5);
}

.history-empty__title {
    color: var(--text-primary);
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
}

.history-empty__message {
    color: var(--color-neutral-900);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
}

.history-header__title {
    font-size: var(--text-2xl);
    font-weight: bold;
}

/* ====================================
   Loading States
   ==================================== */
.loading-text {
    text-align: center;
    padding: var(--space-10);
    color: var(--text-muted);
}

.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--color-neutral-500);
    border-top-color: var(--color-primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ====================================
   Focus & Accessibility
   ==================================== */
*:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--color-primary-500);
    color: var(--color-neutral-0);
    font-weight: 700;
    border-radius: var(--radius-md);
    z-index: var(--z-toast);
    transition: top var(--transition-fast);
    text-decoration: none;
}

.skip-link:focus {
    top: var(--space-4);
}

/* ====================================
   Enhanced Animations
   ==================================== */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-slow) ease forwards;
}

.animate-scale-in {
    animation: scaleIn var(--transition-normal) ease forwards;
}

.animate-slide-up {
    animation: slideUp var(--transition-slow) ease forwards;
}

/* ====================================
   Enhanced Skeleton Loading
   ==================================== */
.skeleton {
    background: linear-gradient(90deg,
        var(--color-neutral-200) 25%,
        var(--color-neutral-300) 50%,
        var(--color-neutral-200) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius-md);
}

/* ====================================
   Enhanced Card Hover Effects
   ==================================== */
.card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card:hover .card__thumbnail img,
.card:hover .item-image {
    transform: scale(1.05);
}

.card .item-link {
    overflow: hidden;
}

.card .item-image {
    transition: transform var(--transition-slow);
}

/* ====================================
   Utility Classes
   ==================================== */
.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;
}

.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }
.text-success { color: var(--color-success); }
.text-muted { color: var(--text-muted); }

.bg-surface { background: var(--bg-surface); }
.bg-surface-raised { background: var(--bg-surface-raised); }

/* ====================================
   HIGH PRIORITY OVERRIDES
   确保覆盖 Tailwind 样式
   ==================================== */

/* 卡片基础样式 */
.card.group {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 12px !important;
    overflow: visible !important;
    position: relative !important;
}

/* 卡片悬停 - 上浮 + 金色发光阴影 */
.card.group:hover {
    transform: translateY(-12px) scale(1.03) !important;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 204, 0, 0.2) !important;
    z-index: 20 !important;
}

/* 缩略图容器 */
.card.group .item-link {
    display: block !important;
    position: relative !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    transition: box-shadow 0.3s ease !important;
}

.card.group:hover .item-link {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

/* 缩略图悬停缩放 */
.card.group .item-image {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform !important;
}

.card.group:hover .item-image {
    transform: scale(1.12) !important;
}

/* 标题悬停效果 */
.card.group .collection-title h3,
.card.group .collection-title .category-title,
.card.group .category-title,
.card.group .video-title,
.card.group h3 {
    transition: color 0.2s ease, transform 0.2s ease !important;
}

.card.group:hover .collection-title h3,
.card.group:hover .collection-title .category-title,
.card.group:hover .category-title,
.card.group:hover .video-title,
.card.group:hover h3 {
    color: #ffcc00 !important;
    transform: translateX(4px) !important;
}

/* 徽章样式 - 金色渐变 */
.card.group .badge {
    background: linear-gradient(135deg, #ffcc00 0%, #ff9500 100%) !important;
    color: #000 !important;
    font-weight: 700 !important;
    padding: 4px 12px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    box-shadow: 0 2px 8px rgba(255, 204, 0, 0.4) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.card.group:hover .badge {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.5) !important;
}

/* 视频时长徽章 (右下角黑色背景) */
.card.group .badge.bg-black\/70,
.card.group .badge[class*="right-1"][class*="bottom-1"] {
    background: rgba(0, 0, 0, 0.85) !important;
    color: #fff !important;
    font-weight: 600 !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    backdrop-filter: blur(8px) !important;
}

/* 视频数量徽章 (左下角金色) - 仅首页分类卡片 */
.card.group .badge.bg-zinc-100\/80,
.card.group .badge.dark\:bg-zinc-800\/80,
.card.group .badge[class*="left-1"][class*="bottom-1"] {
    background: linear-gradient(135deg, #ffcc00 0%, #ff9500 100%) !important;
    color: #000 !important;
}

/* 搜索框聚焦效果 */
.input-container:focus-within,
.form:focus-within .input-container,
[class*="search"] input:focus {
    border-color: #ffcc00 !important;
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.2), 0 0 20px rgba(255, 204, 0, 0.1) !important;
}

/* 搜索按钮悬停 */
.input-container button:hover,
.input-container .icon-end:hover,
[class*="search"] button:hover {
    background: #ffcc00 !important;
    color: #000 !important;
}

/* Logo 发光效果 */
.logo-container img,
[class*="logo"] img {
    filter: drop-shadow(0 0 10px rgba(255, 204, 0, 0.3)) !important;
}

/* 导航项悬停 */
nav a:hover,
[class*="nav"] a:hover,
.header a:hover {
    color: #ffcc00 !important;
}

/* 按钮通用悬停效果 */
button:not([disabled]):hover,
[type="button"]:not([disabled]):hover,
[type="submit"]:not([disabled]):hover {
    transform: translateY(-1px);
}

button:not([disabled]):active,
[type="button"]:not([disabled]):active,
[type="submit"]:not([disabled]):active {
    transform: scale(0.97);
}

/* 金色主题按钮 */
[class*="primary"]:hover,
[class*="yellow"]:hover,
[style*="ffcc00"]:hover {
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.4) !important;
}

/* 视频数量徽章增强 */
.cards-container .card [class*="absolute"][class*="left"][class*="bottom"],
.cards-container .card .badge:first-of-type {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.9) 0%, rgba(255, 153, 0, 0.9) 100%) !important;
    color: #000 !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
}

/* 网格间距优化 */
.cards-container {
    gap: 20px !important;
}

/* 下拉菜单样式 */
[class*="dropdown"],
[class*="menu"],
[class*="flyout"] {
    background: rgba(17, 17, 17, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #111;
}

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

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

/* 选中文本颜色 */
::selection {
    background: rgba(255, 204, 0, 0.3);
    color: #fff;
}

/* 链接下划线动画 */
a {
    position: relative;
}

/* 页面整体过渡 */
#content {
    animation: pageLoad 0.3s ease;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Container 居中 - 使用 !important 覆盖 real_style.css 中的 1024px 限制 */
.container {
    max-width: 1600px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
}

/* 页面整体居中 */
#main {
    max-width: 100%;
    margin: 0 auto;
}

.content-container {
    max-width: 100%;
    margin: 0 auto;
}

/* Header 居中 */
.header-container {
    max-width: 1600px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Cards container 居中 */
.cards-container {
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   MOBILE RESPONSIVE OPTIMIZATIONS
   ============================================ */

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
    *, *::before, *::after {
        box-sizing: border-box;
    }

    html, body {
        overflow-x: hidden;
        max-width: 100vw;
        width: 100%;
    }

    body {
        position: relative;
    }

    /* Ensure all containers stay within viewport */
    .container,
    .cards-container,
    .video-grid,
    #content,
    #main {
        max-width: 100vw;
        width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    /* Prevent images from overflowing */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Fix any inline-grid issues */
    .cards-container {
        display: grid !important;
    }
}

/* Touch Targets & Font Sizes for Mobile */
@media (max-width: 768px) {
    :root {
        --text-base: 16px; /* 14px → 16px for better readability */
        --text-sm: 14px;   /* 12px → 14px */
        --text-xs: 12px;   /* 11px → 12px */
    }

    /* Navigation links - minimum 44x44px touch target */
    .nav-item a,
    .button {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 14px;
    }

    /* Video card titles */
    .video-title,
    .category-title,
    .card .collection-title,
    .card .category-title {
        font-size: 15px !important; /* 13px → 15px */
        line-height: 1.4;
        display: block;
        color: var(--color-text);
    }

    /* Category pills/tags */
    .category-pill {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 14px;
    }

    /* Video card badges - keep small to not cover thumbnail */
    .card .badge {
        min-height: unset !important;
        padding: 3px 8px !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        border-radius: 4px !important;
    }

    /* Pagination buttons */
    .pagination .page-link,
    .pagination button {
        min-width: 44px;
        min-height: 44px;
        font-size: 16px;
        padding: 10px;
    }

    /* Reduce global margins for mobile */
    .main-content {
        padding: var(--space-3); /* 20px → 12px */
    }

    .container {
        padding-left: var(--space-4); /* 16px */
        padding-right: var(--space-4);
    }

    /* Video grid spacing */
    .video-grid {
        gap: var(--space-3); /* 16px → 12px */
        padding: var(--space-2) 0;
    }

    /* Categories grid spacing */
    .categories-grid {
        gap: var(--space-3); /* Better touch target spacing */
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .container {
        padding-left: var(--space-3); /* 16px → 12px */
        padding-right: var(--space-3);
    }

    .video-grid {
        gap: var(--space-2); /* Further reduce on very small screens */
    }
}

/* Search Modal Fix - Position Fixed for Mobile */
@media (max-width: 768px) {
    .fullscreen-search-wrapper {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 56px !important; /* Leave space for dock */
        z-index: 999 !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        pointer-events: auto;
        background: #0a0a0a !important;
    }

    .fullscreen-search-wrapper.active {
        display: flex;
    }

    .fullscreen-search-wrapper .input-container {
        width: 100%;
        position: relative;
    }

    .fullscreen-search-wrapper .header-container {
        flex-shrink: 0;
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--color-layer-100);
    }

    .fullscreen-search-wrapper .search-input-wrapper {
        flex-shrink: 0;
        position: sticky;
        top: 53px;
        z-index: 9;
        background: var(--color-layer-100);
    }

    .fullscreen-search-wrapper .button {
        padding: 8px 12px;
        border-radius: 8px;
        transition: all 0.2s ease;
        background: transparent;
        border: none;
        color: var(--color-text);
        cursor: pointer;
    }

    .fullscreen-search-wrapper .button:hover {
        background: var(--color-zinc-800);
    }

    .fullscreen-search-wrapper .button i {
        font-size: 18px;
    }

    .fullscreen-search-wrapper .input-container .input {
        width: 100%;
        font-size: 16px !important;
        padding: 12px 45px 12px 16px;
    }

    .fullscreen-search-wrapper .clear-search-icon,
    .fullscreen-search-wrapper .icon-end {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        padding: 8px;
        color: var(--color-zinc-400);
        cursor: pointer;
        transition: color 0.2s ease;
    }

    .fullscreen-search-wrapper .clear-search-icon {
        right: 40px;
    }

    .fullscreen-search-wrapper .icon-end {
        right: 8px;
        color: var(--color-primary);
    }

    .fullscreen-search-wrapper .clear-search-icon:hover {
        color: var(--color-primary);
    }

    .fullscreen-search-wrapper .autocomplete {
        overflow-y: auto;
        padding: 16px;
        -webkit-overflow-scrolling: touch;
        flex: 1;
    }

    .fullscreen-search-wrapper .autocomplete::-webkit-scrollbar {
        width: 6px;
    }

    .fullscreen-search-wrapper .autocomplete::-webkit-scrollbar-track {
        background: rgba(39, 39, 42, 0.3);
        border-radius: 10px;
    }

    .fullscreen-search-wrapper .autocomplete::-webkit-scrollbar-thumb {
        background: rgba(255, 204, 0, 0.4);
        border-radius: 10px;
    }

    .fullscreen-search-wrapper .autocomplete::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 204, 0, 0.6);
    }

    .search-header-wrapper {
        flex-shrink: 0;
    }
}

/* ============================================
   POPULAR CATEGORIES TEXT LIST - MOBILE
   ============================================ */

.popular-list {
    width: 100%;
}

.category-group li {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-group li div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.category-group li div a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 13px;
    white-space: nowrap;
}

.category-group li div a:hover {
    background: rgba(255, 204, 0, 0.2);
    border-color: rgba(255, 204, 0, 0.5);
    transform: translateY(-2px);
}

.category-group li div a span:first-child {
    color: var(--color-text);
}

.category-group li div a .badge {
    font-size: 11px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .popular-list {
        padding: 0 12px;
    }

    .popular-list h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .category-group li {
        padding-bottom: 16px !important;
    }

    .category-group li div a {
        font-size: 12px;
        padding: 8px 12px;
        /* Ensure buttons fit on small screens */
        max-width: calc(50% - 4px);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .category-group li div a span:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .category-group li div a {
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* ============================================
   VIDEO PLAYER FULLSCREEN CONTROLS
   ============================================ */

.player__fullscreen-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 204, 0, 0.8);
    border-radius: 8px;
    color: #ffcc00;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.player__fullscreen-btn:hover {
    background: rgba(255, 204, 0, 0.9);
    color: #000;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 204, 0, 0.4);
}

.player__fullscreen-btn:active {
    transform: scale(0.95);
}

/* Hide native fullscreen button in controls */
video::-webkit-media-controls-fullscreen-button {
    display: none;
}

/* Fullscreen mode adjustments */
.video-player-container.is-fullscreen {
    background: #000;
}

.video-player-container.is-fullscreen video {
    max-height: 100vh;
    object-fit: contain;
}

/* Mobile fullscreen optimizations */
@media (max-width: 768px) {
    .player__fullscreen-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
        bottom: 12px;
        right: 12px;
    }

    /* Larger touch target */
    .player__fullscreen-btn::before {
        content: '';
        position: absolute;
        top: -8px;
        left: -8px;
        right: -8px;
        bottom: -8px;
    }
}
