/* ============================================================
   ExoticExpansion 2 — Channels / Creator Discovery
   Premium creator discovery UI — YouTube/Spotify inspired
   ============================================================ */

/* ── Hero ───────────────────────────────────────────────────── */
.ch-hero {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 44px;
}

.ch-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 80% at 10% 50%,  rgba(var(--accent-green-rgb),0.22)  0%, transparent 55%),
        radial-gradient(ellipse 60% 70% at 90% 20%,  rgba(var(--accent-purple-rgb),0.2)   0%, transparent 55%),
        radial-gradient(ellipse 50% 60% at 55% 90%,  rgba(var(--accent-blue-rgb),0.18)  0%, transparent 50%),
        var(--bg-elevated);
    background-size: 300% 300%;
    animation: gradientShift 14s ease infinite;
}

/* Subtle dot-grid texture */
.ch-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 28px 28px;
}

.ch-hero-content {
    position: relative;
    z-index: 1;
    padding: 52px 48px;
    width: 100%;
    max-width: 720px;
}

.ch-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand-green);
    margin-bottom: 14px;
    background: rgba(var(--accent-green-rgb),0.1);
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid rgba(var(--accent-green-rgb),0.2);
}

.ch-hero-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin: 0 0 14px;
}

.ch-hero-sub {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 28px;
}

/* ── Hero Search Bar ─────────────────────────────────────────── */
.ch-search-form { width: 100%; max-width: 580px; }

.ch-search-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(8, 8, 20, 0.72);
    border: 1.5px solid var(--border-light);
    border-radius: 50px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.ch-search-bar:focus-within {
    border-color: var(--brand-green);
    box-shadow: 0 0 0 4px rgba(var(--accent-green-rgb),0.14), 0 8px 32px rgba(0,0,0,0.4);
}

.ch-search-icon {
    padding: 0 16px 0 22px;
    color: var(--text-muted);
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: color 0.2s;
}

.ch-search-bar:focus-within .ch-search-icon { color: var(--brand-green); }

.ch-search-bar input[type="text"] {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 14px 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font);
    min-width: 0;
}

.ch-search-bar input::placeholder { color: var(--text-muted); }

.ch-search-clear {
    padding: 0 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: color 0.2s;
}
.ch-search-clear:hover { color: var(--text-primary); }

.ch-search-btn {
    padding: 10px 22px;
    margin: 4px;
    border-radius: 40px;
    background: var(--grad);
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
    font-family: var(--font);
    background-size: 200%;
    animation: gradientShift 4s ease infinite;
}
.ch-search-btn:hover { opacity: 0.9; transform: scale(1.03); }

/* ── Hero Stats ──────────────────────────────────────────────── */
.ch-hero-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.ch-hero-stat {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ch-hero-stat strong {
    font-size: 1.25rem;
    font-weight: 800;
    background: var(--grad-animate);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientTextShift 5s ease infinite;
    line-height: 1.2;
}

.ch-hero-stat span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    font-weight: 600;
}

.ch-hero-sep {
    color: var(--border-light);
    font-size: 1.2rem;
    user-select: none;
}

/* ── Browse by Category ──────────────────────────────────────── */
.ch-browse-section { margin-bottom: 44px; }

.ch-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

.ch-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
    position: relative;
    overflow: hidden;
    text-align: center;
    animation: fadeInUp 0.35s ease both;
}

.ch-cat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--cat-color) 8%, transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.ch-cat-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--cat-color) 50%, transparent);
    box-shadow: 0 10px 28px rgba(0,0,0,0.4), 0 0 0 1px color-mix(in srgb, var(--cat-color) 20%, transparent);
}
.ch-cat-card:hover::before { opacity: 1; }

.ch-cat-icon {
    font-size: 1.5rem;
    color: var(--cat-color);
    position: relative;
    z-index: 1;
    transition: transform 0.2s;
}
.ch-cat-card:hover .ch-cat-icon { transform: scale(1.15); }

.ch-cat-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.ch-cat-count {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* ── Featured Section ────────────────────────────────────────── */
.ch-featured-section { margin-bottom: 44px; }

/* ── Channel Grid ────────────────────────────────────────────── */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

.channel-grid--featured {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 8px;
}

/* ── Channel Card ────────────────────────────────────────────── */
.channel-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    animation: fadeInUp 0.4s ease both;
    position: relative;
    overflow: hidden;
}

