/* --- Estilos para Abas de Categoria --- */
.category-tabs {
    display: flex;
    flex-wrap: wrap; /* Permite que as abas quebrem a linha em telas pequenas */
    border-bottom: 2px solid #a7a7a7;
    margin-bottom: 15px;
    justify-content: center;
    /* --- ADICIONE ESTAS 3 LINHAS --- */
    width: -moz-fit-content;    /* Para Firefox */
    width: fit-content;       /* Largura baseada no conteúdo */
    margin-left: auto;        /* Centraliza o container */
    margin-right: auto;       /* Centraliza o container */
}

.tab-button {
    padding: 10px 15px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    color: #000000;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px; /* Alinha com a borda principal */
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

/* --- Estilos para Lista de Canais (Botões) --- */
.channel-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Espaçamento entre os logos */
    padding: 5px 20px;
    justify-content: center;
}

.channel-button {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 5px;
    background-color: #3b3e47;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 80px; /* Largura fixa para os logos */
    height: 60px; /* Altura fixa para os logos */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.channel-button:hover {
    border-color: #007bff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.channel-button.active {
    border-color: var(--cor-primaria, #007bff);
    box-shadow: 0 0 8px var(--cor-primaria-leve, #007bff90);
}

.channel-button img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Garante que a logo caiba sem distorcer */
}

/* Fallback se a logo não carregar */
.channel-button.no-logo {
    font-size: 10px;
    text-align: center;
    color: var(--cor-texto-secundario, #666);
    line-height: 1.2;
}

/* --- Estilos para a Grade (Os mesmos de antes) --- */
.programa-item {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 8px;
}
.programa-item.agora {
    background-color: #e0f7ff;
    border-left: 4px solid #007bff;
    border-radius: 4px;
}
.programa-item:last-child { border-bottom: none; }
.programa-horario {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--cor-primaria, #007bff);
}
.programa-titulo {
    font-size: 1.1em;
    font-weight: 700;
    margin: 4px 0;
    color: #333;
}
.programa-desc {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

/* --- Estilos para Barra de Progresso do EPG --- */
.programa-progress-bar-container {
    margin-top: 10px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px; /* Espaço entre os horários e a barra */
}

.progress-time-start,
.progress-time-end {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--cor-texto-secundario, #666);
}

.progress-bar-background {
    flex-grow: 1; /* Faz a barra ocupar o espaço restante */
    height: 8px;
    background-color: var(--cor-borda, #eee);
    border-radius: 4px;
    overflow: hidden; /* Garante que a barra interna fique contida */
}

.progress-bar-inner {
    height: 100%;
    width: 0%; /* O JS vai controlar a largura */
    background-color: var(--cor-primaria, #007bff);
    border-radius: 4px;
    transition: width 0.5s ease-out; /* Animação suave */
}

body.dark-mode .tab-button {
    color: var(--text-color);
}

body.dark-mode .tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

body.dark-mode .channel-button {
    background-color: #16213e;
}

body.dark-mode .programa-item.agora {
    background-color: #2c3242;
}

body.dark-mode .programa-titulo {
    color: #e2e2e2;
}

body.dark-mode .programa-desc {
    color: #9e9e9e;
}