/*
Theme Name: Всё про MAX
Theme URI: https://vsepromax.com
Author: Developer
Description: Справочник мессенджера MAX — каналы, чаты, боты и стикеры с аналитикой, рейтингами и тематической навигацией.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: max-catalog
Tags: catalog, messenger, channels, directory
*/

/* ============================================
   CSS VARIABLES & FOUNDATION
============================================ */
:root {
    /* Colors - Warm Teal Theme */
    --primary-color: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #99f6e4;
    --accent-color: #f59e0b;
    --primary-color-alpha-10: rgba(13, 148, 136, 0.1);
    --primary-color-alpha-05: rgba(13, 148, 136, 0.05);
    --accent-light: #fef3c7;

    /* Neutral Colors */
    --bg-primary: #fafaf9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f5f4;
    --bg-dark: #18181b;
    --bg-card: #ffffff;
    --border-color: #e7e5e4;

    /* Text Colors */
    --text-primary: #1c1917;
    --text-secondary: #78716c;
    --text-muted: #a8a29e;
    --text-inverse: #ffffff;

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Verified Badge */
    --verified-color: #3b82f6;
    --official-color: #10b981;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

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

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Typography */
    --font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Container */
    --container-max: 1400px;
    --container-padding: 20px;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-primary: #18181b;
    --bg-secondary: #27272a;
    --bg-tertiary: #3f3f46;
    --bg-card: #27272a;
    --border-color: #3f3f46;
    --text-primary: #fafaf9;
    --text-secondary: #d6d3d1;
    --text-muted: #78716c;
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
}

/* ============================================
   RESET & BASE
============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

.site-main {
    overflow-x: hidden;
    max-width: 100%;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lucide icons base styles */
svg.lucide,
svg[data-lucide] {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

/* Common button/link icon sizes */
button i,
button svg,
a i,
a svg,
.btn i,
.btn svg {
    flex-shrink: 0;
}

/* Small icons in badges and small buttons */
.badge i,
.badge svg,
.nav-badge i,
.nav-badge svg {
    width: 12px;
    height: 12px;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ============================================
   TYPOGRAPHY
============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

.gradient-text {
    color: var(--primary-color);
}

/* ============================================
   LAYOUT
============================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: var(--space-3xl) 0;
}

.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1200px) {
    .grid-5 { grid-template-columns: repeat(4, 1fr); }
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
    .grid-5, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ============================================
   HEADER
============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

[data-theme="dark"] .site-header {
    background: var(--bg-secondary);
    border-bottom-color: var(--border-color);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    gap: var(--space-lg);
}

.site-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
}

.site-logo-icon {
    width: 42px;
    height: 42px;
    background: var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    font-size: 1.25rem;
    box-shadow: var(--shadow-md);
}

.site-logo.logo-icon-only,
.footer-logo.logo-icon-only {
    gap: 0;
}

.site-logo.logo-icon-only .site-logo-icon {
    width: 46px;
    height: 46px;
    font-size: 1.5rem;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-link {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-link i,
.nav-link svg {
    width: 18px;
    height: 18px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: var(--primary-color-alpha-10);
}

.nav-link .badge,
.nav-link .nav-badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.625rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: 600;
    margin-left: 4px;
    white-space: nowrap;
}

/* Navigation with dropdown */
.main-nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav-menu .menu-item {
    position: relative;
}

.main-nav-menu .nav-link {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.main-nav-menu .nav-link i,
.main-nav-menu .nav-link svg {
    width: 18px;
    height: 18px;
}

.main-nav-menu .dropdown-arrow {
    width: 14px;
    height: 14px;
    margin-left: 2px;
    transition: transform var(--transition-fast);
}

.main-nav-menu .has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.main-nav-menu .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-sm);
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    z-index: 1000;
}

.main-nav-menu .has-dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-nav-menu .dropdown-menu li {
    margin: 0;
}

.main-nav-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.main-nav-menu .dropdown-item:hover {
    background: var(--primary-color-alpha-10);
    color: var(--primary-color);
}

.main-nav-menu .dropdown-item i {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.main-nav-menu .dropdown-item:hover i {
    color: var(--primary-color);
}

/* Dark theme dropdown */
[data-theme="dark"] .main-nav-menu .dropdown-menu {
    background: var(--bg-secondary);
    border-color: var(--bg-tertiary);
}

/* Header Search */
.header-search {
    flex: 1;
    max-width: 400px;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    padding-left: 44px;
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px var(--primary-color-alpha-10);
}

.search-icon {
    position: absolute;
    left: var(--space-md);
    color: var(--text-muted);
    pointer-events: none;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    background: var(--bg-tertiary);
}

.theme-toggle i,
.theme-toggle svg {
    width: 22px;
    height: 22px;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
}

/* Mobile theme toggle - bigger and more visible */
@media (max-width: 992px) {
    .theme-toggle {
        width: 44px;
        height: 44px;
        background: var(--bg-secondary);
        border: 2px solid var(--bg-tertiary);
        border-radius: var(--radius-lg);
    }
    
    .theme-toggle i {
        width: 22px;
        height: 22px;
    }
    
    .theme-toggle:hover {
        border-color: var(--primary-color);
    }
}

.btn-add-channel {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.btn-add-channel i,
.btn-add-channel svg {
    width: 18px;
    height: 18px;
}

.btn-add-channel:hover {
    background: var(--primary-dark);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mobile-menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

@media (max-width: 992px) {
    .main-nav, .header-search {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
}

/* ============================================
   HERO SECTION - ENHANCED
============================================ */
.hero-section {
    position: relative;
    padding: var(--space-2xl) 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background: var(--accent-light);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-full);
    color: #92400e;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
}

.hero-title {
    margin-bottom: var(--space-lg);
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--bg-tertiary);
}

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

.hero-stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
}

.hero-stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Hero Search */
.hero-search {
    max-width: 600px;
    margin: 0 auto;
}

.hero-search .search-form {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-xs);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--bg-tertiary);
}

