/* ========================================
   MAIN.CSS - Core Styles and Variables
   ======================================== */

/* CSS Variables with modern color scheme */
:root {
    --primary: #8B5CF6;
    --primary-dark: #7C3AED;
    --primary-light: #A78BFA;
    --secondary: #10B981;
    --accent: #F59E0B;
    --danger: #EF4444;
    --warning: #F59E0B;
    --dark: #1F2937;
    --darker: #111827;
    --light: #F9FAFB;
    --gray: #6B7280;
    --gray-light: #E5E7EB;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient: linear-gradient(135deg, #8B5CF6, #EC4899);
    --gradient-dark: linear-gradient(135deg, #7C3AED, #DB2777);
}

/* Dark mode variables */
.dark-mode {
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-card: #1F2937;
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --border-color: #374151;
    --hover-color: rgba(255, 255, 255, 0.05);
}

/* Light mode variables */
.light-mode {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-card: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --border-color: #E5E7EB;
    --hover-color: rgba(0, 0, 0, 0.02);
}

/* Reset & Base Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Main Layout */
.main-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

.main-content {
    flex: 1;
    padding: 1rem;
    width: 100%;
    max-width: 100%;
}

.sidebar-left,
.sidebar-right {
    width: 300px;
    padding: 1rem;
}

/* Hero Section */
.hero {
    padding: 120px 1.5rem 80px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.15) 0%, transparent 50%);
    z-index: -1;
}

.hero-title {
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-secondary);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Categories Section */
.categories {
    padding: 4rem 1.5rem;
    background: var(--bg-secondary);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    justify-items: center;
}

.category-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    width: 100%;
    max-width: 300px;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

/* Videos Section */
.videos-section {
    padding: 4rem 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    width: 100%;
    justify-items: center;
}

.video-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    width: 100%;
    max-width: 400px;
}

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

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: var(--bg-secondary);
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-info {
    padding: 1.25rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    word-break: break-word;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: var(--transition);
}

.video-card:hover .video-overlay {
    opacity: 1;
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: white;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition);
    font-size: 1rem;
}

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

.action-btn.liked {
    color: var(--danger);
}

.report-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: var(--transition);
}

