/* =================================================================== */
/* === ARQUIVO CSS FINAL (COM LAYOUT "NOW PLAYING" E CORES DINÂMICAS) === */
/* =================================================================== */

/* --- FUNDO DINÂMICO --- */
.dynamic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Fica atrás de tudo */
    transition: background 1.5s ease-in-out;
}

/* --- CONFIGURAÇÕES GERAIS --- */
body {
    overflow: hidden;
    background-color: #000;
}

.app {
    position: relative;
    z-index: 1; /* Garante que o app fique sobre o fundo dinâmico */
    background-color: transparent;
}

/* --- TELA PRINCIPAL E CARD DE REPRODUÇÃO --- */
#main-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.now-playing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    width: 100%;
    height: 100%;
}

.album-art {
    width: 40vh;
    height: 40vh;
    max-width: 400px;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6);
    opacity: 0; /* Começa invisível para a animação */
}

.song-info {
    margin-top: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.song-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem); /* Fonte responsiva */
    font-weight: 700;
    margin: 0;
}

.artist-name {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 400;
    opacity: 0.8;
    margin-top: 0.75rem;
}

/* Animação de entrada para a capa */
@keyframes fadeInScaleUp {
    from {
    opacity: 0;
    transform: scale(0.95);
    }
    to {
    opacity: 1;
    transform: scale(1);
    }
}

.new-song-art {
    animation: fadeInScaleUp 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* --- HEADER E TICKER (ESTILO VIDRO NEUTRO) --- */
.header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 10;
}

#info-ticker {
    position: fixed;
    bottom: 0;
    width: 100%;
    left: 0;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    height: 60px;
    color: #fff;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* --- ELEMENTOS DA INTERFACE (BOTÕES, MENUS, ETC.) --- */
.header-wrapper { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 1rem 1.5rem; }
.header-left-group { display: flex; align-items: center; gap: 1.5rem; }
.header-logo { flex-shrink: 0; }
.header-player-controls { display: flex; align-items: center; gap: 0.5rem; }

.player-button, .btn {
    color: #fff;
    transition: all 0.3s;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    cursor: pointer;
}