.hero-search .search-input {
    border: none;
    background: transparent;
    padding: var(--space-md) var(--space-lg);
    padding-left: 52px;
    font-size: 1.0625rem;
}

.hero-search .search-input:focus {
    box-shadow: none;
}

.hero-search .search-icon {
    left: var(--space-lg);
    width: 24px;
    height: 24px;
}

.hero-search .search-btn {
    padding: var(--space-md) var(--space-xl);
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-lg);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.hero-search .search-btn:hover {
    background: var(--primary-dark);
}

/* Hero Mobile */
@media (max-width: 768px) {
    .hero-section {
        padding: var(--space-xl) 0 var(--space-lg);
    }
    
    .hero-section::after {
        width: 400px;
        height: 400px;
        right: -30%;
    }
    
    .hero-title {
        font-size: 1.75rem !important;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-stats {
        gap: var(--space-lg);
        flex-wrap: wrap;
    }
    
    .hero-stat-value {
        font-size: 1.5rem;
    }
    
    .hero-search {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: var(--space-lg) 0;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
    }
    
    .hero-description {
        font-size: 0.9375rem;
        margin-bottom: var(--space-lg);
    }
    
    .hero-badge {
        font-size: 0.8125rem;
        padding: var(--space-xs) var(--space-sm);
    }
    
    .hero-stats {
        gap: var(--space-md);
        margin-top: var(--space-lg);
        padding-top: var(--space-lg);
        position: relative;
        z-index: 1;
    }
    
    .hero-stat {
        flex: 0 0 calc(50% - var(--space-sm));
    }
    
    .hero-stat-value {
        font-size: 1.25rem;
    }
    
    .hero-stat-label {
        font-size: 0.75rem;
    }
    
    .hero-search .search-form {
        flex-direction: column;
        padding: var(--space-sm);
        position: relative;
    }
    
    .hero-search .search-icon {
        position: absolute;
        left: var(--space-lg);
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 20px;
    }
    
    /* Fix icon position when form is column */
    .hero-search .search-form .search-icon {
        top: 27px;
    }
    
    .hero-search .search-input {
        padding: var(--space-md);
        padding-left: 44px;
        font-size: 1rem;
        width: 100%;
        border-radius: var(--radius-md);
        background: var(--bg-primary);
    }
    
    .hero-search .search-btn {
        width: 100%;
        padding: var(--space-md);
        margin-top: var(--space-sm);
    }
    
    .hero-section .hero-decoration {
        display: none;
    }
}

/* ============================================
   CATEGORIES SECTION
============================================ */
.categories-section {
    padding: var(--space-2xl) 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-title-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.view-all-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--primary-color);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.view-all-link:hover {
    gap: var(--space-sm);
}

/* Category Pills */
.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.category-pill {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.category-pill:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-color-alpha-05);
}

