/* ========================================
   LIVE TV — Layout 3 Colunas Premium
   Categorias | Canais | Preview
   ======================================== */

/* ---- Container Principal ---- */
.live-tv-container {
    display: flex;
    height: calc(100vh - var(--navbar-height));
    width: 100%;
    background: #020202;
    overflow: hidden;
}

/* Scrollbars Universais Ultra Finas */
.live-categories-list::-webkit-scrollbar,
.live-channels-list::-webkit-scrollbar {
    width: 4px;
}

.live-categories-list::-webkit-scrollbar-thumb,
.live-channels-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.live-categories-list:hover::-webkit-scrollbar-thumb,
.live-channels-list:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================== */
/* COLUNA 1 — Categorias          */
/* ============================== */
.live-categories-panel {
    flex: 0 0 250px;
    min-width: 200px;
    max-width: 300px;
    background: #050505;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-categories-header {
    padding: 16px 16px 8px;
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: 2px;
    color: var(--color-primary);
    text-transform: uppercase;
    flex-shrink: 0;
}

.live-categories-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.live-categories-list::-webkit-scrollbar {
    width: 4px;
}

.live-categories-list::-webkit-scrollbar-track {
    background: transparent;
}

.live-categories-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* ============================== */
/* COLUNA 2 — Lista de Canais     */
/* ============================== */
.live-channels-panel {
    flex: 0 0 320px;
    min-width: 280px;
    max-width: 380px;
    background: #080808;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-channels-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
}

.live-channels-header-title {
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: 1.5px;
    color: var(--color-text);
    text-transform: uppercase;
}

.live-channels-count {
    font-size: 11px;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 10px;
}

.live-channels-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.live-channels-list::-webkit-scrollbar {
    width: 4px;
}

.live-channels-list::-webkit-scrollbar-track {
    background: transparent;
}

.live-channels-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* ============================== */
/* ESTILO UNIFICADO DE LISTA PREMIUM */
/* ============================== */
.live-cat-item,
.live-channel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 4px 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-channel-item {
    text-transform: none;
    /* Canais mantém o nome original */
    letter-spacing: normal;
}

.live-cat-item:hover,
.live-channel-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateX(4px);
}

.live-cat-item.active,
.live-channel-item.active {
    background: rgba(229, 9, 20, 0.15);
    border-color: rgba(229, 9, 20, 0.4);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.2);
}

.live-cat-item.active::before,
.live-channel-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: var(--color-primary);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 10px var(--color-primary);
}

/* Específicos da Lista de Canais */
.channel-card-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.live-channel-num {
    font-family: 'Inter', monospace;
    font-size: 10px;
    color: var(--color-primary);
    opacity: 0.6;
    min-width: 25px;
    text-align: right;
}

.live-channel-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #111;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.live-channel-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-channel-icon .channel-icon-placeholder {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

.live-channel-name {
    font-size: 13px;
    font-weight: 500;
    color: #d0d0d0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.live-channel-item.active .live-channel-name {
    color: #fff;
    font-weight: 600;
}

.live-channel-item.active .live-channel-num {
    color: var(--color-primary);
}

/* ============================== */
/* COLUNA 3 — Preview / Player    */
/* ============================== */
.live-preview-panel {
    flex: 1;
    min-width: 0;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-preview-player {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.live-preview-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.live-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--color-text-muted);
    text-align: center;
    padding: 20px;
}

.live-preview-placeholder .placeholder-icon {
    font-size: 48px;
    opacity: 0.3;
}

.live-preview-placeholder .placeholder-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.live-preview-placeholder .placeholder-sub {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Overlay do Player (nome do canal no topo) */
.live-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.live-preview-player:hover .live-preview-overlay {
    opacity: 1;
}

.live-preview-channel-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.live-preview-live-badge {
    font-size: 10px;
    padding: 3px 8px;
    background: var(--color-primary);
    border-radius: 3px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Loading spinner no preview */
.live-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3;
}

.live-preview-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---- Painel de Ações (abaixo do player) ---- */
.live-preview-actions {
    flex-shrink: 0;
    padding: 16px 20px;
    background: #0d0d0d;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.live-preview-now-playing {
    font-family: var(--font-display);
    font-size: 18px;
    letter-spacing: 1.5px;
    color: var(--color-text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
    text-transform: uppercase;
}

.live-action-btn svg {
    flex-shrink: 0;
}

.live-action-btn.fullscreen-btn {
    background: var(--color-primary);
    color: #fff;
}

.live-action-btn.fullscreen-btn:hover {
    background: var(--color-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.live-action-btn.fav-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.live-action-btn.fav-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.live-action-btn.search-btn {
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.live-action-btn.search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
}

/* ---- Busca de canais inline ---- */
.live-channels-search {
    padding: 8px 12px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: none;
}

.live-channels-search.active {
    display: block;
}

.live-channels-search input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.live-channels-search input:focus {
    border-color: var(--color-primary);
}

.live-channels-search input::placeholder {
    color: var(--color-text-muted);
}

/* ============================== */
/* Responsividade                  */
/* ============================== */
@media (max-width: 1024px) {
    .live-categories-panel {
        flex: 0 0 160px;
        min-width: 140px;
    }

    .live-channels-panel {
        flex: 0 0 260px;
        min-width: 220px;
    }
}

@media (max-width: 768px) {
    .live-tv-container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - var(--navbar-height));
    }

    .live-categories-panel {
        flex: none;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 120px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .live-categories-list {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 8px;
        gap: 4px;
    }

    .live-cat-item {
        padding: 8px 12px;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        font-size: 12px;
    }

    .live-cat-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--color-primary);
    }

    .live-channels-panel {
        flex: none;
        width: 100%;
        max-width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .live-preview-panel {
        flex: none;
        width: 100%;
        min-height: 300px;
    }

    .live-preview-player {
        height: 56.25vw;
        /* 16:9 */
        max-height: 300px;
        flex: none;
    }
}