* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body, html {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #111;
    color: #fff;
}

.tv-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: url('FundoDarkRadio.png') no-repeat center center fixed;
    background-size: cover;
    display: grid;
    grid-template-columns: 20% 1fr;
    grid-template-rows: 1fr 65px;
    grid-template-areas: 
        "sidebar content"
        "player player";
    padding: 8px;
    gap: 8px;
}

.tv-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 5, 2, 0.82);
    z-index: 0;
}

.tv-container > * {
    position: relative;
    z-index: 1;
}

/* --- Barra Lateral de Filtros (20% da Tela) --- */
.sidebar-tv {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    height: 100%;
    background-color: transparent;
    border: 1px solid rgba(243, 156, 18, 0.3);
    border-radius: 8px;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 0;
    text-align: left;
}

.sidebar-title {
    color: #ff9800;
    font-size: 14px;
    font-weight: bold;
    margin: 0;
}

.sidebar-subtitle {
    color: #b0b0b0;
    font-size: 8px;
    margin: 0;
}

.filters-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-group label, 
.sidebar-tv label, 
.sidebar-tv .filter-label {
    font-size: 0.65rem;
    font-weight: bold;
    color: #b3b3b3;
    margin-bottom: 1px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-tv select,
.sidebar-tv input[type="text"],
.filter-group select, 
.filter-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #333333;
    color: #fff;
    padding: 5px 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.sidebar-tv select:focus,
.sidebar-tv input[type="text"]:focus,
.filter-group select:focus, 
.filter-group input:focus {
    border-color: #1db954 !important;
    background-color: rgba(29, 185, 84, 0.15) !important;
    outline: none !important;
    box-shadow: 0 0 6px rgba(29, 185, 84, 0.5);
}

.sidebar-tv select option {
    background-color: #181818;
    color: #ffffff;
    padding: 6px;
}

/* --- 1. Selects e Inputs com Filtro Ativo --- */
.sidebar-tv select.filtro-ativo,
.sidebar-tv input[type="text"].filtro-ativo {
    border-color: #f39c12 !important;
    background-color: rgba(243, 156, 18, 0.2) !important;
    color: #f39c12 !important;
    font-weight: bold;
}

/* --- 2. Prioridade de Foco: Quando qualquer input/select ganha foco, a borda fica verde --- */
.sidebar-tv select:focus,
.sidebar-tv input[type="text"]:focus,
.sidebar-tv select.filtro-ativo:focus,
.sidebar-tv input[type="text"].filtro-ativo:focus {
    border-color: #2ecc71 !important; /* Borda verde de foco */
    background-color: rgba(46, 204, 113, 0.15) !important;
    color: #ffffff !important;
    outline: none;
}

/* --- 3. Padrão dos Botões da Barra Lateral --- */
.sidebar-tv button,
.sidebar-tv .btn-acao {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border: 2px solid #333333 !important;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.2s ease;
}

/* --- 4. Foco nos Botões (Borda Verde) --- */
.sidebar-tv button:focus,
.sidebar-tv button.focado,
.sidebar-tv .btn-acao:focus {
    border-color: #2ecc71 !important; /* Borda verde solicitada */
    background-color: rgba(46, 204, 113, 0.25) !important;
    color: #ffffff !important;
    outline: none;
}




.search-input-wrapper {
    display: flex;
    gap: 4px;
}

.search-input-wrapper input {
    flex: 1;
}

.search-input-wrapper button {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #333333;
    color: white;
    padding: 0 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-secondary,
.btn-pesquisar {
    width: 100%;
    padding: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid #333333;
    box-sizing: border-box;
    text-transform: uppercase;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    color: #ddd;
    transition: all 0.2s;
}

.btn-pesquisar {
	background-color: rgba(255, 255, 18, 0.2);
    color: #f39c12;
    border-color: #f39c12;
}

.btn-secondary:focus,
.btn-pesquisar:focus {
    background-color: rgba(29, 185, 84, 0.2) !important;
    border-color: #1db954 !important;
    color: #ffffff !important;
    outline: none !important;
    box-shadow: 0 0 8px rgba(29, 185, 84, 0.6);
    transform: scale(1.02);
}

/* --- Área Central (Listas Lado a Lado) --- */
.content-tv-dual {
    grid-area: content;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    overflow: hidden;
    min-width: 0;
    height: 100%;
}

.list-panel {    
    background: rgba(20, 15, 10, 0.15);
    border: 1px solid rgba(243, 156, 18, 0.3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(8px);
    min-width: 0;
    height: 100%;
}

.panel-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #e5e5e5;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.count-badge,
.station-count-badge,
.search-count {
    font-size: 0.7rem;
    padding: 2px 5px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-weight: bold;
    color: #1db954;
}

.tabs-header-dual,
.tabs-container, 
.secondary-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid #333;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #aaa;
    padding: 6px 4px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #f39c12;
    background: rgba(243, 156, 18, 0.08);
    border-bottom-color: #1db954;
}

.tab-btn:focus {
    outline: none;
    background-color: rgba(29, 185, 84, 0.15);
    color: #ffffff;
    border-color: #1db954;
}

.radio-list-tv {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.radio-list-tv::-webkit-scrollbar {
    width: 4px;
}
.radio-list-tv::-webkit-scrollbar-thumb {    
    background: #444;
    border-radius: 2px;
}

/* --- Cartões de Rádio --- */
.radio-row-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 9px;
    background-color: #181818;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    width: 100%;
}

.radio-row-info {
    min-width: 0;
    flex: 1;
    padding-right: 6px;
}

.radio-row-info h4 {
    font-size: 0.82rem;
    color: #ffffff;
    margin: 0 0 1px 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.radio-row-info p {
    font-size: 0.7rem;
    color: #b3b3b3;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.radio-row-card:focus,
.radio-row-card:focus-visible {
    outline: none;
    background-color: rgba(29, 185, 84, 0.12);
    border-color: #1db954;
    transform: scale(1.01);
}

.radio-row-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.circle-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.0rem;
}

.radio-row-card:focus .circle-indicator,
.radio-row-card:focus-within .circle-indicator {
    background-color: #1db954;
    color: #000;
}


.radio-row-card.playing .circle-indicator {
    background-color: #1db954;
    color: #fff;
}




/* --- Estilo Base do Botão de Favorito --- */
.fav-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    outline: none;
    
    /* Definimos um tamanho base menor para a estrela padrão */
    font-size: 1.1rem; 
    
    width: 30px;
    height: 30px;
    border-radius: 50%;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, font-size 0.15s ease;
}

/* --- ESTADO QUANDO ESTÁ FAVORITADA (Estrela Amarela Maior) --- */
.fav-btn.favorito {
    color: #f1c40f;         /* Cor dourada brilhante */
    font-size: 1.5rem;      /* Aumenta o tamanho da estrela consideravelmente */
}

/* --- ESTADO DE FOCO PARA A TV --- */
.fav-btn:focus {
    border-color: #ff9800 !important;
    background-color: rgba(255, 152, 0, 0.3) !important;
    transform: scale(1.25) !important;
    box-shadow: 0 0 14px #ff9800 !important;
    z-index: 10;
}

/* --- Player Inferior Consolidado --- */
.player-tv {
    grid-area: player;
    background: linear-gradient(180deg, rgba(20, 15, 10, 0.95) 0%, rgba(10, 7, 4, 0.98) 100%);
    border: 1px solid rgba(243, 156, 18, 0.4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    backdrop-filter: blur(10px);
    height: 100%;
}

/* Botão Play Único, Posicionado no Rodapé à Esquerda das Informações */
#playerToggleBtn {
    background-color: rgba(243, 156, 18, 0.15) !important;
    color: #ff9800;
    border: 2px solid #ff9800;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    min-width: 45px;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    flex-shrink: 0;
    transition: all 0.2s;
}

#playerToggleBtn:focus {
    background-color: rgba(29, 185, 84, 0.25) !important;
    border-color: #1db954 !important;
    color: #1db954 !important;
    box-shadow: 0 0 10px rgba(29, 185, 84, 0.6);
    transform: scale(1.05);
}

.player-info-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.player-badge {
    font-size: 7px;
    text-transform: uppercase;
    background: #e67e22;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    width: fit-content;
    font-weight: bold;
}

.player-details {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.player-details h3 {
    font-size: 0.85rem;
    color: #ffffff;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-details p {
    font-size: 0.75rem;
    color: #f39c12;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-status-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.status-dot {
    width: 5px;
    height: 5px;
    background-color: #f39c12;
    border-radius: 50%;
}

.player-status-text {
    font-size: 0.7rem;
    color: #e5e5e5;
    font-weight: 600;
    text-transform: uppercase;
}


/* --- Estados do Status do Player no Rodapé (Cores Dinâmicas) --- */
.player-status-text {
    font-weight: bold;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.3s ease;
}

/* Estado: Erro (Vermelho) */
.player-status-text.status-erro {
    color: #ff4d4d !important;
    text-shadow: 0 0 8px rgba(255, 77, 77, 0.4);
}

/* Estado: Pronto / No Ar (Verde) */
.player-status-text.status-no-ar,
.player-status-text.status-pronto {
    color: #2ecc71 !important;
    text-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

/* Estado: Carregando / Bufferização (Laranja) */
.player-status-text.status-carregando {
    color: #f39c12 !important;
    text-shadow: 0 0 8px rgba(243, 156, 18, 0.4);
}

/* Estado: Pausado (Branco) */
.player-status-text.status-pausado {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

