/* assets/css/style.css */
body { font-family: Arial, sans-serif; margin: 0; padding: 0; background-color: #0d1a2f; color: #f1f1f1; overflow-x: hidden; }
.container { max-width: 1600px; margin: 0 auto; padding: 0 20px; }
header { position: sticky; top: 0; z-index: 1000; background-color: #1a2a44; }
.header-container { display: flex; justify-content: space-between; align-items: center; padding: 5px 20px; border-bottom: 2px solid #334d70; gap: 20px; min-height: 100px; }
.logo { height: 90px; display: flex; align-items: center; justify-content: center; }
.logo img { max-height: 90px; width: auto; max-width: 100%; }
main { padding: 20px 0; }
.main-content { display: grid; grid-template-columns: 300px 1fr 320px; gap: 20px; max-width: 100%; }
.center-column, .info-sidebar, .rss-sidebar { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.player-container { width: 100%; background-color: #1a2a44; padding: 20px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,.2); box-sizing: border-box; }
.responsive-video-wrapper { position: relative; overflow: hidden; width: 100%; padding-top: 56.25%; background-color: #000; }
.responsive-video-wrapper > iframe, .responsive-video-wrapper > div { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.header-player { display: flex; align-items: center; gap: 10px; background-color: #0d1a2f; padding: 5px 10px; border-radius: 5px; min-width: 0; flex-grow: 1; }
.header-player img { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.header-player button { background: 0 0; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 0 8px; flex-shrink: 0; }
.header-player .music-info { min-width: 0; flex-grow: 1; }
.header-player .music-info h3, .header-player .music-info p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-player .music-info h3 { font-size: .9em; }
.header-player .music-info p { font-size: .75em; color: #ccc; }
.header-banner { max-width: 728px; width: 100%; height: 90px; background-color: #0d1a2f; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.header-banner img { max-width: 100%; max-height: 100%; }
.info-sidebar .info-card, .rss-sidebar .info-card { background-color: #1a2a44; padding: 15px; border-radius: 8px; }
.info-sidebar h3, .rss-sidebar h3 { margin-top: 0; border-bottom: 1px solid #334d70; padding-bottom: 10px; }
.rss-list { list-style: none; padding: 0; margin: 0; }
.rss-item { border-bottom: 1px solid #334d70; padding: 12px 5px; }
.rss-item:last-child { border-bottom: 0; }
.rss-item a { text-decoration: none; color: #f1f1f1; display: flex; align-items: center; gap: 12px; }
.rss-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; flex-shrink: 0; background-color: #334d70; }
.rss-item .title { font-size: .9em; line-height: 1.3; }
.rss-item a:hover .title { color: #4CAF50; }
#no-ar-agora-content, #proximo-programa-content { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
#programa-agora, #proximo-programa-texto { margin: 0 0 10px; font-weight: 700; font-size: 1.1em; }
#no-ar-agora-foto, #proximo-programa-foto { width: 100%; height: auto; object-fit: cover; border-radius: 5px; background-color: #000; flex-shrink: 0; }
.programacao { margin-top: 20px; background-color: #1a2a44; padding: 20px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,.2); }
.dias-semana { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.dia-btn { padding: 12px 20px; border: 0; border-radius: 5px; cursor: pointer; background-color: #334d70; color: #fff; font-weight: 700; font-size: 1em; }
.dia-btn.active, .dia-btn:hover { background-color: #4CAF50; }
#programacao-detalhes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.programa-card { position: relative; border-radius: 5px; overflow: hidden; cursor: pointer; aspect-ratio: 1/1; background-color: #000; }
.programa-card-img { width: 100%; height: 100%; object-fit: cover; }
.programa-card-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,.9), transparent); padding: 10px; color: #fff; }
.programa-card-titulo { font-weight: 700; margin: 0 0 5px; font-size: .9em; }
.programa-card-horario { font-size: .8em; margin: 0; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.8); display: none; justify-content: center; align-items: center; z-index: 1001; pointer-events: none; }
.modal-overlay.active { display: flex; pointer-events: auto; }
.modal-content { background: #1a2a44; padding: 30px; border-radius: 8px; max-width: 600px; width: 90%; position: relative; border: 1px solid #334d70; max-height: 85vh; overflow-y: auto; }
.modal-close { position: absolute; top: 10px; right: 15px; color: #fff; font-size: 28px; font-weight: 700; cursor: pointer; }
footer { text-align: center; padding: 20px; background-color: #1a2a44; margin-top: 40px; }
.swiper-container { width: 100%; height: 100%; }
.swiper-slide { display: flex; justify-content: center; align-items: center; background: #000; }
.swiper-slide img { max-width: 100%; max-height: 100%; }
.chart-container { width: 100%; margin-bottom: 20px; background-color: #1a2a44; border-radius: 8px; padding: 20px; box-shadow: 0 4px 8px rgba(0,0,0,.2); box-sizing: border-box; }
.chart-list { list-style: none; padding: 0; margin: 0; }
.chart-item { display: flex; align-items: center; padding: 10px; border-bottom: 1px solid #334d70; transition: background-color .3s; }
.chart-item:last-child { border-bottom: none; }
.chart-rank { font-size: 1.2em; font-weight: 700; color: #4CAF50; width: 40px; flex-shrink: 0; text-align: center; }
.chart-cover { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; margin-right: 15px; flex-shrink: 0; background-color: #0d1a2f; }
.chart-info { flex-grow: 1; min-width: 0; }
.chart-title { font-weight: 700; font-size: 1em; margin: 0 0 5px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-artist { font-size: 0.8em; color: #ccc; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-stats { display: flex; align-items: center; margin-left: 15px; flex-shrink: 0; gap: 10px; }
.chart-plays { font-size: .9em; font-weight: 700; padding: 5px 8px; background-color: #0d1a2f; border-radius: 15px; }
.vote-section-wrapper { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.like-dislike-section { display: flex; align-items: center; gap: 5px; }
.like-btn, .dislike-btn { background-color: transparent; border: none; cursor: pointer; font-size: 1.2em; padding: 5px; transition: transform 0.2s, opacity 0.2s; line-height: 1; }
.like-btn:hover, .dislike-btn:hover { transform: scale(1.1); }
.like-btn:disabled, .dislike-btn:disabled { cursor: not-allowed; opacity: 0.5; }
.like-btn-voted { color: #4CAF50; } 
.dislike-btn-voted { color: #f44336; }
.vote-section { display: flex; align-items: center; gap: 8px; }
.vote-btn { background-color: #334d70; color: #fff; border: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-weight: 700; transition: background-color .2s; font-size: 0.8em; }
.vote-btn:hover { background-color: #4CAF50; }
.vote-btn:disabled { background-color: #2a3a54; color: #666; cursor: not-allowed; }
.vote-count { font-weight: 700; min-width: 50px; text-align: center; font-size: 0.8em; }
.chart-item:nth-child(1) { background-color: #1d324c; } .chart-item:nth-child(2) { background-color: #1f3550; } .chart-item:nth-child(3) { background-color: #223854; } .chart-item:nth-child(4) { background-color: #243b58; } .chart-item:nth-child(5) { background-color: #273e5c; } .chart-item:nth-child(6) { background-color: #294160; } .chart-item:nth-child(7) { background-color: #2c4464; } .chart-item:nth-child(8) { background-color: #2e4768; } .chart-item:nth-child(9) { background-color: #314a6c; } .chart-item:nth-child(10) { background-color: #334d70; }
.chart-item:hover { background-color: rgba(76,175,80,0.4); }

/* --- MENU MOBILE E OUTROS ELEMENTOS --- */
.main-menu { display: block; position: fixed; top: 0; right: 0; width: 250px; height: 100vh; background-color: #1a2a44; padding-top: 80px; transform: translateX(100%); transition: transform 0.3s ease-in-out; z-index: 1050; }
.main-menu.active { transform: translateX(0); }
.main-menu ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; align-items: center; width: 100%; }
.main-menu li { margin: 15px 0; width: 100%; text-align: center; }
.main-menu a { text-decoration: none; color: #f1f1f1; font-weight: 700; font-size: 1.2em; }
.mobile-menu-toggle { display: block; width: 30px; height: 25px; position: relative; cursor: pointer; border: none; background: transparent; z-index: 1100; }
.mobile-menu-toggle span { display: block; position: absolute; height: 3px; width: 100%; background: #f1f1f1; border-radius: 3px; left: 0; transition: all .25s ease-in-out; }
.mobile-menu-toggle span:nth-child(1) { top: 0px; } .mobile-menu-toggle span:nth-child(2) { top: 10px; } .mobile-menu-toggle span:nth-child(3) { top: 20px; }
.mobile-menu-toggle.active span:nth-child(1) { top: 10px; transform: rotate(135deg); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; left: -30px; }
.mobile-menu-toggle.active span:nth-child(3) { top: 10px; transform: rotate(-135deg); }

.history-list { padding: 0; margin: 0; list-style: none; }
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #334d70; font-size: 0.9em; }
.history-item:last-child { border-bottom: none; }
.history-time { font-weight: bold; color: #4CAF50; flex-shrink: 0; margin-right: 10px; }
.history-song { text-align: right; min-width: 0; }
.history-song .title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: bold; }
.history-song .artist { display: block; font-size: 0.9em; color: #ccc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-last-played { font-size: 0.8em; color: #a0a0a0; margin: 4px 0 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Formulário On-Demand */
.ondemand-card input[type="text"], .ondemand-card select { width: 100%; box-sizing: border-box; padding: 10px; margin-bottom: 15px; border-radius: 4px; border: 1px solid #334d70; background-color: #0d1a2f; color: #f1f1f1; font-size: 1em; }
.ondemand-card input[type="text"]:focus { outline: none; border-color: #4CAF50; }
#ondemand-submit-btn { width: 100%; padding: 12px; border: none; border-radius: 4px; background-color: #4CAF50; color: white; font-weight: bold; font-size: 1em; cursor: pointer; margin-top: 15px; transition: background-color 0.2s; }
#ondemand-submit-btn:hover { background-color: #45a049; }
#ondemand-submit-btn:disabled { background-color: #2a3a54; cursor: not-allowed; }
#suggestion-box { position: absolute; width: 100%; max-height: 200px; overflow-y: auto; background-color: #1a2a44; border: 1px solid #4CAF50; z-index: 100; border-top: none; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); display: none; box-sizing: border-box; }
.suggestion-item { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid #334d70; font-size: 0.9em; color: #f1f1f1; }
.suggestion-item:hover { background-color: #0d1a2f; color: #4CAF50; }

@media (max-width:1280px) { .header-banner { display: none; } }
@media (max-width:1024px) { .header-container { flex-wrap: nowrap; } .main-content { grid-template-columns: 1fr; } .rss-sidebar { order: 2; } .center-column { order: 1; } .info-sidebar { order: 3; } }
@media (max-width: 768px) {
    .container { padding: 0 5px; }
    .header-container { min-height: 0; padding: 5px 10px; gap: 10px; flex-wrap: nowrap; }
    .logo { height: 50px; flex-shrink: 0; margin-right: auto; }
    .logo img { max-height: 50px; }
    .header-player { flex-grow: 1; width: auto; margin-top: 0; min-width: 0; max-width: 150px; }
    .menu { display: none; }
    .mobile-menu-toggle { display: block; }
    
    /* ==========================================
       TOP 10 NO CELULAR (BLINDADO COM CSS GRID)
       ========================================== */
    .chart-item {
        display: grid !important;
        /* Cria 3 colunas fixas: Posição(40px) | Capa(50px) | Textos(o que sobrar) */
        grid-template-columns: 40px 50px 1fr; 
        column-gap: 15px; /* Espaço entre a foto e o texto */
        row-gap: 8px; /* Espaço entre o texto e os botões de like */
        padding: 15px 10px !important;
    }
    
    /* Prende o número na coluna 1 e centraliza com a foto */
    .chart-rank { 
        grid-column: 1; 
        grid-row: 1; 
        align-self: center; 
        margin: 0; 
    }
    
    /* Prende a foto na coluna 2 e centraliza com o número */
    .chart-cover { 
        grid-column: 2; 
        grid-row: 1; 
        align-self: center; 
        margin: 0 !important; 
    }
    
    /* Prende os Textos na coluna 3, linha 1 */
    .chart-info { 
        grid-column: 3; 
        grid-row: 1; 
    }
    
    .chart-title, .chart-artist {
        white-space: normal !important; /* Deixa o texto quebrar de linha à vontade */
        line-height: 1.3;
    }
    
    /* Prende os Likes na coluna 3, linha 2 (Fica exatamente embaixo do texto!) */
    .chart-stats {
        grid-column: 3; 
        grid-row: 2;
        margin: 0 !important;
        width: 100%;
        justify-content: flex-start;
    }
}

/* Correção do visual da lista suspensa do On-Demand */
.suggestion-item strong {
    display: block; /* Força o título a ocupar a linha inteira */
    margin-bottom: 3px;
    font-size: 1.05em;
    color: #ffffff;
}

.suggestion-item span {
    display: block; /* Força o artista a ir para a linha de baixo */
    font-size: 0.85em;
    color: #9bb1c1; /* Cor azulada/acinzentada igual ao do painel antigo */
}

/* Efeito visual ao passar o mouse (Hover) na lista On-Demand */
.suggestion-item:hover {
    background-color: #12223a; /* Muda levemente o fundo da linha inteira */
}

.suggestion-item:hover strong {
    color: #4CAF50; /* Apenas o título da música fica verde */
}

.suggestion-item:hover span {
    color: #b0bec5; /* O artista fica levemente mais claro para dar contraste */
}

/* ==========================================
   MENU MOBILE FIXO E SOBREPOSTO A TUDO
   ========================================== */
@media (max-width: 800px) {
    .main-menu.active {
        display: flex !important;
        flex-direction: column;
        position: fixed !important; /* <-- MÁGICA AQUI: O menu fica colado ao ecrã, ignorando o vídeo */
        top: 80px; /* Altura aproximada do cabeçalho, ajuste se necessário */
        left: 0;
        width: 100vw;
        height: calc(100vh - 80px); /* Preenche o resto do ecrã para baixo */
        background-color: #1a1a1a;
        z-index: 2147483647 !important; /* O valor MÁXIMO absoluto permitido pelos navegadores */
        overflow-y: auto;
        padding-top: 20px;
    }
    
    .main-menu.active ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 0;
        margin: 0;
        gap: 10px;
    }
    
    .main-menu.active ul li {
        width: 100%;
    }
    
    .main-menu.active ul li a {
        display: block;
        padding: 15px 20px;
        font-size: 1.3em;
        color: #fff;
        text-align: center;
        text-decoration: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .main-menu.active ul li a:hover {
        background-color: #333;
        color: #4CAF50;
    }
}
                                           
                                           /* ==========================================
   BOTÃO REAL DE UNMUTE (MISTSERVER)
   ========================================== */
.alerta-unmute {
    position: absolute;
    top: 15px; 
    right: 15px; 
    background-color: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 0.9em;
    font-weight: bold;
    z-index: 50; 
    cursor: pointer; /* Agora é um botão de verdade que pode ser clicado */
    border: none;
    animation: pulsar-botao 2s infinite;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: background-color 0.3s;
}

.alerta-unmute:hover {
    background-color: rgba(200, 40, 50, 1);
}

@keyframes pulsar-botao {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}
                                           
                                           /* ==========================================
   COLUNAS LATERAIS INDEPENDENTES (ESTILO WEB APP)
   Apenas para PC (Telas maiores que 1024px)
   ========================================== */
@media (min-width: 1025px) {
    .rss-sidebar, .info-sidebar {
        position: sticky;
        top: 110px; /* Distância exata abaixo do cabeçalho */
        max-height: calc(100vh - 130px); /* Trava a altura para criar a rolagem interna */
        overflow-y: auto; /* Cria a rolagem independente nas laterais */
        overflow-x: hidden;
        padding-right: 5px; /* Espacinho para o texto não encostar na barra */
        overscroll-behavior: contain; /* Impede que a página principal role sem querer ao chegar no final da barra */
    }

    /* Estilizando a barrinha de rolagem das laterais para ficar fina e elegante */
    .rss-sidebar::-webkit-scrollbar, .info-sidebar::-webkit-scrollbar {
        width: 6px;
    }
    .rss-sidebar::-webkit-scrollbar-track, .info-sidebar::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.15);
        border-radius: 4px;
    }
    .rss-sidebar::-webkit-scrollbar-thumb, .info-sidebar::-webkit-scrollbar-thumb {
        background: #334d70; 
        border-radius: 4px;
    }
    .rss-sidebar::-webkit-scrollbar-thumb:hover, .info-sidebar::-webkit-scrollbar-thumb:hover {
        background: #32BCAD; 
    }
}
                                           
/* ==========================================
   MINI PLAYER FLUTUANTE (FALSO PiP) - O DEFINITIVO
   ========================================== */
.video-flutuante {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 320px !important;
    height: 180px !important;
    padding-top: 0 !important;
    z-index: 99999 !important;
    border: 3px solid #38bdf8;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
    background-color: #000 !important;
    overflow: hidden !important;
}

/* Força apenas a casca do MistServer a preencher o PiP, e deixa ele cuidar do resto */
.video-flutuante .mistvideo {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

@media (max-width: 768px) {
    .video-flutuante {
        bottom: 20px !important;
        right: 10px !important;
        width: 240px !important;
        height: 135px !important;
    }
}
                                           
              
/* ==========================================
   TRAVA DE CONTEÚDO (NOTÍCIAS E PÁGINAS)
   Impede que imagens e vídeos gigantes quebrem o site
   ========================================== */
#app-content img, 

#app-content video,
#app-content figure.image img {
    max-width: 100% !important; /* A trava mágica: nunca ultrapassar a tela */
    height: auto !important; /* Mantém a proporção original para não achatar */
    border-radius: 6px; /* Bordinha arredondada para ficar elegante */
    display: block;
}

/* O CKEditor gosta de colocar as imagens dentro de uma tag <figure>,
   então precisamos travar ela também para garantir */
#app-content figure.image {
    max-width: 100% !important;
    margin: 20px auto !important;
}

/* Regra nova e liberada para o Clima */
#iframe-previsao {
    max-width: 100% !important;
    height: 1600px; /* Altura inicial, o JS vai mudar isto depois */
    border: none;
    display: block;
}
/* REMOVE QUALQUER CHAVE } EXTRA QUE ESTEJA SOZINHA NO FIM DO ARQUIVO */

/* --- ALÇA DO PLAYER PIP (VERSÃO EXORCIZADA) --- */
.alca-drag-pip { display: none; }

/* Mudamos para .video-flutuante para bater com seu sistema */
.video-flutuante .alca-drag-pip {
    display: flex; justify-content: center; align-items: center;
    width: 100%; height: 35px; position: absolute; top: 0; left: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    cursor: grab; z-index: 999999; touch-action: none; 
}
.video-flutuante .alca-drag-pip:active { cursor: grabbing; }
.alca-drag-pip::before {
    content: ''; width: 40px; height: 5px;
    background: rgba(255, 255, 255, 0.6); border-radius: 3px; margin-top: -10px;
}