.category-pill.active {
    background: var(--primary-color);
    border-color: transparent;
    color: white;
}

.category-pill-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.category-pill-count {
    font-size: 0.8125rem;
    opacity: 0.7;
}

/* Category Cards (Alternative) */
.category-card {
    position: relative;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.category-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color-alpha-10);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
}

.category-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.category-card-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   CHANNEL CARDS - PREMIUM DESIGN
============================================ */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

/* Адаптивная сетка для десктопа */
@media (min-width: 768px) {
    .channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: var(--space-xl);
    }
}

@media (min-width: 1200px) {
    .channels-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1600px) {
    .channels-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.channel-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    transition: all 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

@media (min-width: 768px) {
    .channel-card {
        padding: var(--space-lg);
    }
}

/* Left accent border */
.channel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 3px 0 0 3px;
}

/* Full card clickable link overlay */
.channel-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* All card content below the overlay — pass clicks through to the link */
.channel-card-header,
.channel-card .channel-info,
.channel-card .channel-name,
.channel-card .channel-username,
.channel-card .channel-description,
.channel-card .channel-stats,
.channel-card .channel-avatar,
.channel-card .scam-warning,
.channel-card .channel-status-badges {
    pointer-events: none;
    position: relative;
}

.channel-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.channel-card:hover::before {
    opacity: 1;
}

/* Verified card */
.channel-card.is-verified {
    border-color: rgba(59, 130, 246, 0.2);
}

.channel-card.is-verified::before {
    background: var(--verified-color);
}

/* Official card */
.channel-card.is-official {
    border-color: rgba(16, 185, 129, 0.2);
}

.channel-card.is-official::before {
    background: var(--official-color);
}

.channel-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

.channel-avatar {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

@media (min-width: 768px) {
    .channel-avatar {
        width: 64px;
        height: 64px;
    }
}

.channel-card:hover .channel-avatar {
    /* no transform */
}

.channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.channel-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
}

@media (min-width: 768px) {
    .channel-avatar-placeholder {
        font-size: 1.5rem;
    }
}

/* Verification Badges */
.channel-badges {
    position: absolute;
    bottom: -4px;
    right: -4px;
    display: flex;
    gap: 2px;
}

.badge-verified,
.badge-official {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    border: 2px solid var(--bg-secondary);
}

.badge-verified {
    background: var(--verified-color);
    color: white;
}

.badge-official {
    background: var(--official-color);
    color: white;
}

.channel-info {
    flex: 1;
    min-width: 0;
}

.channel-name {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.channel-name a:hover {
    color: var(--primary-color);
}

.channel-username {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.channel-category {
    display: inline-block;
    margin-top: var(--space-xs);
    padding: 2px var(--space-sm);
    background: var(--primary-color-alpha-10);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-color);
}

.channel-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Channel Stats */
.channel-stats {
    display: flex;
    gap: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--bg-tertiary);
}

.channel-stat {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.channel-stat-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.channel-stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.channel-stat-growth {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
}

.channel-stat-growth.negative {
    color: var(--error);
}

/* Channel Card Actions */
/* Interactive elements above card link overlay — restore pointer events */
.channel-card-actions,
.channel-card .channel-category {
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

.channel-card-actions {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    display: flex;
    gap: var(--space-xs);
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 2;
}

.channel-card:hover .channel-card-actions {
    opacity: 1;
}

.channel-action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.channel-action-btn i,
.channel-action-btn svg {
    width: 18px;
    height: 18px;
}

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

/* ============================================
   TOP CHANNELS / RANKINGS
============================================ */
.rankings-section {
    padding: var(--space-2xl) 0;
    background: var(--bg-secondary);
}

.rankings-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid var(--bg-tertiary);
    padding-bottom: var(--space-xs);
}

.ranking-tab {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.ranking-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform var(--transition-fast);
}

.ranking-tab:hover,
.ranking-tab.active {
    color: var(--primary-color);
}

.ranking-tab.active::after {
    transform: scaleX(1);
}

/* Ranking List */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-primary);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.ranking-item:hover {
    border-color: var(--primary-light);
    background: var(--bg-secondary);
}

