/* =============================================
   CRITICAL RESET — must be first
   ============================================= */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Фиксируем фон для iOS rubber-band scroll */
    background-color: #F8FAFC;
}

body {
    background-color: #F8FAFC;
    min-height: 100vh;
    /* Убираем WordPress admin bar отступы */
    margin-top: 0 !important;
}

/* Убираем margin-top от WordPress admin bar */
html.admin-bar,
html.admin-bar body {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

#wpadminbar {
    display: none !important;
}

/* =============================================
   TeleFinder — Каталог Telegram-каналов
   Основной файл стилей
   ============================================= */

/* =============================================
   CSS CUSTOM PROPERTIES (Variables)
   ============================================= */
:root {
    /* Colors */
    --color-primary: #2563EB;
    --color-primary-dark: #1D4ED8;
    --color-primary-light: #DBEAFE;
    --color-accent: #06B6D4;
    --color-accent-light: #CFFAFE;

    --color-text: #1E293B;
    --color-text-secondary: #64748B;
    --color-text-light: #94A3B8;

    --color-bg: #F8FAFC;
    --color-bg-white: #FFFFFF;
    --color-bg-section: #F1F5F9;

    --color-border: #E2E8F0;
    --color-border-light: #F1F5F9;

    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;

    /* Layout */
    --container-max: 1240px;
    --navbar-height: 68px;
}

/* =============================================
   RESET & BASE STYLES
   ============================================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input {
    font-family: inherit;
    border: none;
    outline: none;
}

/* =============================================
   CONTAINER
   ============================================= */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
}

.btn--primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.btn--primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn--outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn--outline:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-1px);
}

.btn--ghost {
    background: transparent;
    color: var(--color-primary);
    border-color: transparent;
    padding: 12px 20px;
}

.btn--ghost:hover {
    background: var(--color-primary-light);
}

.btn--sm {
    padding: 8px 18px;
    font-size: 14px;
}

/* =============================================
   SECTION HEADER (shared)
   ============================================= */
.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 17px;
    color: var(--color-text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

.section-action {
    text-align: center;
    margin-top: var(--space-xl);
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    height: var(--navbar-height);
}

.navbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--navbar-height);
    position: relative;
}

/* Logo */
.navbar__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.logo-icon {
    font-size: 24px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-sm);
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.logo-accent {
    color: var(--color-primary);
}

/* Nav links */
.navbar__nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin: 0 auto;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.navbar__actions {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.navbar__link {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.navbar__link:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.navbar__link--cta {
    color: #fff;
    background: var(--color-primary);
    font-weight: 600;
}

.navbar__link--cta:hover {
    background: var(--color-primary-dark);
    color: #fff;
}

.navbar__link--mobile-only {
    display: none;
}

/* Navbar search */
.navbar__search {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-bg-section);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    flex-shrink: 0;
    transition: var(--transition);
}

.navbar__search:focus-within {
    border-color: var(--color-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.navbar__search-icon {
    color: var(--color-text-light);
    flex-shrink: 0;
}

.navbar__search-input {
    width: 160px;
    font-size: 14px;
    color: var(--color-text);
    background: transparent;
}

.navbar__search-input::placeholder {
    color: var(--color-text-light);
}

/* Hamburger menu */
.navbar__hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    gap: 5px;
    z-index: 1001;
    position: relative;
    border-radius: var(--radius-sm);
}

.navbar__hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: var(--transition);
    transform-origin: center;
}

.navbar__hamburger--active span {
    position: absolute;
}

.navbar__hamburger--active span:nth-child(1) {
    transform: rotate(45deg);
}

.navbar__hamburger--active span:nth-child(2) {
    opacity: 0;
}

.navbar__hamburger--active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
    position: relative;
    padding: var(--space-xl) 0 var(--space-2xl);
    background: linear-gradient(180deg, #fff 0%, var(--color-bg) 100%);
    overflow: hidden;
}

/* Hero Header area */
.hero__header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--space-xl);
}

.hero__title {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--color-text);
    margin-bottom: var(--space-md);
}