.report-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.report-btn.reported {
    color: var(--danger);
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Features Section */
.features {
    padding: 4rem 1.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: var(--gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    position: relative;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    background: var(--gradient-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

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

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

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
}

.btn-premium {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-premium:hover {
    background: linear-gradient(135deg, #FFC800, #FF8C00);
    transform: translateY(-2px);
    color: #000;
}

.btn-cancel {
    background: transparent;
    border: 2px solid var(--gray);
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-cancel:hover {
    background: var(--hover-color);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    flex-direction: column;
    gap: 1rem;
    color: white;
}

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Security Warning */
.security-warning {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    z-index: 1500;
    box-shadow: var(--shadow-lg);
    max-width: 90%;
    text-align: center;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    z-index: 1400;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    background: var(--secondary);
}

.toast-error {
    background: var(--danger);
}

.toast-warning {
    background: var(--warning);
}

.toast-info {
    background: var(--primary);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 2px dashed var(--border-color);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-gradient { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.hidden { display: none !important; }
.w-100 { width: 100%; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Focus styles */
button:focus-visible,
input:focus-visible,
a:focus-visible,
.video-card:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar-left,
    .sidebar-right {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .main-layout {
        padding: 0 0.75rem;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .sidebar-left,
    .sidebar-right {
        width: 100%;
        padding: 0.75rem;
    }
    
    /* Smartphone home gallery: two cards per row (2x2 visible layout). */
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
        align-items: stretch;
    }

    .video-card {
        max-width: none;
        min-width: 0;
    }

    .video-card .video-info {
        padding: 0.7rem;
    }

    .video-card .video-title {
        font-size: 0.9rem;
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .video-card .video-meta {
        gap: 0.35rem;
        font-size: 0.72rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .hero {
        padding: 100px 0.75rem 60px;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .filter-controls {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
}

/* iOS Safe Area Support */
@supports (padding: max(0px)) {
    .hero {
        padding-top: max(120px, env(safe-area-inset-top));
        padding-bottom: max(80px, env(safe-area-inset-bottom));
    }
}

/* In main.css - Add to hero section */

.hero-advertiser-cta {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(107, 70, 193, 0.1);
    border-radius: var(--border-radius);
    display: inline-block;
}

.advertiser-cta-link {
    color: #6B46C1;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.advertiser-cta-link:hover {
    color: #9F7AEA;
    transform: translateX(5px);
}

.advertiser-cta-link i {
    font-size: 1.1rem;
}
/* ========================================
   ADD THESE TO main.css - Security & Error Overlays
   ======================================== */

/* Fatal Error Overlay - Replaces inline styles in sanitizer.js, airdrop-*.js */
.fatal-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #111;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    font-family: sans-serif;
}

.fatal-error-content {
    text-align: center;
    padding: 20px;
}

.fatal-error-button {
    margin-top: 20px;
    padding: 10px 20px;
    background: #8B5CF6;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

.fatal-error-button:hover {
    background: #7C3AED;
}

/* Toast Notifications - Replaces inline styles in notification-bell.js, ui.js */
.toast-fixed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 300px;
    max-width: 400px;
    background: #1F2937;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.toast-fixed.show {
    transform: translateX(0);
}

.toast-fixed .toast-icon {
    font-size: 20px;
}

.toast-fixed .toast-content {
    flex: 1;
}

.toast-fixed .toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.toast-fixed .toast-message {
    font-size: 12px;
    color: #9CA3AF;
}

.toast-fixed .toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #9CA3AF;
    font-size: 14px;
    padding: 4px;
}

.toast-fixed .toast-close:hover {
    color: #fff;
}

/* Upload Progress Fill */
.upload-progress-fill {
    height: 100%;
    background-color: #8B5CF6;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Confirm Modal Styles */
.confirm-modal .modal-content {
    max-width: 400px !important;
}

/* Alert Modal Styles */
.alert-modal .modal-content {
    max-width: 400px !important;
}

/* Video Feed Base Styles */
.video-feed-item {
    position: relative;
    scroll-snap-align: start;
}

.feed-video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Loading Overlay (ensure proper styling) */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
}

.loading-spinner i {
    font-size: 48px;
    color: #8B5CF6;
}

#loading-text {
    margin-top: 16px;
    color: #fff;
}

/* ===== 2026-07-29 MOBILE EDGE-TO-EDGE HOME LAYOUT ===== */
@media (max-width: 768px) {
    html, body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .main-layout,
    .main-content {
        width: 100%;
        max-width: 100%;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .main-content > section,
    .main-content > .container,
    .hero,
    .categories,
    .videos-section,
    .features {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .hero {
        min-height: auto;
        padding: 5.75rem 0.5rem 1.5rem !important;
    }

    .hero::before {
        display: none;
    }

    .hero > .container,
    .categories > .container,
    .videos-section > .container,
    .features > .container {
        width: 100%;
        max-width: 100%;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
        margin: 0;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        margin-bottom: 1.25rem;
    }

    .hero-actions .btn {
        width: 100%;
        min-width: 0;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
        font-size: 0.82rem;
    }

    .hero-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.25rem;
        width: 100%;
    }

    .stat-item,
    .category-card,
    .feature-card {
        background: transparent !important;
        box-shadow: none !important;
    }

    .categories,
    .videos-section,
    .features {
        padding: 1.25rem 0 !important;
    }

    .categories-grid,
    .features-grid,
    .video-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.35rem !important;
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin-left: 0;
        margin-right: 0;
        justify-items: stretch;
    }

    .category-card,
    .feature-card,
    .video-card {
        width: 100%;
        max-width: none !important;
        min-width: 0;
        margin: 0;
        border-radius: 0.55rem;
    }

    .category-card,
    .feature-card {
        padding: 0.8rem 0.45rem;
        border-color: rgba(255,255,255,0.12);
    }

    .category-icon,
    .feature-icon {
        margin-bottom: 0.5rem;
    }

    .video-card .video-info {
        padding: 0.55rem 0.35rem;
    }

    .section-header,
    .section-title {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

@media (max-width: 380px) {
    .hero-actions .btn { font-size: 0.75rem; }
    .category-card, .feature-card { padding-left: 0.25rem; padding-right: 0.25rem; }
}

/* ===== Home video-card hard layout fix (2026-07-29) ===== */
/* This final override intentionally supersedes older mobile/card rules. */
.video-card {
    position: relative;
    padding: 0 !important;
    aspect-ratio: 9 / 14;
    min-height: 0;
    background: #080b13;
    overflow: hidden;
}

.video-card > .video-thumbnail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0 !important;
    background: #080b13;
    overflow: hidden;
}

.video-card .home-video-cover,
.video-card .video-thumbnail > img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #080b13;
}

.video-card .video-cover-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.24) 42%, rgba(0,0,0,.04) 72%);
}

/* Remove the old separate title/info area completely, including old cached DOM. */
.video-card > .video-info,
.video-card .video-title {
    display: none !important;
    visibility: hidden !important;
    animation: none !important;
    opacity: 0 !important;
}

.video-card .video-floating-info {
    position: absolute;
    left: .55rem;
    right: .45rem;
    bottom: .45rem;
    z-index: 4;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.85);
}

.video-card .video-floating-info .video-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .35rem;
    color: #fff;
    font-size: .78rem;
    flex-wrap: wrap;
}

.video-card .video-floating-info .video-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: .4rem;
}

.video-card .video-overlay {
    z-index: 3;
    opacity: 1;
    background: transparent;
    pointer-events: none;
}
.video-card .play-btn { pointer-events: auto; }
.video-card .report-btn,
.video-card .video-duration,
.video-card .video-category-badge { z-index: 5; }

.video-card.cover-unavailable::before {
    content: '\f03d';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,.4);
    font-size: 2rem;
}

@media (max-width: 768px) {
    .videos-section .container,
    #videos .container {
        width: 100% !important;
        max-width: none !important;
        padding-left: .25rem !important;
        padding-right: .25rem !important;
    }
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: .3rem !important;
        width: 100% !important;
        padding: 0 !important;
    }
    .video-card {
        width: 100% !important;
        max-width: none !important;
        border-radius: .45rem !important;
        aspect-ratio: 9 / 14;
    }
    .video-card .play-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    .video-card .video-floating-info .video-meta { font-size: .68rem; }
}


/* MemeStore mobile/tablet Feed Home — Build 141 */
@media (max-width: 1024px) {
    body {
        overflow-x: hidden;
        background: #000;
    }

    /* Home is the feed. Legacy hero/grid/search/features/footer are not part of
       the mobile/tablet Home document flow and therefore cannot flash underneath. */
    .main-layout,
    #main-footer,
    #sticky-footer-ad,
    .sidebar-left,
    .sidebar-right {
        display: none !important;
    }

    #search {
        display: none !important;
    }

    body.search-page-open #search {
        display: block !important;
    }

    /* Explicit navbar section pages may reveal one requested section only. */
    body.mobile-section-page {
        background: var(--bg-primary);
        overflow-y: auto !important;
    }

    body.mobile-section-page .main-layout {
        display: block !important;
        padding-top: calc(70px + env(safe-area-inset-top, 0px));
    }

    body.mobile-section-page .main-content {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.mobile-section-page .main-content > section {
        display: none !important;
    }

    body.mobile-section-page .main-content > section.mobile-nav-active-section {
        display: block !important;
    }

    body.mobile-section-page #categories.mobile-nav-active-section {
        padding: 18px 0 32px !important;
        min-height: calc(100dvh - 70px - env(safe-area-inset-top, 0px));
    }

    /* Search is always its dedicated fixed page, never an old homepage section. */
    body.search-page-open .main-layout {
        display: none !important;
    }
}


/* Build 142: mobile full-page module ownership fixes */
@media (max-width: 1024px) {
    /* Search lives inside .main-layout. Keep its ancestor rendered while the dedicated
       fixed Search surface is open, and hide every sibling section instead. */
    body.search-page-open .main-layout {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    body.search-page-open .main-content {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    body.search-page-open .main-content > section { display: none !important; }
    body.search-page-open .main-content > #search { display: block !important; }
}