/* Gradient top-line on hover */
.channel-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--grad-animate);
    background-size: 300% 300%;
    animation: gradientShift 4s ease infinite;
    opacity: 0;
    transition: opacity 0.22s;
}

/* Subtle inner glow overlay */
.channel-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--grad-subtle);
    opacity: 0;
    transition: opacity 0.22s;
    border-radius: inherit;
    pointer-events: none;
}

.channel-card:hover {
    transform: translateY(-6px);
    border-color: rgba(var(--accent-green-rgb),0.3);
    box-shadow: 0 20px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(var(--accent-green-rgb),0.15),
                0 0 32px rgba(var(--accent-green-rgb),0.08);
}
.channel-card:hover::before { opacity: 1; }
.channel-card:hover::after  { opacity: 1; }

.channel-card--featured {
    padding: 28px 20px 22px;
}

/* ── Avatar ──────────────────────────────────────────────────── */
.cc-avatar-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
    flex-shrink: 0;
    z-index: 1;
}

.cc-avatar-wrap--lg {
    width: 96px;
    height: 96px;
    margin-bottom: 14px;
}

/* Animated gradient ring that appears on hover */
.cc-avatar-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--grad-animate);
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
    opacity: 0;
    transition: opacity 0.25s;
}
.channel-card:hover .cc-avatar-ring { opacity: 1; }

.cc-avatar {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-card);
    transition: transform 0.25s ease;
    display: block;
}
.channel-card:hover .cc-avatar { transform: scale(1.06); }

.cc-avatar-wrap--lg .cc-avatar { border-width: 3px; }

/* Verified badge */
.cc-verified {
    position: absolute;
    bottom: 2px;
    right: 2px;
    z-index: 2;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--brand-blue);
    border: 2px solid var(--bg-card);
    box-shadow: 0 2px 8px rgba(var(--accent-blue-rgb),0.4);
}

/* ── Card Text ───────────────────────────────────────────────── */
.cc-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 3px;
    line-height: 1.3;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
    transition: color 0.2s;

    /* clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.channel-card:hover .cc-name { color: var(--brand-green); }

.channel-card--featured .cc-name { font-size: 1.05rem; }

.cc-handle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 10px;
    position: relative;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Category tag */
.cc-tag {
    display: inline-block;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-green);
    background: rgba(var(--accent-green-rgb),0.12);
    border: 1px solid rgba(var(--accent-green-rgb),0.2);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    transition: background 0.2s, border-color 0.2s;
}
.channel-card:hover .cc-tag {
    background: rgba(var(--accent-green-rgb),0.2);
    border-color: rgba(var(--accent-green-rgb),0.4);
}

/* Stats row */
.cc-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.cc-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cc-stats i {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Short description snippet */
.cc-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Follow button */
.cc-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border-radius: 20px;
    border: 1.5px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: auto;
    position: relative;
    z-index: 1;
    transition: all 0.2s ease;
    background: transparent;
}

.channel-card:hover .cc-follow-btn {
    background: var(--grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(var(--accent-green-rgb),0.35);
    transform: translateY(-1px);
}

/* ── Filter Bar ──────────────────────────────────────────────── */
.ch-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.ch-filter-left {
    flex-shrink: 0;
}

.ch-result-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.ch-result-label strong { color: var(--text-primary); }
.ch-query-text { color: var(--brand-green); font-style: normal; }

.ch-clear-filter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 3px 10px;
    border-radius: 12px;
    transition: color 0.2s, border-color 0.2s;
}
.ch-clear-filter:hover { color: var(--red); border-color: var(--red); }

.ch-filter-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

/* Category chips scroll row */
.ch-cat-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -ms-overflow-style: none;
    scrollbar-width: none;
    max-width: 480px;
}
.ch-cat-chips::-webkit-scrollbar { display: none; }

.ch-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.18s;
    text-decoration: none;
}

.ch-chip:hover {
    border-color: var(--brand-green);
    color: var(--brand-green);
    background: rgba(var(--accent-green-rgb),0.06);
}