.hero__title-accent {
    display: block;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle {
    font-size: 19px;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: 0;
}

/* Search Wrapper below header */
.hero__search-wrapper {
    max-width: 960px;
    margin: 0 auto var(--space-2xl);
    padding: var(--space-md);
    background: #E2E8F0;
    border-radius: var(--radius-xl);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

/* Centered Action area */
.hero__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

/* Hero search cleanup */
.hero__search {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #CBD5E1;
    border-radius: var(--radius-md);
    padding: 6px 6px 6px 20px;
    transition: var(--transition);
    width: 100%;
}

.hero__search:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.hero__search-input {
    flex: 1;
    font-size: 16px;
    padding: 12px 0;
    color: var(--color-text);
    background: transparent;
}

.hero__search-input::placeholder {
    color: var(--color-text-light);
}

.hero__search-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 28px;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    transition: var(--transition);
    flex-shrink: 0;
}

.hero__search-btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Hero CTA buttons centered */
.hero__cta {
    display: flex;
    gap: var(--space-xl);
    justify-content: center;
}

.hero__cta .btn {
    padding: 12px 28px;
    font-size: 15px;
    border-radius: var(--radius-md);
}

/* Premium Stat Cards */
.hero__stats--premium {
    display: flex;
    gap: var(--space-lg);
    width: 100%;
    max-width: 1100px;
    margin-top: var(--space-lg);
}

.stat-premium {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: var(--space-xl) var(--space-xl) var(--space-lg);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: var(--transition-slow);
    overflow: hidden;
    position: relative;
    min-height: 160px;
}

.stat-premium:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary-light);
}

.stat-premium__text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
    max-width: 60%;
}

.stat-premium__number {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--color-text);
    line-height: 1;
}

.stat-premium__badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 10px;
    background: #ECFDF5;
    color: #059669;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    letter-spacing: 0.01em;
}

.stat-premium__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

.stat-premium__visual {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 45%;
    height: 80%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    z-index: 1;
    opacity: 0.8;
}

.stat-premium__visual svg {
    width: 100%;
    height: 100%;
}

/* Decorative blobs */
.hero__blob {
    position: absolute;
    border-radius: 50%;
    z-index: 1;
    filter: blur(60px);
    opacity: 0.35;
}

.hero__blob--1 {
    width: 280px;
    height: 280px;
    background: var(--color-primary);
    top: 30px;
    right: -30px;
}

.hero__blob--2 {
    width: 200px;
    height: 200px;
    background: var(--color-accent);
    bottom: 20px;
    left: 0;
}

/* Float animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

/* =============================================
   POPULAR CATEGORIES SECTION
   ============================================= */
.categories {
    padding: var(--space-4xl) 0;
}

.categories__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.category-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 14px 18px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.category-card__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.category-card__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.category-card__name {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.category-card__count {
    font-size: 12px;
    color: var(--color-text-light);
    line-height: 1.4;
}

/* =============================================
   CATEGORIES EXTRA (hidden/revealed block)
   ============================================= */
.categories__extra {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.55s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease;
    opacity: 0;
}

.categories__extra.is-open {
    max-height: 1500px; /* с запасом для мобильного (1 колонка) */
    opacity: 1;
}

.categories__extra .categories__grid {
    margin-top: var(--space-sm);
}

/* =============================================
   CATEGORIES TOGGLE BUTTON
   ============================================= */
.categories__toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: var(--color-primary);
    color: #fff;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.categories__toggle-btn:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

.categories__toggle-btn-icon {
    font-size: 18px;
    line-height: 1;
}

.categories__toggle-btn-text {
    letter-spacing: -0.01em;
}

.categories__toggle-btn-arrow {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-left: 2px;
}

.categories__toggle-btn.is-open .categories__toggle-btn-arrow {
    transform: rotate(180deg);
}

/* =============================================
   CHANNELS SECTION (Popular & New)
   ============================================= */
.channels {
    padding: var(--space-4xl) 0;
    background: var(--color-bg-section);
}

.new-channels {
    padding: var(--space-4xl) 0;
}

.channels__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    align-items: stretch;
}

/* Channel card — New Design */
.channel-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.channel-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: transparent;
}

/* Badge — правый верхний угол */
.channel-card__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 9px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    z-index: 2;
    white-space: nowrap;
}

.channel-card__badge--public {
    background: #ECFDF5;
    color: #059669;
}

.channel-card__badge--private {
    background: #FEF3C7;
    color: #D97706;
}

/* Верхняя часть: аватар + инфо */
.channel-card__top {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.channel-card__avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.channel-card__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-right: 75px;
}