.player-button:hover, .btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.player-button {
    border-radius: 50%;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-player-controls .player-button-play { padding: 0.65rem; width: 55px; height: 55px; }
.header-player-controls .player-button-play svg { width: 26px; height: 26px; }
.header-player-controls .player-button-backward-step, .header-player-controls .player-button-forward-step { width: 45px; height: 45px; }
.header-player-controls .player-button-backward-step svg, .header-player-controls .player-button-forward-step svg { width: 22px; height: 22px; }

.header-right-group { display: flex; align-items: center; gap: 0.75rem; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}


.header-tv-controls .btn-tv { display: none; }
.header-tv-controls .btn-tv.is-active { display: inline-flex; }

.mobile-menu-toggle { display: none; }


/* --- TICKER SCROLL --- */
.ticker-content, .ticker-static-area { font-size: 1.5rem; font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.ticker-scroll-area { flex-grow: 1; overflow: hidden; height: 100%; }
.ticker-wrap { display: flex; height: 100%; align-items: center; animation: scroll-left var(--scroll-duration, 40s) linear infinite; }
.ticker-content { flex-shrink: 0; padding: 0 2rem; }
.ticker-static-area { flex-shrink: 0; height: 100%; display: flex; align-items: center; padding: 0 2rem; background-color: rgba(0, 0, 0, 0.2); }
@keyframes scroll-left { from { transform: translateX(0); } to { transform: translateX(var(--scroll-distance)); } }


/* --- PAINÉIS LATERAIS (OFFCANVAS) --- */
.offcanvas {
    inset: 0 auto 0 0;
    z-index: 999;
    transition: transform 0.4s, opacity 0.4s;
    background-color: rgba(25, 25, 25, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.offcanvas:not(.is-active) { transform: translateX(-110%); opacity: 0; pointer-events: none; }
.offcanvas [data-close] { position: absolute; top: 15px; right: 15px; z-index: 1000; }
.offcanvas .offcanvas-content { padding-top: 70px; }


/* --- MENU MOBILE --- */
#mobile-menu-content { display: flex; flex-direction: column; gap: 1.5rem; }
#mobile-tv-controls .btn-tv { width: 100%; justify-content: center !important; }
#mobile-menu-content .header-player-controls { display: flex; flex-direction: row; justify-content: space-around; width: 100%; background-color: rgba(255, 255, 255, 0.1); padding: 0.5rem; border-radius: 50px; }
#mobile-menu-content .toggle-options { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; }
#mobile-menu-content .toggle-options .btn { width: 100%; justify-content: center; font-size: 1rem !important; }

/*
* ==================================================
* === REGRAS RESPONSIVAS FINAIS E INTELIGENTES =====
* ==================================================
*/
@media (max-width: 1024px) {
    .header-player-controls,
    .header-right-group {
    display: none;
    }

    .mobile-menu-toggle {
    display: none; /* ALTERADO: Oculta o botão sanduíche */
    }

    /* ADICIONADO: Oculta os controles de player dentro do menu mobile */
    #mobile-menu-content .header-player-controls {
    display: none;
    }

    .header-left-group {
    flex-grow: 1;
    }

    .ticker-static-area {
    display: none;
    }

    .ticker-scroll-area {
    width: 100%;
    }

    #mobile-menu-content .toggle-options .btn {
    width: 100%;
    justify-content: center;
    padding: 0.8rem 1.2rem;
    font-size: 1rem !important;
    }

    /* Ajusta o tamanho da capa e texto em telas menores */
    .album-art { width: 55vw; height: 55vw; }
    .song-info { margin-top: 1.5rem; }
}


/* ========================================================== */
/* ========= MODO DE ESTAÇÃO ÚNICA (SINGLE STATION) ========= */
/* ========================================================== */
.single-station-mode .player-button-play, 
.single-station-mode .player-button-backward-step,
.single-station-mode .player-button-forward-step,
.single-station-mode [data-outside="offcanvas-stations"],
.single-station-mode [data-outside="offcanvas-history"],
.single-station-mode [data-outside="offcanvas-program"] {
    display: none !important;
}

.single-station-mode .header-player-controls {
    gap: 0;
}

/* --- OCULTA OS BOTÕES DE PROGRAMAÇÃO, RÁDIOS E HISTÓRICO --- 
[data-outside="offcanvas-program"],
[data-outside="offcanvas-stations"],
[data-outside="offcanvas-history"] {
    display: none !important;
}
*/

/* --- ESTILOS PARA O MODAL DE INSTALAÇÃO PWA (VERSÃO GLASS) --- */

#install-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#install-modal.modal-hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);

    color: #fff;
    padding: 2rem;
    border-radius: 16px;
    text-align: center; /* Centraliza todo o conteúdo do modal */
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: scale(1);
    transition: transform 0.3s ease;
}

#install-modal.modal-hidden .modal-content {
    transform: scale(0.9);
}

.modal-icon {
    display: block; /* Garante que o ícone seja um bloco para margin auto */
    margin: 0 auto 1.5rem auto; /* Centraliza horizontalmente e adiciona mais espaço abaixo */
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.modal-content h3 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.modal-content p {
    margin: 0 0 1.5rem 0;
    opacity: 0.9;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-buttons button {
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

/* Nova cor para o botão Instalar: um azul moderno e suave */
.btn-install {
    background-color: #007bff; /* Azul padrão do Bootstrap, mas que se encaixa */
    color: #fff;
    border: 1px solid transparent;
}

.btn-install:hover {
    background-color: #0056b3; /* Um tom mais escuro no hover */
    transform: scale(1.03);
}

/* Botão secundário "Agora não" */
.btn-later {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-later:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#connection-status {
    display: none; /* Escondido por padrão */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffc107; /* Amarelo/Laranja de alerta */
    color: #333;
    text-align: center;
    padding: 10px;
    font-family: sans-serif;
    font-size: 14px;
    z-index: 9999;
    transition: opacity 0.3s;
}

#connection-status.visible {
    display: block;
}

#connection-status.error {
    background-color: #dc3545; /* Vermelho para erro final */
    color: white;
}
/* --- EFEITO DE ZOOM EM LOOP NO FUNDO (ATRÁS DA CAPA) --- */
#main-display::before{
    content:"";
    position:absolute;
    inset:0;
    background-image: var(--player-cover-bg);
    background-size: cover;
    background-position: center;
    transform: scale(1.08);
    filter: blur(24px);
    opacity: .55;
    animation: playerZoomLoop 10s ease-in-out infinite alternate;
    z-index: 0;
}

/* Garante que todo o conteúdo fique acima do fundo */
#main-display > *{
    position: relative;
    z-index: 1;
}

@keyframes playerZoomLoop{
    from { transform: scale(1.08); }
    to   { transform: scale(1.22); }
}
