/* ==========================================================================
   MOBILE HEADER
   ========================================================================== */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
}

.mobile-brand span {
    color: var(--primary-light);
}

.mobile-brand .mobile-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    padding: 3px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 10px var(--primary-glow);
}

.mobile-live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

/* ==========================================================================
   SIDEBAR & RESIZER
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width, 320px);
    min-width: 250px;
    max-width: 600px;
    height: 100%;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
    position: relative;
    overflow: hidden;
}

/* Drag to resize handle */
.sidebar-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 120;
    transition: background var(--transition-fast);
}

.sidebar-resizer:hover,
body.is-resizing .sidebar-resizer {
    background: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

body.is-resizing {
    user-select: none !important;
    cursor: col-resize !important;
}

.sidebar-header {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
    transition: opacity var(--transition-fast);
}

.brand:hover {
    opacity: 0.95;
}

.brand-icon-wrapper {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(28, 28, 34, 0.9), rgba(16, 16, 20, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 255, 255, 0.06);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.brand:hover .brand-icon-wrapper {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 255, 255, 0.12);
}

.brand-logo-img-header {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform var(--transition-fast);
}

.brand:hover .brand-logo-img-header {
    transform: scale(1.02);
}

.mobile-brand .brand-logo-img-header {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    flex-shrink: 0;
}

.brand-text h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-text h2 span {
    background: linear-gradient(135deg, #ffffff, #d4d4d8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #e4e4e7;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
}

.close-mobile {
    display: none;
}

/* Search Bar */
.search-container {
    padding: 12px 16px 8px;
    flex-shrink: 0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0 10px;
    transition: var(--transition-fast);
}

.search-input-wrapper:focus-within {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input-wrapper input {
    width: 100%;
    padding: 8px 6px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: var(--font-body);
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.btn-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
}
.btn-clear:hover {
    color: var(--text-primary);
}
.hidden {
    display: none !important;
}

/* Category Filter Pills */
.filter-pills-container {
    display: flex;
    gap: 6px;
    padding: 4px 16px 10px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}
.filter-pills-container::-webkit-scrollbar {
    display: none;
}

.pill {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.pill.active {
    background: #ffffff;
    border-color: #ffffff;
    color: #080808;
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(255, 255, 255, 0.25);
}

.pill.pill-adblock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.08);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.pill.pill-adblock:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

/* Channels Navigation List with Robust Scroll */
.channels-nav {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 12px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.channels-nav::-webkit-scrollbar {
    width: 6px;
}
.channels-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
.channels-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}
.channels-nav::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Accordion Category */
.category-group {
    border-radius: var(--radius-md);
    background: rgba(26, 32, 44, 0.45);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.category-group:hover {
    border-color: var(--border-medium);
}

.category-header {
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    transition: var(--transition-fast);
}

.category-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-badge-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

.category-chevron {
    color: var(--text-muted);
    transition: transform var(--transition-base);
}

.category-group.open .category-chevron {
    transform: rotate(180deg);
}

.channel-items-list {
    display: none;
    padding: 4px 8px 8px;
    flex-direction: column;
    gap: 4px;
}

.category-group.open .channel-items-list {
    display: flex;
}

/* Channel Button */
.channel-btn {
    width: 100%;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    transition: var(--transition-fast);
}

.channel-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    transform: translateX(2px);
}

.channel-btn.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: transparent;
    border-left: 3px solid #ffffff;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: #ffffff;
    font-weight: 700;
}

.channel-btn .channel-info-left {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.channel-btn .channel-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-btn .channel-options-count {
    font-size: 0.68rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}

.channel-btn.active .channel-options-count {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