.channel-card__name {
    font-size: 17px;
    font-weight: 800;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.channel-card__category {
    font-size: 13px;
    color: var(--color-primary);
    font-weight: 600;
}

.channel-card__subs {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--color-text-light);
    font-weight: 500;
    margin-top: 2px;
}

.channel-card__subs svg {
    flex-shrink: 0;
}

/* Описание — заполняет оставшееся место */
.channel-card__desc {
    font-size: 13px;
    line-height: 1.65;
    color: var(--color-text-secondary);
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =============================================
   COLLECTIONS SECTION
   ============================================= */
.collections {
    padding: var(--space-4xl) 0;
    background: var(--color-bg-section);
}

.collections__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

/* ---- Collection tags (used on homepage и во всех шаблонах) ---- */
.col-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    white-space: nowrap;
}

.col-tag--crypto   { background: rgba(245,158,11,0.16);  color: #B45309; }
.col-tag--it       { background: rgba(124,58,237,0.13);  color: #6D28D9; }
.col-tag--business { background: rgba(5,150,105,0.14);   color: #047857; }
.col-tag--news     { background: rgba(220,38,38,0.12);   color: #B91C1C; }
.col-tag--humor    { background: rgba(217,119,6,0.14);   color: #B45309; }
.col-tag--edu      { background: rgba(37,99,235,0.12);   color: #1D4ED8; }
.col-tag--new      { background: #ECFDF5; color: #059669; }

/* ---- Collection card ---- */
.col-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: var(--transition-slow);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    position: relative;
}

.col-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.col-card__header {
    padding: var(--space-xl) var(--space-xl) var(--space-lg);
    background: var(--card-bg, #F8FAFC);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    position: relative;
    overflow: hidden;
}

.col-card__header::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--card-color, #2563EB);
    opacity: 0.07;
    top: -40px;
    right: -20px;
    pointer-events: none;
}

.col-card__icon-wrap {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.col-card__emoji {
    font-size: 26px;
    line-height: 1;
}

.col-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}

.col-card__body {
    padding: var(--space-lg) var(--space-xl) var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.col-card__title {
    font-size: 17px;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.col-card__desc {
    font-size: 14px;
    line-height: 1.65;
    color: var(--color-text-secondary);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.col-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--color-border-light);
    background: #FAFBFC;
}

.col-card__count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 600;
}

.col-card__count svg {
    color: var(--color-text-light);
    flex-shrink: 0;
}

.col-card__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: var(--color-primary);
    transition: var(--transition);
    flex-shrink: 0;
}

.col-card:hover .col-card__arrow {
    background: var(--color-primary);
    color: #fff;
    transform: translateX(2px);
}

/* =============================================
   BOTS & CHATS SECTION
   ============================================= */
.bots-chats {
    padding: var(--space-4xl) 0;
}

.bots-chats__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
}

.bots-chats__card {
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    transition: var(--transition);
}

.bots-chats__card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.bots-chats__icon {
    font-size: 52px;
    margin-bottom: var(--space-md);
}

.bots-chats__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.bots-chats__desc {
    font-size: 15px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-width: 380px;
    margin: 0 auto var(--space-lg);
}

/* =============================================
   BLOG SECTION
   ============================================= */
.blog {
    padding: var(--space-4xl) 0;
    background: var(--color-bg-section);
}

.blog__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.blog-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.blog-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.blog-card__image {
    height: 180px;
    width: 100%;
}

.blog-card__content {
    padding: var(--space-lg);
}

.blog-card__date {
    font-size: 12px;
    color: var(--color-text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-card__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.4;
    margin: var(--space-sm) 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__preview {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__link {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
}

.blog-card__link:hover {
    text-decoration: underline;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: var(--space-2xl);
}

.pagination__pages {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.pagination__btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.pagination__btn--active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.pagination__btn--active:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #fff;
}

.pagination__btn--arrow {
    color: var(--color-text-secondary);
    font-size: 18px;
}

.pagination__btn--arrow:hover {
    color: var(--color-primary);
}

.pagination__btn--arrow:disabled,
.pagination__btn--arrow[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination__dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 42px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-light);
    user-select: none;
    letter-spacing: 2px;
}

/* =============================================
   SEO TEXT SECTION
   ============================================= */
.seo-text {
    padding: var(--space-3xl) 0;
}

.seo-text__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-lg);
}

.seo-text__content p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.seo-text__content p:last-child {
    margin-bottom: 0;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    background: var(--color-text);
    color: #fff;
    padding: var(--space-3xl) 0 var(--space-lg);
}

.footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer__brand .navbar__logo {
    margin-bottom: var(--space-md);
}

.footer__brand .logo-text {
    color: #fff;
}

.footer__brand .logo-accent {
    color: var(--color-accent);
}

.footer__brand-desc {
    font-size: 14px;
    color: var(--color-text-light);
    line-height: 1.7;
    max-width: 280px;
}

.footer__col-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: var(--space-md);
}

.footer__links li {
    margin-bottom: var(--space-sm);
}

.footer__links a {
    font-size: 14px;
    color: var(--color-text-light);
    transition: var(--transition);
}

.footer__links a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer__bottom {
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer__copyright {
    font-size: 13px;
    color: var(--color-text-light);
}

/* =============================================
   MODAL — Добавить канал
   ============================================= */

/* Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Modal window */
.modal {
    position: relative;
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.is-open .modal {
    transform: translateY(0) scale(1);
}

/* Modal header */
.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl) var(--space-xl) 0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

.modal__title {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-bg-section);
    color: var(--color-text-secondary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    flex-shrink: 0;
}

.modal__close:hover {
    background: var(--color-border);
    color: var(--color-text);
}

/* Modal body */
.modal__body {
    padding: var(--space-lg) var(--space-xl) var(--space-xl);
}

/* Form fields */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.form-label span {
    color: var(--color-danger);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--color-bg);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--color-text);
    transition: var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-light);
}

.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error-msg {
    font-size: 12px;
    color: var(--color-danger);
    font-weight: 500;
    display: none;
}

.form-field.has-error .form-error-msg {
    display: block;
}

.form-select {
    appearance: none;
    -webkit-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='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

/* textarea */
.form-textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.6;
}

/* Char counter */
.form-textarea-wrap {
    position: relative;
}

.form-char-counter {
    position: absolute;
    bottom: 10px;
    right: 14px;
    font-size: 11px;
    color: var(--color-text-light);
    font-weight: 500;
    pointer-events: none;
}

.form-char-counter.is-good { color: var(--color-success); }
.form-char-counter.is-warn { color: var(--color-danger); }

/* SEO hint */
.form-hint {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.6;
    color: #92400E;
}

.form-hint__icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.form-hint strong {
    color: var(--color-danger);
}

/* File upload */
.form-file-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.form-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: var(--color-bg-section);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.form-file-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.form-file-name {
    font-size: 13px;
    color: var(--color-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#modalAvatarInput {
    display: none;
}

/* Submit button */
.modal-submit {
    width: 100%;
    padding: 16px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--transition);
    margin-top: var(--space-sm);
}

.modal-submit:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.modal-submit:active {
    transform: translateY(0);
}

.modal-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Success state */
.modal-success {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
    gap: var(--space-lg);
}

.modal-success.is-visible {
    display: flex;
}

.modal-success__icon {
    width: 72px;
    height: 72px;
    background: #ECFDF5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.modal-success__title {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.modal-success__text {
    font-size: 15px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-width: 360px;
}

.modal-success__btn {
    padding: 12px 32px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.modal-success__btn:hover {
    background: var(--color-primary-dark);
}

/* Modal responsive */
@media (max-width: 540px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-height: 95vh;
        transform: translateY(100%);
    }

    .modal-overlay.is-open .modal {
        transform: translateY(0);
    }
}

/* =============================================
   RESPONSIVE — Tablet (≤1024px)
   ============================================= */
@media (max-width: 1024px) {
    .hero__title {
        font-size: 38px;
    }

    .hero__cta {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
    }

    .hero__stats--premium {
        flex-direction: column;
        gap: var(--space-md);
    }

    .stat-premium {
        min-height: 140px;
    }

    .stat-premium__number {
        font-size: 34px;
    }

    .categories__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .channels__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .collections__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================
   RESPONSIVE — Mobile (≤768px)
   ============================================= */
@media (max-width: 768px) {
    :root {
        --space-4xl: 64px;
    }

    .container {
        padding: 0 var(--space-md);
    }

    .channel-card {
        padding: var(--space-lg);
    }

    .channel-card__avatar {
        width: 52px;
        height: 52px;
        font-size: 18px;
    }

    .channel-card__name {
        font-size: 15px;
    }

    .channel-card__desc {
        -webkit-line-clamp: 3;
    }

    /* Pagination mobile */
    .pagination__pages {
        gap: 4px;
    }

    .pagination__btn {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
        border-radius: 6px;
    }

    .pagination__dots {
        min-width: 28px;
        height: 36px;
        font-size: 13px;
    }

    /* Navbar mobile */
    .navbar__hamburger {
        display: flex;
        order: 3;
        position: relative;
        z-index: 1100;
    }

    .navbar__nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: var(--space-2xl);
        transition: all 0.3s ease;
        z-index: 1000;
        margin: 0;
        transform: none !important;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .navbar__actions {
        display: none;
    }

    .navbar__nav--open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .navbar__link {
        padding: var(--space-md);
        font-size: 20px;
        font-weight: 700;
        color: var(--color-text);
        text-align: center;
        transform: none;
        opacity: 1;
        transition: color 0.2s ease;
    }

    .navbar__link--mobile-only {
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin-top: var(--space-lg);
        color: #fff !important;
        background: var(--color-primary) !important;
        width: 80%;
        padding: 16px !important;
        font-size: 15px;
        font-weight: 600;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-md);
    }

    .navbar__link--cta {
        text-align: center;
        margin-top: var(--space-sm);
    }

    .navbar__search {
        display: none;
    }

    /* Hero mobile */
    .hero {
        padding: var(--space-2xl) 0 var(--space-3xl);
    }

    .hero__title {
        font-size: 30px;
    }

    .hero__subtitle {
        font-size: 16px;
    }

    .hero__search-wrapper {
        padding: var(--space-lg);
        background: #F1F5F9;
        margin-bottom: var(--space-2xl);
    }

    .hero__search {
        flex-direction: column;
        background: transparent;
        border: none;
        padding: 0;
        gap: var(--space-md);
    }

    .hero__search-input {
        width: 100%;
        padding: 16px 20px;
        text-align: left;
        background: #fff;
        border-radius: var(--radius-md);
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-sm);
        font-size: 15px;
    }

    .hero__search-btn {
        width: 100%;
        justify-content: center;
        padding: 16px;
        border-radius: var(--radius-md);
        font-size: 16px;
        box-shadow: var(--shadow-md);
    }

    .hero__cta {
        flex-direction: column;
        align-items: center;
    }

    .hero__cta .btn {
        width: 100%;
        justify-content: center;
    }

    .hero__stats--premium {
        flex-direction: column;
        gap: var(--space-md);
    }

    .stat-premium {
        min-height: 120px;
        padding: var(--space-lg);
    }

    .stat-premium__number {
        font-size: 30px;
    }

    .stat-premium__label {
        font-size: 13px;
    }

    .stat-premium__visual {
        width: 35%;
        height: 70%;
        opacity: 0.5;
    }

    /* Sections mobile */
    .section-title {
        font-size: 26px;
    }

    .categories__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .channels__grid {
        grid-template-columns: 1fr;
    }

    .collections__grid {
        grid-template-columns: 1fr;
    }

    .bots-chats__grid {
        grid-template-columns: 1fr;
    }

    .blog__grid {
        grid-template-columns: 1fr;
    }

    .footer__grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
}

/* =============================================
   RESPONSIVE — Small mobile (≤480px)
   ============================================= */
@media (max-width: 480px) {
    .hero__title {
        font-size: 26px;
    }

    .categories__grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        padding: 12px 14px;
    }

    .category-card__icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .section-title {
        font-size: 22px;
    }
}

/* =============================================
   WORDPRESS ADMIN BAR FIX
   Убираем отступ который WP добавляет к <html>
   когда пользователь залогинен как admin
   ============================================= */
html.admin-bar {
    margin-top: 0 !important;
}

/* Скрываем admin bar на фронтенде через CSS (дополнительная защита) */
#wpadminbar {
    display: none !important;
}

/* =============================================
   SEARCH RESULTS DROPDOWN
   ============================================= */
.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 500;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.search-results__item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    border-bottom: 1px solid var(--color-border-light);
}

.search-results__item:last-child {
    border-bottom: none;
}

.search-results__item:hover {
    background: var(--color-bg-section);
}

.search-results__avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.search-results__info {
    flex: 1;
    min-width: 0;
}

.search-results__name {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-results__meta {
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 2px;
}

.search-results__empty {
    padding: 20px;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 14px;
}

/* Position wrapper relative for dropdown */
.hero__search-wrapper {
    position: relative;
}
