/* ========================================
   JAVZONE - MODERN DARK THEME
   Quân lệnh: Đẹp tranh - Dễ xem - Ads auto-hide
   ======================================== */

/* Reset & Base - Modern Gradient */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
    --card-bg: rgba(26, 26, 26, 0.8);
    --accent-orange: #ff6b35;
    --soft-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--primary-bg);
    background-attachment: fixed;
    color: #ffffff;
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

/* Custom Scrollbar - Modern */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

body::-webkit-scrollbar-thumb {
    background: var(--accent-orange);
    border-radius: 4px;
    transition: var(--transition);
}

body::-webkit-scrollbar-thumb:hover {
    background: #e55a2b;
}

/* ========================================
   HEADER - Modern Sticky
   ======================================== */
.header {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(12px);
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 107, 53, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.02);
}

.logo img {
    height: 28px;
    width: auto;
    margin-right: 12px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.logo span {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-orange);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Search Bar - Soft Modern */
.search-container {
    flex: 1;
    max-width: 320px;
    margin: 0 20px;
}

.search-form {
    display: flex;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 25px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    backdrop-filter: blur(8px);
}

.search-form:focus-within {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.search-input {
    flex: 1;
    padding: 10px 18px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-btn {
    padding: 10px 18px;
    background: var(--accent-orange);
    color: #fff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
}

.search-btn:hover {
    background: #e55a2b;
    transform: translateY(-1px);
}

/* Navigation - Clean */
.nav {
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 20px;
}

.nav-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    list-style: none;
    justify-content: center;
    gap: 8px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border-radius: 8px;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 107, 53, 0.1);
}

.nav-link.active {
    color: var(--accent-orange);
    border-bottom-color: var(--accent-orange);
    background: rgba(255, 107, 53, 0.15);
}

/* ========================================
   ADS - Auto-hide when empty
   ======================================== */
.ad-slot {
    margin: 20px auto;
    text-align: center;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--soft-shadow);
    transition: var(--transition);
}

.ad-slot:empty {
    display: none !important;
}

.ad-slot.hidden {
    display: none !important;
}

.ad-container {
    margin: 15px auto;
    text-align: center;
    max-width: 1200px;
    padding: 0 20px;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

.ad-container:empty {
    display: none !important;
}

.ad-home-top {
    margin: 10px auto 20px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 15px;
    border: 1px solid rgba(255, 107, 53, 0.2);
    max-width: 1000px;
    box-shadow: var(--soft-shadow);
    backdrop-filter: blur(8px);
}

.ad-banner-728x90 {
    width: 100%;
    max-width: 728px;
    height: 90px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-mobile-300x250 {
    width: 100%;
    max-width: 300px;
    height: 250px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile ad visibility */
@media (max-width: 768px) {
    .ad-banner-728x90.desktop-only {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .ad-mobile-300x250.mobile-only {
        display: none !important;
    }
}

/* ========================================
   HERO SECTION - Compact & Modern
   ======================================== */
.hero-section-compact {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    padding: 25px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    margin-bottom: 20px;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.hero-content-compact {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-brief {
    margin-bottom: 15px;
}

.site-name-small {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-orange);
    margin-bottom: 6px;
    display: block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.site-tagline {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-bottom: 15px;
    display: block;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.hero-stats span {
    background: var(--accent-orange);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
    transition: var(--transition);
}

.hero-stats span:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.4);
}

/* Trending Marquee - Soft */
.trending-marquee {
    background: rgba(255, 107, 53, 0.1);
    padding: 8px 0;
    margin: 10px 0;
    overflow: hidden;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 107, 53, 0.2);
}

.trending-marquee-text {
    color: var(--accent-orange);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    animation: marquee 20s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ========================================
   VIDEO GRID - Responsive Auto-height
   ======================================== */
.main-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
}

.main-content {
    flex: 1;
    min-height: 100vh;
    max-width: 900px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
    align-items: start;
}

.video-item {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    backdrop-filter: blur(8px);
    box-shadow: var(--soft-shadow);
}

.video-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-orange);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    background: rgba(42, 42, 42, 0.8);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    display: block;
    aspect-ratio: 16/9;
}

.video-item:hover .video-thumbnail img {
    transform: scale(1.05);
}

/* Video Play Overlay - Enhanced */
.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 107, 53, 0.9);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    z-index: 3;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.video-play-overlay::before {
    content: '▶';
    font-size: 20px;
    color: white;
    margin-left: 4px;
}

.video-item:hover .video-play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.video-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.video-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: auto;
}

.video-views,
.video-category {
    background: var(--accent-orange);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.video-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

/* ========================================
   MID-ROW AD STYLING
   ======================================== */
.ad-midrow {
    grid-column: 1 / -1 !important;
    margin: 16px 0 !important;
    background: var(--card-bg) !important;
    border-radius: var(--border-radius) !important;
    padding: 15px !important;
    border: 1px solid rgba(255, 107, 53, 0.2) !important;
    box-shadow: var(--soft-shadow) !important;
    backdrop-filter: blur(8px) !important;
    transition: var(--transition) !important;
}

.ad-midrow:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2) !important;
}

/* ========================================
   SIDEBAR - Modern Cards
   ======================================== */
.sidebar {
    flex: 0 0 320px;
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-widget {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    box-shadow: var(--soft-shadow);
}

.sidebar-widget h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-orange);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-widget h3::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--accent-orange);
    border-radius: 2px;
}

