/* Estilos gerais para o player */
#audio-news-player {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    margin: 20px auto;
    border-radius: 8px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    max-width: 100%;
    box-sizing: border-box;
    min-width: 280px;
    gap: 10px;
    min-height: 48px;
}

/* Estilo para as NOVAS linhas do player (desktop) */
@media (min-width: 769px) { /* Garante regras de desktop */
    #audio-news-player {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }
    #audio-news-player .player-top-line {
        display: flex;
        flex-grow: 1;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
    }
    #audio-news-player .player-bottom-line {
        display: flex;
        flex-grow: 1;
        justify-content: flex-end;
        align-items: center;
        gap: 15px;
        flex-wrap: nowrap;
    }
    /* Select no desktop */
    #audio-news-player select {
        min-width: 120px;
        max-width: 180px;
    }
    /* Sliders no desktop */
    #audio-news-player input[type=range] {
        width: 100px;
    }
}

/* Estilo dos botões Play/Pause */
#audio-news-player button {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 70px; /* Será sobrescrito para mobile */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
#audio-news-player button:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
}
#audio-news-player button:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Estilo para o select de vozes */
#audio-news-player select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fcfcfc;
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%2069.9a15.4%2015.4%200%200%200-21.7%200L146.2%20188.7%2027.1%2069.9a15.4%2015.4%200%200%200-21.7%2021.7l129.5%20129.6c6%206%2015.4%206%2021.4%200L287%2091.6a15.4%2015.4%200%200%200%200-21.7z%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px auto;
    transition: border-color 0.3s;
    line-height: 1.2;
}
#audio-news-player select:hover,
#audio-news-player select:focus {
    border-color: #007bff;
    outline: none;
}

/* Estilo para os sliders de range */
#audio-news-player input[type=range] {
    -webkit-appearance: none;
    width: 80px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
    transition: opacity .2s;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    vertical-align: middle;
}
#audio-news-player input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
    margin-top: -5px;
}
#audio-news-player input[type=range]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

/* Estilo para as labels dos sliders */
#audio-news-player label {
    display: flex;
    align-items: center;
    font-weight: normal;
    color: #555;
    white-space: nowrap;
    font-size: 13px;
    margin: 0;
    flex-shrink: 0;
}
#audio-news-player label input[type=range] {
    margin-left: 5px;
}


/* Estilos para o player flutuante (floating player) */
.audio-news-floating {
    position: fixed;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    z-index: 9999;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.15);
    border: none !important;
    border-top: 1px solid #e0e0e0 !important;
    padding: 10px 20px !important;
    border-radius: 0 !important;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    flex-wrap: nowrap;
    min-height: 60px;
    gap: 5px;
}