.ch-chip.active {
    background: var(--grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 12px rgba(var(--accent-green-rgb),0.3);
}

/* Sort select */
.ch-sort-select {
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: var(--font);
    padding: 7px 12px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234a4a6a'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
.ch-sort-select:hover,
.ch-sort-select:focus { border-color: var(--brand-green); color: var(--text-primary); }
.ch-sort-select option { background: var(--bg-card); }

/* ── Pagination ──────────────────────────────────────────────── */
.ch-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 40px 0 8px;
    flex-wrap: wrap;
}

.ch-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1.5px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s;
}

.ch-page-btn:hover {
    border-color: var(--brand-green);
    color: var(--brand-green);
    background: rgba(var(--accent-green-rgb),0.06);
}

.ch-page-btn.active {
    background: var(--grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 14px rgba(var(--accent-green-rgb),0.35);
}

/* ── Empty state tweak ───────────────────────────────────────── */
.ch-empty { margin-top: 20px; }

/* ── Animation stagger helpers ───────────────────────────────── */
.ch-cat-card:nth-child(1)  { animation-delay: 0.02s; }
.ch-cat-card:nth-child(2)  { animation-delay: 0.04s; }
.ch-cat-card:nth-child(3)  { animation-delay: 0.06s; }
.ch-cat-card:nth-child(4)  { animation-delay: 0.08s; }
.ch-cat-card:nth-child(5)  { animation-delay: 0.10s; }
.ch-cat-card:nth-child(6)  { animation-delay: 0.12s; }
.ch-cat-card:nth-child(7)  { animation-delay: 0.14s; }
.ch-cat-card:nth-child(8)  { animation-delay: 0.16s; }
.ch-cat-card:nth-child(9)  { animation-delay: 0.18s; }
.ch-cat-card:nth-child(10) { animation-delay: 0.20s; }

/* ── Skeleton loader ─────────────────────────────────────────── */
.channel-card.skeleton {
    pointer-events: none;
}
.channel-card.skeleton .cc-avatar {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-elevated) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-color: transparent;
}
.channel-card.skeleton .cc-name,
.channel-card.skeleton .cc-handle,
.channel-card.skeleton .cc-tag,
.channel-card.skeleton .cc-stats,
.channel-card.skeleton .cc-follow-btn {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-elevated) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
    color: transparent;
    border-color: transparent;
    -webkit-text-fill-color: transparent;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (min-width: 1400px) {
    .channel-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

@media (max-width: 1100px) {
    .channel-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
    .channel-grid--featured { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 900px) {
    .ch-hero-content { padding: 36px 28px; }
    .ch-hero-title   { font-size: 1.9rem; }
    .ch-cat-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); gap: 10px; }
    .channel-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .channel-grid--featured { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .ch-filter-bar { flex-direction: column; align-items: flex-start; }
    .ch-filter-right { width: 100%; }
    .ch-cat-chips { max-width: 100%; }
}

@media (max-width: 600px) {
    .ch-hero { border-radius: 12px; margin-bottom: 28px; }
    .ch-hero-content { padding: 28px 20px; }
    .ch-hero-title { font-size: 1.55rem; }
    .ch-hero-sub { font-size: 0.88rem; }
    .ch-search-btn { padding: 9px 16px; font-size: 0.8rem; }
    .ch-hero-stats { gap: 10px; }
    .ch-hero-stat strong { font-size: 1rem; }
    .ch-hero-sep { display: none; }
    .ch-hero-stats { gap: 14px; }

    .ch-browse-section { margin-bottom: 28px; }
    .ch-cat-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
    .ch-cat-card { padding: 14px 6px 12px; }
    .ch-cat-icon { font-size: 1.2rem; }
    .ch-cat-name { font-size: 0.65rem; }
    .ch-cat-count { display: none; }

    .channel-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .channel-grid--featured { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .channel-card { padding: 18px 12px 14px; }
    .cc-avatar-wrap { width: 64px; height: 64px; }
    .cc-avatar-wrap--lg { width: 72px; height: 72px; }
    .cc-name { font-size: 0.85rem; }
    .cc-desc { display: none; }

    .ch-filter-bar { gap: 12px; }
    .ch-cat-chips { max-width: 100%; }
}

@media (max-width: 380px) {
    .channel-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .ch-cat-grid  { grid-template-columns: repeat(4, 1fr); }
}
