/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    /* Premium Dark Palette */
    --primary: #ffcc00;          /* ViralXHub Yellow */
    --primary-hover: #e6b800;
    --bg-body: #0f0f0f;          /* Deep Black */
    --bg-surface: #1f1f1f;       /* Card Grey */
    --bg-header: #121212;        /* Header Black */
    --text-main: #f5f5f5;
    --text-muted: #a0a0a0;
    --border-color: #333;
    
    /* Dimensions */
    --header-height: 70px;
    --container-width: 1200px;
    --radius: 8px;
    --transition: background 0.2s ease; /* Fast transition */
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button, input, textarea {
    font-family: inherit;
}

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Search Bar */
.search-box {
    position: relative;
}

.search-box input {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 8px 12px;
    border-radius: 50px;
    font-size: 14px;
    width: 160px;
    transition: width 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    width: 220px;
    background: #000;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    padding: 0;
    cursor: pointer;
}

/* Desktop Menu */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.nav-menu li a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 4px;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: var(--primary);
    background: rgba(255, 204, 0, 0.1);
}

/* =========================================
   3. MAIN LAYOUT & HORIZONTAL CATEGORIES
   ========================================= */
main {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Horizontal Scroll Strip (App-Like) */
.category-filter {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px;
    padding: 10px 5px 20px 5px;
    margin-bottom: 10px;
    justify-content: flex-start;
    width: 100%;
    
    /* Interaction & Polish */
    -webkit-overflow-scrolling: touch; 
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE */
    
    /* Fade Effect on Right Side */
    mask-image: linear-gradient(to right, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 95%, transparent 100%);
}

.category-filter::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-filter .filter-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.category-filter .filter-btn:hover {
    background: #333;
    border-color: #555;
    color: #fff;
}

.category-filter .filter-btn.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.2);
}

/* =========================================
   4. VIDEO GRID & CARDS (Static & Fast)
   ========================================= */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    width: 100%;
}

.video-card {
    display: block;
    background: var(--bg-surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid transparent;
    /* No heavy transitions for speed */
}

.video-card:hover {
    border-color: var(--border-color);
}

.thumb-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
    background: #111;
}

.video-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-info {
    padding: 12px 15px;
}

.video-card h3 {
    font-size: 14px;
    margin: 0;
    font-weight: 500;
    color: #eee;
    /* Text Truncation */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    height: 40px;
}

#load-more {
    display: block;
    margin: 40px auto 0;
    padding: 14px 40px;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#load-more:hover {
    background: var(--primary-hover);
}

/* =========================================
   5. CONTENT PAGES & FORMS
   ========================================= */
.content-page {
    max-width: 800px;
    margin: 40px auto;
    background: var(--bg-surface);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.content-page h1 {
    color: var(--primary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.content-page p, .content-page li {
    color: #ccc;
    font-size: 16px;
}

.content-page form {
    background: #151515;
    padding: 30px;
    border-radius: 8px;
    margin-top: 25px;
}

.content-page label {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.content-page input[type="text"],
.content-page input[type="email"],
.content-page textarea {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 15px;
}

.content-page input:focus, 
.content-page textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: #333;
}

.form-buttons {
    display: flex;
    gap: 15px;
}

.content-page input[type="submit"],
.content-page input[type="reset"] {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.content-page input[type="submit"] { background: var(--primary); color: #000; }
.content-page input[type="submit"]:hover { background: var(--primary-hover); }
.content-page input[type="reset"] { background: #333; color: #fff; }
.content-page input[type="reset"]:hover { background: #444; }

/* =========================================
   6. AGE GATE (PREMIUM GLASS BLUR)
   ========================================= */
.agegate-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* 1. Glass Effect */
    background-color: rgba(0, 0, 0, 0.5) !important; 
    
    /* 2. Heavy Blur */
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    
    /* 3. Fallback for old browsers */
    @supports not (backdrop-filter: blur(15px)) {
        background-color: rgba(0, 0, 0, 0.9) !important;
    }
    
    animation: fadeIn 0.3s ease-out;
}

.agegate-container {
    background: #1f1f1f;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    border: 1px solid rgba(255, 204, 0, 0.4);
    box-shadow: 0 50px 100px rgba(0,0,0,0.9);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.agegate-container h1 { color: var(--primary); margin-top: 0; }
.agegate-container .btn-group { display: flex; flex-direction: column; gap: 15px; margin-top: 20px;}

.agegate-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

#yes-btn { background: var(--primary); color: #000; }
#no-btn { background: #333; color: #fff; }

/* =========================================
   7. FOOTER
   ========================================= */
footer {
    background: #000;
    padding: 20px 20px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

footer .footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

footer .footer-links a {
    color: var(--text-muted);
    font-size: 13px;
}
footer .footer-links a:hover { color: var(--primary); }

footer .footer-copy {
    color: #666;
    font-size: 12px;
}

/* =========================================
   8. RESPONSIVE UTILITIES (ADS & MOBILE)
   ========================================= */
@media (min-width: 901px) {
    .mobile-only { display: none !important; }
}
@media (max-width: 900px) {
    .desktop-only { display: none !important; }
    
    .menu-toggle { display: block; }

    nav {
        position: absolute;
        top: var(--header-height);
        right: 0;
        width: 260px;
        background: #1a1a1a;
        padding: 20px;
        border-radius: 0 0 0 12px;
        border-bottom: 1px solid #333;
        border-left: 1px solid #333;
        transform: translateY(-20px);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 10px 20px rgba(0,0,0,0.5);
    }

    nav.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu { flex-direction: column; gap: 10px; }
    .nav-menu li a { display: block; padding: 12px; background: #111; }
}

/* SMARTPHONES (Optimized 2-Column View) */
@media (max-width: 480px) {
    header { padding: 0 12px; }
    main { padding: 15px 10px; }
    
    .logo img { height: 32px; }
    .search-box input { width: 130px; font-size: 13px; }
    .search-box input:focus { width: 160px; }
    
    /* Perfect 2-Column Grid */
    .video-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px;
    }
    
    .video-info { padding: 10px; }
    .video-card h3 { 
        font-size: 13px; 
        line-height: 1.3; 
        height: 34px;
    }
    
    .category-filter { gap: 8px; padding-bottom: 12px; margin-bottom: 15px; }
    .category-filter .filter-btn { padding: 8px 18px; font-size: 13px; }
    
    #load-more { width: 100%; padding: 15px 0; border-radius: 8px; margin-top: 30px; }
    
    .content-page { padding: 20px 15px; }
    .form-buttons { flex-direction: column; }
    
    .agegate-container { width: 90%; padding: 30px 20px; }
    .agegate-container h1 { font-size: 22px; }
}

/* =========================================
   9. SKELETON LOADING (Speed)
   ========================================= */
/* Image Fade-In */
.video-card img {
    opacity: 0; 
    transition: opacity 0.4s ease-in-out;
}

.video-card img.loaded {
    opacity: 1; 
}

/* Shimmer Effect */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    background: #1f1f1f; 
    background-image: linear-gradient(to right, #1f1f1f 0%, #2a2a2a 20%, #1f1f1f 40%, #1f1f1f 100%);
    background-repeat: no-repeat;
    background-size: 2000px 100%; 
    animation: shimmer 1.5s infinite linear;
    border-radius: 8px;
}

.skeleton-card {
    display: block;
    background: transparent;
    border: none;
    box-shadow: none;
}

.skeleton-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    margin-bottom: 10px;
}

.skeleton-title {
    height: 14px;
    width: 90%;
    margin-bottom: 6px;
}

.skeleton-meta {
    height: 12px;
    width: 60%;
}