/**
 * TeleLive — Channel / profile page (/username)
 * Full-bleed hero, single identity strip, glass panels.
 */

body.page-profile {
    --tl-ch-pad: clamp(14px, 3vw, 28px);
    --tl-ch-radius: 18px;
    --tl-ch-glass: rgba(16, 18, 24, 0.55);
    --tl-ch-line: rgba(255, 255, 255, 0.1);
}

body.page-profile .tl-page-wrapper {
    max-width: none;
    width: 100%;
    padding: 0;
    margin: 0;
}

body.page-profile .tl-main-wrap {
    width: 100%;
    gap: 0;
}

/* ── Full-bleed hero ── */
body.page-profile .tl-offline-hero,
body.page-profile .tl-live-hero {
    width: 100%;
    border-radius: 0 !important;
    border: none !important;
    overflow: hidden;
}

body.page-profile .tl-offline-hero {
    height: clamp(220px, 32vw, 380px);
    background-color: #0c0e14;
    background-image:
        radial-gradient(90% 70% at 20% 0%, rgba(30, 86, 245, 0.35), transparent 55%),
        linear-gradient(160deg, #12151e 0%, #0a0b10 55%, #0e1620 100%);
}

body.page-profile .tl-hero-gradient {
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(8, 10, 14, 0.92) 100%),
        radial-gradient(60% 80% at 85% 20%, rgba(30, 86, 245, 0.18), transparent 60%);
}

body.page-profile .tl-hero-content {
    padding: 0 var(--tl-ch-pad) 56px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

body.page-profile .tl-offline-tag {
    margin: 0;
    border-radius: 8px !important;
    padding: 5px 12px !important;
    font-size: 0.68rem !important;
    font-weight: 800;
    letter-spacing: 0.08em;
    background: rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Brand whisper on banner — not a second headline */
body.page-profile .tl-ch-hero-brand {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
    pointer-events: none;
}
body.page-profile .tl-ch-hero-brand span {
    color: var(--brand-soft, #5280ff);
}

body.page-profile .tl-live-hero .tl-live-video-link {
    aspect-ratio: 21 / 9;
    max-height: min(420px, 48vh);
    border-radius: 0;
}
@media (max-width: 720px) {
    body.page-profile .tl-live-hero .tl-live-video-link {
        aspect-ratio: 16 / 9;
        max-height: none;
    }
}

/* ── Identity strip (channel bar) ── */
body.page-profile .tl-channel-bar {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px 18px;
    width: min(1180px, calc(100% - 2 * var(--tl-ch-pad)));
    margin: -42px auto 0;
    padding: 16px 18px !important;
    border-radius: var(--tl-ch-radius) !important;
    border: 1px solid var(--tl-ch-line) !important;
    border-top-color: rgba(255, 255, 255, 0.16) !important;
    background: var(--tl-ch-glass) !important;
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    animation: tl-ch-rise 0.5s ease both;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body.page-profile .tl-channel-bar {
        background: rgba(18, 20, 28, 0.96) !important;
    }
}

@keyframes tl-ch-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

html body.page-profile .tl-channel-bar .tl-bar-avatar {
    width: 92px !important;
    height: 92px !important;
    border-radius: 50% !important;
    border: 3px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    object-fit: cover;
    background: #12141c;
}

body.page-profile .tl-bar-info {
    padding-bottom: 4px;
    min-width: 0;
}

body.page-profile .tl-bar-name {
    font-size: clamp(1.15rem, 2.4vw, 1.45rem);
    font-weight: 850;
    letter-spacing: -0.02em;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.2;
}

body.page-profile .tl-bar-name .tl-seo-uname {
    font-size: 0.78em;
    font-weight: 650;
    color: rgba(148, 163, 184, 0.95);
}

body.page-profile .tl-last-live-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-inline-start: 2px;
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.page-profile .tl-bar-sub {
    margin-top: 6px;
    font-size: 0.88rem;
    color: var(--text-muted);
    white-space: normal;
}

body.page-profile .tl-bar-actions {
    gap: 8px;
    justify-content: flex-end;
    padding-bottom: 2px;
}

body.page-profile .tl-bar-actions .btn {
    border-radius: 11px !important;
    min-height: 38px;
    font-weight: 700;
}

body.page-profile .tl-bar-actions .btn-primary {
    background: #1e56f5 !important;
    border-color: #1e56f5 !important;
    color: #fff !important;
}

body.page-profile .tl-bar-actions .tl-btn-subscribe {
    background: rgba(30, 86, 245, 0.2) !important;
    border-color: rgba(91, 140, 255, 0.5) !important;
    color: #c7d7ff !important;
}
body.page-profile .tl-bar-actions .tl-btn-subscribe:hover {
    background: #1e56f5 !important;
    color: #fff !important;
}

body.page-profile .tl-bar-actions .tl-btn-donate {
    background: rgba(251, 113, 133, 0.12) !important;
    border: 1px solid rgba(251, 113, 133, 0.35) !important;
    color: #fda4af !important;
}

body.page-profile .tl-bar-actions .tl-btn-subbed {
    background: rgba(34, 197, 94, 0.16) !important;
    border: 1px solid rgba(34, 197, 94, 0.4) !important;
    color: #86efac !important;
}

/* ── Tabs: underline strip (beat theme-apple pill tabs) ── */
html:not([data-theme="lite"]) body.page-profile .tl-tabs-row,
body.page-profile .tl-tabs-row {
    width: min(1180px, calc(100% - 2 * var(--tl-ch-pad)));
    margin: 14px auto 0;
    padding: 0 6px !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--tl-ch-line) !important;
    background: transparent !important;
    gap: 2px;
}

html:not([data-theme="lite"]) body.page-profile .tl-tab,
body.page-profile .tl-tab {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    padding: 12px 14px !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    font-size: 0.88rem !important;
    font-weight: 750;
    color: var(--text-muted) !important;
    background: transparent !important;
}
html:not([data-theme="lite"]) body.page-profile .tl-tab i,
body.page-profile .tl-tab i {
    font-size: 0.85em;
    opacity: 0.85;
}
html:not([data-theme="lite"]) body.page-profile .tl-tab:hover,
body.page-profile .tl-tab:hover {
    color: var(--text) !important;
    background: transparent !important;
}
html:not([data-theme="lite"]) body.page-profile .tl-tab.active,
body.page-profile .tl-tab.active {
    color: #fff !important;
    border-bottom-color: var(--brand, #1e56f5) !important;
    background: transparent !important;
}

/* ── Body / panels ── */
body.page-profile .tl-tabs-body {
    width: min(1180px, calc(100% - 2 * var(--tl-ch-pad)));
    margin: 0 auto;
    padding: 22px 0 48px;
}

body.page-profile .tl-profile-home {
    gap: 32px;
    padding-top: 4px;
}

body.page-profile .tl-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

body.page-profile .tl-ph-heading {
    font-size: 1.05rem;
    font-weight: 850;
    letter-spacing: -0.01em;
}

body.page-profile .tl-see-all {
    font-size: 0.82rem;
    font-weight: 750;
    color: #93c5fd;
    text-decoration: none;
}
body.page-profile .tl-see-all:hover {
    color: #fff;
    text-decoration: underline;
}

body.page-profile .tl-ph-media-row .pt-media-card,
body.page-profile .pt-media-grid .pt-media-card {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
body.page-profile .pt-media-grid .pt-media-card:hover {
    border-color: rgba(82, 128, 255, 0.35);
    transform: translateY(-2px);
}

/* Clips + categories match homepage */
body.page-profile .tl-ph-clips,
body.page-profile #clipsGrid.tl-clips-grid {
    margin-top: 2px;
}
body.page-profile .tl-ph-cats-row {
    width: 100%;
    padding-bottom: 6px;
}
body.page-profile .tl-ph-cats-row .category-card-scroll {
    width: 92px;
}

/* ── About ── */
body.page-profile .tl-bio-card {
    position: relative;
    isolation: isolate;
    border-radius: var(--tl-ch-radius);
    border: 1px solid var(--tl-ch-line);
    border-top-color: rgba(255, 255, 255, 0.15);
    background: var(--tl-ch-glass);
    padding: 20px 18px;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
}
body.page-profile .tl-bio-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    backdrop-filter: blur(18px) saturate(165%);
    -webkit-backdrop-filter: blur(18px) saturate(165%);
    pointer-events: none;
}
body.page-profile .tl-bio-card h4 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 850;
    letter-spacing: -0.01em;
}

body.page-profile .tl-stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}
body.page-profile .tl-stat {
    padding: 12px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    text-align: center;
}
body.page-profile .tl-stat strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 850;
    color: #fff;
}
body.page-profile .tl-stat span {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 650;
}