/* Estilos para as linhas do player flutuante */
.audio-news-floating .player-top-line,
.audio-news-floating .player-bottom-line {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.audio-news-floating .player-top-line {
    /* Ajustes específicos para a linha superior do flutuante */
}
.audio-news-floating .player-bottom-line {
    padding-top: 5px;
    border-top: 1px solid #eee;
}

/* Expande botões no flutuante */
.audio-news-floating button {
    padding: 8px 20px;
    font-size: 15px;
    min-width: 90px;
    flex-grow: 1;
}
.audio-news-floating select {
    min-width: 150px;
    max-width: 220px;
    flex-grow: 1;
}
.audio-news-floating label {
    flex-grow: 1;
}


/* Media Queries para Responsividade */

/* Para telas menores (celulares) - ULTIMA TENTATIVA DE COMPACTAÇÃO MOBILE */
@media (max-width: 768px) {
    #audio-news-player { /* Player normal no conteúdo do post */
        flex-direction: column;
        align-items: stretch;
        padding: 6px 8px; /* Reduz padding geral do player */
        margin: 10px auto;
        border-radius: 6px;
        gap: 5px; /* Reduz gap entre as linhas */
        min-height: unset;
    }

    /* Linha 1 do player normal em mobile: Botões Play/Pause + Select de Vozes */
    #audio-news-player .player-top-line {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 6px; /* Reduz espaçamento entre botões e select */
    }
    #audio-news-player .player-top-line button {
        flex-grow: 1;
        min-width: 32%; /* DIMINUÍDO MAIS: Largura mínima dos botões para MAIS espaço */
        padding: 6px 8px;
        font-size: 12px;
    }
    #audio-news-player .player-top-line select {
        flex-grow: 1;
        min-width: 60px; /* Diminui MAIS o min-width do select */
        max-width: 100px; /* Diminui o max-width do select */
        font-size: 10px; /* Diminui a fonte do select */
        padding: 4px 6px; /* Diminui padding do select */
        background-position: right 4px center; /* Ajusta seta */
        background-size: 8px auto; /* Ajusta tamanho da seta */
        text-align-last: center;
        text-align: center;
    }

    /* Linha 2 do player normal em mobile: Velocidade + Volume */
    #audio-news-player .player-bottom-line {
        order: 2;
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-around;
        align-items: center;
        gap: 6px; /* Reduz espaçamento entre os dois labels */
        padding-top: 5px;
        border-top: 1px solid #eee;
    }
    #audio-news-player .player-bottom-line label {
        display: flex;
        align-items: center;
        font-size: 10px; /* Diminui fonte das labels */
        padding: 0;
        margin: 0;
        flex-grow: 1;
        flex-basis: calc(50% - 6px); /* Duas colunas para Velocidade/Volume */
        justify-content: center;
        white-space: nowrap;
    }
    #audio-news-player .player-bottom-line label input[type=range] {
        margin-left: 3px; /* Diminui margem do slider */
        width: 60%; /* Ajuste para ter mais espaço para texto */
        height: 2px;
    }
    #audio-news-player input[type=range]::-webkit-slider-thumb {
        width: 8px;
        height: 8px;
        margin-top: -3px;
    }
    #audio-news-player input[type=range]::-moz-range-thumb {
        width: 8px;
        height: 8px;
    }

    /* Player flutuante em mobile (ajustado para a nova estrutura) */
    .audio-news-floating {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 10px !important;
    }
    .audio-news-floating .player-top-line,
    .audio-news-floating .player-bottom-line {
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    .audio-news-floating .player-top-line button {
        flex-grow: 1;
        min-width: 38%; /* DIMINUÍDO AQUI: Largura mínima para flutuante mobile */
        padding: 8px 15px;
        font-size: 14px;
    }
    .audio-news-floating .player-top-line select {
        flex-grow: 1;
        min-width: 80px;
        max-width: 150px;
        font-size: 13px;
    }
    .audio-news-floating .player-bottom-line label {
        flex-basis: calc(50% - 8px);
    }
}

/* Para telas muito pequenas (ex: alguns celulares antigos, modo paisagem) */
@media (max-width: 480px) {
    #audio-news-player {
        padding: 5px 6px;
        margin: 6px auto;
        gap: 4px;
    }
    #audio-news-player .player-top-line button {
        padding: 4px 5px;
        font-size: 11px;
        min-width: 30%; /* Ultra compacto */
    }
    #audio-news-player .player-top-line select {
        font-size: 9px;
        min-width: 50px;
        max-width: 80px;
    }
    #audio-news-player .player-bottom-line label {
        font-size: 9px;
    }
    #audio-news-player .player-bottom-line label input[type=range] {
        width: 50%;
    }
    #audio-news-player input[type=range]::-webkit-slider-thumb,
    #audio-news-player input[type=range]::-moz-range-thumb {
        width: 7px;
        height: 7px;
        margin-top: -2.5px;
    }
    .audio-news-floating button {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 35%; /* Ultra compacto */
    }
    /* No flutuante em telas muito pequenas, as labels e select podem ir para linhas separadas */
    .audio-news-floating .player-bottom-line label {
        flex-basis: 100%;
    }
    .audio-news-floating .player-top-line select {
        flex-basis: 100%;
    }
}