/* Trending Carousel */
.trending-carousel-widget {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    box-shadow: var(--soft-shadow);
}

.trending-carousel-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-orange);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trending-carousel-title .icon {
    font-size: 18px;
}

.trending-carousel-container {
    position: relative;
}

.trending-carousel-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.trending-carousel-track::-webkit-scrollbar {
    display: none;
}

.trending-carousel-item {
    flex: 0 0 160px;
    height: auto;
    background: rgba(42, 42, 42, 0.6);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.trending-carousel-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0 0, 0.3);
}

.trending-video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.trending-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.trending-video-info {
    padding: 8px;
}

.trending-video-title {
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-video-meta {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
}

/* Trending Navigation */
.trending-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-orange);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    backdrop-filter: blur(8px);
    box-shadow: var(--soft-shadow);
}

.trending-nav:hover {
    background: #e55a2b;
    transform: translateY(-50%) scale(1.1);
}

.trending-prev {
    left: -16px;
}

.trending-next {
    right: -16px;
}

/* ========================================
   CATEGORY SECTIONS - Modern Rails
   ======================================== */
.category-section {
    margin-bottom: 30px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--accent-orange);
    border-radius: 2px;
};

.category-link {
    color: var(--accent-orange);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--accent-orange);
    transition: var(--transition);
}

.category-link:hover {
    background: var(--accent-orange);
    color: #fff;
    transform: translateY(-1px);
}

.category-carousel-container {
    position: relative;
}

.category-carousel-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-carousel-track::-webkit-scrollbar {
    display: none;
}

.category-carousel-item {
    flex: 0 0 160px;
    height: auto;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.category-carousel-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.category-video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.category-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.category-video-info {
    padding: 10px;
}

.category-video-title {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-video-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   SECTION TITLES - Clean
   ======================================== */
.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--accent-orange);
    border-radius: 2px;
}

/* ========================================
   RESPONSIVE - Mobile First
   ======================================== */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        padding: 15px;
        gap: 20px;
    }
    
    .main-content {
        max-width: none;
    }
    
    .sidebar {
        flex: none;
        width: 100%;
        position: static;
        top: auto;
    }
    
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .video-item {
        height: auto;
        min-height: auto;
    }
    
    .video-thumbnail {
        height: auto;
        min-height: auto;
        aspect-ratio: 16/9;
    }
    
    .video-info {
        padding: 10px;
        min-height: auto;
    }
    
    .video-title {
        font-size: 13px;
        line-height: 1.3;
    }
    
    .video-meta {
        font-size: 11px;
    }
    
    /* Hide desktop-only nav arrows on mobile */
    .trending-nav {
        display: none;
    }
    
    .category-carousel-container .trending-nav {
        display: none;
    }
    
    /* Mobile ad optimizations */
    .ad-container {
        margin: 10px auto;
        padding: 0 15px;
    }
    
    .hero-section-compact {
        padding: 20px 0;
        margin-bottom: 15px;
    }
    
    .site-name-small {
        font-size: 24px;
    }
    
    .site-tagline {
        font-size: 13px;
    }
    
    .hero-stats {
        gap: 10px;
    }
    
    .hero-stats span {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .search-container {
        max-width: 250px;
        margin: 0 15px;
    }
    
    .nav-list {
        padding: 0 15px;
        justify-content: flex-start;
        overflow-x: auto;
        gap: 4px;
    }
    
    .nav-link {
        padding: 10px 12px;
        font-size: 13px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .her-section-compact {
        padding: 15px 0;
    }
    
    .header-content {
        padding: 0 15px;
        gap: 15px;
    }
    
    .logo img {
        height: 24px;
    }
    
    .logo span {
        font-size: 18px;
    }
    
    .search-container {
        max-width: none;
        margin: 0 10px;
    }
    
    .search-form {
        border-radius: 20px;
    }
    
    .search-input {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .search-btn {
        padding: 8px 15px;
        font-size: 12px;
    }
}

/* Mobile hover fix */
@media (max-width: 768px) {
    .video-item:hover,
    .trending-carousel-item:hover,
    .category-carousel-item:hover {
        transform: none !important;
        box-shadow: var(--soft-shadow) !important;
        border-color: rgba(255, 255, 255, 0.08) !important;
    }
    
    .trending-nav:hover,
    .category-nav:hover {
        transform: translateY(-50%) !important;
        background: var(--accent-orange) !important;
    }
}

/* ========================================
   FOOTER - Minimal
   ======================================== */
footer {
    background: var(--card-bg);
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

footer p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

/* Footer ad if present */
.footer-ad-slot {
    margin: 0 auto 20px;
    max-width: 728px;
}

.footer-ad-slot:empty {
    display: none !important;
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .video-item,
    .sidebar-widget,
    .trending-carousel-widget {
        border-width: 2px;
        border-color: var(--accent-orange);
    }
}

/* Focus indicators for accessibility */
.nav-link:focus,
.video-item:focus,
.search-input:focus,
.search-btn:focus {
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
}

/* ========================================
   PRINT STYLES (minimal)
   ======================================== */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .header,
    .nav,
    .sidebar,
    .ad-slot,
    .ad-container,
    .hero-section-compact,
    .trending-marquee {
        display: none !important;
    }
    
    .main-layout {
        max-width: none;
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
}