.ranking-position {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.ranking-item:nth-child(1) .ranking-position {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: white;
}

.ranking-item:nth-child(2) .ranking-position {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: white;
}

.ranking-item:nth-child(3) .ranking-position {
    background: linear-gradient(135deg, #cd7f32, #b8860b);
    color: white;
}

.ranking-channel {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    min-width: 0;
}

.ranking-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-name {
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-category {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.ranking-stats {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.ranking-stat {
    text-align: right;
}

.ranking-stat-value {
    font-weight: 700;
    color: var(--text-primary);
}

.ranking-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ranking-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-open-channel {
    padding: var(--space-xs) var(--space-md);
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-open-channel:hover {
    transform: scale(1.05);
}

/* ============================================
   FILTERS & SORTING
============================================ */
.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.filters-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.filter-select {
    padding: var(--space-sm) var(--space-md);
    padding-right: 36px;
    background: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all var(--transition-fast);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
}

.filter-checkbox input {
    width: 18px;
    height: 18px;
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    accent-color: var(--primary-color);
}

.sort-buttons {
    display: flex;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 3px;
}

.sort-btn {
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.sort-btn.active {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   SINGLE CHANNEL PAGE
============================================ */
.channel-hero {
    background: var(--bg-secondary);
    padding: var(--space-2xl) 0;
    border-bottom: 1px solid var(--bg-tertiary);
    margin-bottom: var(--space-xl);
}

.channel-hero-inner {
    display: flex;
    gap: var(--space-xl);
    align-items: flex-start;
}

.channel-hero-avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.channel-hero-content {
    flex: 1;
}

.channel-hero-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}
.channel-hero-header > div:first-child {
    min-width: 0;
    flex: 1;
}


.channel-hero-title {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    font-size: 2rem;
    margin-bottom: var(--space-xs);
}

.channel-hero-username {
    color: var(--text-muted);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    font-size: 1rem;
}

.channel-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.hero-badge-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
}

.hero-badge-item.verified {
    background: rgba(59, 130, 246, 0.1);
    color: var(--verified-color);
}

.hero-badge-item.official {
    background: rgba(16, 185, 129, 0.1);
    color: var(--official-color);
}

.updated-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1;
}

.updated-date-badge i {
    width: 13px;
    height: 13px;
    color: var(--text-muted);
}

.updated-date-badge time {
    font-weight: 600;
    color: var(--text-secondary);
}

.channel-hero-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-open-max {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-open-max:hover {
    background: var(--primary-dark);
}

.btn-favorite {
    width: 48px;
    height: 48px;
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-favorite:hover,
.btn-favorite.active {
    border-color: var(--error);
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.channel-hero-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

/* Channel Stats Block */
.channel-stats-block {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: visible;
}

.stat-item {
    text-align: center;
    padding: var(--space-md);
}

.stat-item-value {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.stat-item-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.stat-item-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: var(--space-xs);
}

.stat-item-change.positive {
    color: var(--success);
}

.stat-item-change.negative {
    color: var(--error);
}

.stat-item-growth-row {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
    flex-wrap: wrap;
}

.stat-item-growth-row .stat-item-change {
    margin-top: 0;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.04);
    font-size: 0.7rem;
}

[data-theme="dark"] .stat-item-growth-row .stat-item-change {
    background: rgba(255,255,255,0.08);
}

/* Stat hint icons & tooltips */
.stat-hint-icon {
    width: 14px !important;
    height: 14px !important;
    color: var(--text-muted);
    cursor: help;
    vertical-align: middle;
    margin-left: 2px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.stat-item:hover .stat-hint-icon {
    opacity: 1;
    color: var(--primary-color);
}

.stat-item[data-hint] {
    position: relative;
    cursor: default;
}

.stat-hint-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.4;
    max-width: 280px;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    pointer-events: none;
    animation: hintFadeIn 0.15s ease;
    text-align: left;
}

.stat-hint-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-color);
}

@keyframes hintFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   SIDEBAR WIDGETS
============================================ */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.widget {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--bg-tertiary);
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.widget-content {
    padding: var(--space-lg);
}

/* Similar Channels Widget */
.similar-channels-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.similar-channel-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.similar-channel-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.similar-channel-info {
    flex: 1;
    min-width: 0;
}

.similar-channel-name {
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.similar-channel-subs {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================
   ADD CHANNEL FORM
============================================ */
.add-channel-section {
    padding: var(--space-3xl) 0;
}

.add-form-container {
    max-width: 640px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
}

.form-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.form-header h2 {
    margin-bottom: var(--space-sm);
}

.form-header p {
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.form-label .required {
    color: var(--error);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-primary);
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-color-alpha-10);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.form-submit {
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.form-submit:hover {
    background: var(--primary-dark);
}

/* ============================================
   FOOTER
============================================ */
.site-footer {
    background: var(--bg-dark);
    color: var(--text-inverse);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-md);
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--primary-color);
}

.footer-column h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: white;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: white;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

.footer-disclaimer {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.4);
    max-width: 500px;
    text-align: right;
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-disclaimer {
        text-align: center;
    }
}

/* ============================================
   PAGINATION
============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-2xl);
    flex-wrap: wrap;
}

.pagination-link,
.pagination-current,
.pagination .page-numbers,
.pagination a.page-numbers {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-fast);
    padding: 0 var(--space-sm);
}

.pagination-link,
.pagination .page-numbers {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    color: var(--text-secondary);
}

.pagination-link:hover,
.pagination a.page-numbers:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-color-alpha-05);
}

.pagination-current,
.pagination .page-numbers.current {
    background: var(--primary-color);
    color: white;
    border: none;
}

.pagination-ellipsis,
.pagination .page-numbers.dots {
    color: var(--text-muted);
    background: none;
    border: none;
    min-width: auto;
}

.pagination .prev,
.pagination .next {
    gap: var(--space-xs);
}

.pagination .prev i,
.pagination .next i {
    width: 16px;
    height: 16px;
}

@media (max-width: 576px) {
    .pagination {
        gap: 4px;
    }
    
    .pagination .page-numbers {
        min-width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
    
    .pagination .prev,
    .pagination .next {
        padding: 0 var(--space-sm);
    }
}

/* ============================================
   BREADCRUMBS
============================================ */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-separator {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Breadcrumbs Mobile */
@media (max-width: 576px) {
    .breadcrumbs {
        flex-wrap: wrap;
        gap: var(--space-xs);
        font-size: 0.8125rem;
        padding: var(--space-sm) 0;
    }
    
    .breadcrumb-item {
        max-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .breadcrumb-item.current {
        max-width: 100%;
        white-space: normal;
        overflow: visible;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .breadcrumb-separator {
        font-size: 0.75rem;
    }
}

/* ============================================
   UTILITIES
============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================
   ANIMATIONS
============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.animate-slide-up {
    animation: slideUp 0.4s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* Staggered animations for lists */
.stagger-animate > *:nth-child(1) { animation-delay: 0ms; }
.stagger-animate > *:nth-child(2) { animation-delay: 50ms; }
.stagger-animate > *:nth-child(3) { animation-delay: 100ms; }
.stagger-animate > *:nth-child(4) { animation-delay: 150ms; }
.stagger-animate > *:nth-child(5) { animation-delay: 200ms; }
.stagger-animate > *:nth-child(6) { animation-delay: 250ms; }
.stagger-animate > *:nth-child(7) { animation-delay: 300ms; }
.stagger-animate > *:nth-child(8) { animation-delay: 350ms; }
.stagger-animate > *:nth-child(9) { animation-delay: 400ms; }
.stagger-animate > *:nth-child(10) { animation-delay: 450ms; }

/* ============================================
   LOADING STATES
============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 768px) {
    :root {
        --container-padding: 16px;
    }
    
    .section {
        padding: var(--space-2xl) 0;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: var(--space-lg);
    }
    
    .hero-stat {
        flex: 1 1 calc(50% - var(--space-lg));
        min-width: 120px;
    }
    
    .channel-hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .channel-hero-header {
        flex-direction: column;
        align-items: center;
    }
    
    .channel-hero-badges {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .channel-stats-block {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ranking-stats {
        display: none;
    }
}

/* Inline Ad Cards in Grid */
.ad-card-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 350px;
    overflow: hidden;
}

.ad-card-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: var(--space-xs);
    font-weight: 400;
}