/* ==========================================
   sidebar.css — Modern YouTube Live Guide with Smooth Categories (No Sticky)
   ========================================== */

/* ── Live Guide Sidebar Base ── */
.yt-guide {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    z-index: 200;
    background: var(--bg) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* ── Mobile: fixed overlay toggled via transform ── */
@media (max-width: 768px) {
    .yt-guide {
        position: fixed;
        top: var(--nav-h);
        left: 0;
        bottom: 0;
        width: min(290px, 85vw);
        transition: transform 0.28s var(--ease);
        transform: translateX(-100%);
    }

    .yt-guide:not(.closed) {
        transform: translateX(0);
    }
}

@media (max-width: 480px) {
    .yt-guide {
        width: min(290px, 92vw);
    }
}

.yt-guide-head {
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.yt-guide-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.channel-count {
    font-size: 0.7rem;
    color: var(--text2);
    background: var(--surface);
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.ch-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0 20px;
}

/* Category labels — now scroll normally, no sticky */
.cat-label {
    padding: 16px 20px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text3);
    background: transparent;
}

.ch-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    min-height: 56px;
}

.ch-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
}

.ch-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.ch-item.active {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--red);
}

/* ── Channel Logos ── */
.ch-logo-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #ffffff;
    border-radius: 10px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.ch-item:hover .ch-logo-box {
    transform: scale(1.02);
}

.ch-logo-box--guide {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    padding: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ch-logo-box--tile {
    width: 100%;
    height: 100%;
    border-radius: var(--radius);
    padding: 8px 12px;
}

.ch-logo-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
}

.ch-logo-fallback {
    display: none;
    width: 100%;
    height: 100%;
    place-items: center;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--red);
}

.ch-logo-box--guide .ch-logo-fallback {
    font-size: 0.65rem;
}

.ch-logo-box--tile .ch-logo-fallback {
    font-size: 1.2rem;
}

.ch-logo-box.logo-failed .ch-logo-img {
    display: none;
}

.ch-logo-box.logo-failed .ch-logo-fallback {
    display: grid;
}

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

.ch-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-item.active .ch-name {
    color: var(--text);
    font-weight: 600;
}

.ch-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.ch-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text3);
}

.ch-item.active .ch-live-dot {
    background: var(--red);
    animation: blink 1.6s ease-in-out infinite;
}

.q-badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}

.q-badge.fhd {
    color: var(--blue);
    background: rgba(62, 166, 255, 0.12);
}

.q-badge.hd {
    color: var(--text2);
    background: var(--surface);
}

.q-badge.sd {
    color: var(--orange);
    background: rgba(251, 146, 60, 0.12);
}


.ch-initials {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--red);
}

.no-results {
    padding: 40px 20px;
    font-size: 0.85rem;
    color: var(--text3);
    text-align: center;
    display: none;
}

.guide-meta-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-offline-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text3);
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all var(--transition-fast);
}

.toggle-offline-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.toggle-offline-btn svg {
    display: block;
}

.toggle-offline-btn svg.hidden {
    display: none;
}