/* Channel List Premium Redesign (Ultimate Cinematic Glass) */

:root {
    --chan-bg: #0b0d14;
    --chan-item-bg: rgba(255, 255, 255, 0.02);
    --chan-item-hover: rgba(255, 255, 255, 0.08);
    --chan-active-gradient: linear-gradient(135deg, rgba(64, 196, 255, 0.2) 0%, rgba(30, 30, 40, 0.9) 100%);
    --chan-accent-color: #40c4ff;
    --chan-text-main: #e0e6ed;
    --chan-text-muted: #8a94a6;
    --chan-border-color: rgba(255, 255, 255, 0.05);
}

.channels-column {
    background: var(--chan-bg);
    border-right: 1px solid var(--chan-border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-width: 350px;
    width: 32%;
    max-width: 500px;
}

/* Background Ambient Glow (Subtler than Category) */
.channels-column::before {
    content: '';
    position: absolute;
    top: 20%;
    right: -20%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(64, 196, 255, 0.02), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.channel-header {
    /* Often empty, but let's style it just in case content is added */
    padding: 20px 24px;
    background: transparent;
    z-index: 1;
    position: relative;
    min-height: 20px;
}

/* List Container */
#channels-ul {
    padding: 10px 20px 40px 20px;
    overflow-y: overlay;
    overflow-x: hidden;
    flex-grow: 1;
    z-index: 1;
    scroll-behavior: smooth;
    will-change: transform;
    transform: translateZ(0);
}

#channels-ul::-webkit-scrollbar {
    width: 4px;
}

#channels-ul::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* List Item Styling */
#channels-ul .list-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    /* transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); */
    background: var(--chan-item-bg);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    color: var(--chan-text-muted);
}

/* Hover Effect */
#channels-ul .list-item:hover {
    background: var(--chan-item-hover);
    /* transform: translateX(4px); */
    border-color: rgba(255, 255, 255, 0.1);
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); */
    z-index: 2;
}

#channels-ul .list-item.hidden-category-entry {
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.12), rgba(15, 23, 42, 0.72));
    border-color: rgba(52, 152, 219, 0.18);
}

#channels-ul .list-item.hidden-category-entry .channel-number {
    min-width: 42px;
    color: #40c4ff;
    font-weight: 700;
}

#channels-ul .list-item.hidden-category-entry .channel-name {
    font-weight: 600;
}

/* Number Badge */
.channel-number {
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0;
    border-radius: 0;
    font-variant-numeric: tabular-nums;
    min-width: 30px;
    text-align: right;
    margin-right: 15px;
    font-family: monospace;
}

/* Channel Name */
.channel-name {
    flex-grow: 1;
    font-size: 0.95rem;
    font-weight: 500;
    min-width: 0;
    /* Crucial for text truncation/wrapping in flex */
    width: 100%;
    color: #d1d5db;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* word-wrap: break-word; */
    /* Ensure long words wrap */
    line-height: 1.4;
    padding: 4px 0;
    align-self: center;
}

/* Flag Icon */
#channels-ul .flag-icon {
    width: 28px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
    /* transition: transform 0.3s; */
}

/* Active / Focus State */
#channels-ul .list-item:focus,
#channels-ul .list-item.focus-visible,
#channels-ul .list-item.active {
    background: var(--chan-active-gradient);
    border: 1px solid rgba(64, 196, 255, 0.5);
    /* transform: scale(1.02); */
    /* box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(64, 196, 255, 0.3) inset; */
    outline: none;
    z-index: 10;
}

/* Active Text */
#channels-ul .list-item:focus .channel-name,
#channels-ul .list-item.active .channel-name {
    color: #fff;
    /* font-weight: 700; */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Active Number */
#channels-ul .list-item:focus .channel-number,
#channels-ul .list-item.active .channel-number {
    color: #000;
    /* box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); */
}

/* Active Flag */
#channels-ul .list-item:focus .flag-icon,
#channels-ul .list-item.active .flag-icon {
    /* transform: scale(1.2) rotate(5deg); */
    opacity: 1;
}

/* Quality Badges (HD/FHD/4K) */
.resolution-badge-list {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
}

/* Specific Badge Colors */
.badge-4k {
    border-color: #ffd700;
    color: #ffd700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.2);
}

.badge-fhd {
    border-color: #e74c3c;
    color: #e74c3c;
}

.badge-hd {
    border-color: #3498db;
    color: #3498db;
}

/* Loading State (Skeleton) */
.skeleton-loader {
    height: 50px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 25%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.02) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 12px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Entrance Animation Removed for Max Speed */
#channels-ul .list-item {
    opacity: 1;
    transform: none;
}