body.page-profile .tl-social-row {
    margin-top: 16px !important;
    gap: 10px !important;
}
body.page-profile .tl-bio-card .tl-social-link--icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile */
@media (max-width: 820px) {
    html body.page-profile .tl-channel-bar {
        grid-template-columns: auto minmax(0, 1fr);
        margin-top: -36px;
        padding: 14px !important;
        align-items: end !important;
    }
    html body.page-profile .tl-channel-bar .tl-bar-avatar {
        width: 72px !important;
        height: 72px !important;
        border-radius: 50% !important;
    }
    html body.page-profile .tl-bar-name {
        font-size: 1.1rem !important;
    }
    html body.page-profile .tl-bar-actions {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: stretch;
        flex-basis: auto !important;
    }
    body.page-profile .tl-bar-actions .btn {
        flex: 1 1 auto;
    }
    body.page-profile .tl-bar-actions .tl-icon-btn {
        flex: 0 0 38px;
    }
    body.page-profile .tl-stats-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    body.page-profile .tl-offline-hero {
        height: 200px;
    }
    body.page-profile .tl-hero-content {
        padding-bottom: 48px;
    }
    body.page-profile .tl-ch-hero-brand {
        font-size: 1.45rem;
    }
    body.page-profile .tl-tab {
        padding: 11px 12px;
        font-size: 0.82rem;
    }
}

/* Light theme */
[data-theme="light"] body.page-profile .tl-channel-bar,
[data-theme="light"] body.page-profile .tl-bio-card {
    background: rgba(252, 252, 253, 0.88) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] body.page-profile .tl-bar-name {
    color: var(--text);
}
[data-theme="light"] body.page-profile .tl-tab.active {
    color: var(--brand-strong, #1245d6);
}

@media (prefers-reduced-motion: reduce) {
    body.page-profile .tl-channel-bar {
        animation: none;
    }
}
