/* --- DEFINIÇÕES DE FONTES (MANTIDAS) --- */
@font-face {
    font-family: 'Nationale Regular';
    src: url('./fonts/Nationale-Regular.woff2') format('woff2'),
         url('./fonts/Nationale-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Nationale Bold';
    src: url('./fonts/Nationale-Bold.woff2') format('woff2'),
         url('./fonts/Nationale-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'Nationale Black';
    src: url('./fonts/Nationale-Black.woff2') format('woff2'),
         url('./fonts/Nationale-Black.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}



#music-player {
    font-family: 'Nationale Regular';
   position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    /* Valor astronômico para passar a sidebar */
    z-index: 9999 !important;
     display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0 300px;
    z-index: 2147483647 !important;
    color: white;
    
    /* O JS vai controlar a background-color agora */
    background-color: #121212; 
    transition: background-color 0.8s ease; 
    overflow: hidden;
}

.hidden {
    display: none !important;
}


/* Garante que o conteúdo fique acima do vidro */
.player-main-content, 
.progress-bar-bottom {
    position: relative;
    z-index: 5;
}

@media (max-width: 768px) {
    #music-player {
        bottom: 100px !important; /* Valor maior para ficar acima da barra de navegação */
        width: calc(100% - 30px) !important;
        margin: 0 15px !important;

        position: fixed !important;
    }
}

/* Dark Mode Adaptation */
@media (prefers-color-scheme: dark) {
    #music-player {
        --glass-bg: rgba(0, 0, 0, 0.4);
        --glass-shimmer: rgba(255, 255, 255, 0.05);
    }
}

body.fs-active #full-screen-player {
    opacity: 1; 
    /* ⭐️ POSIÇÃO FINAL: 0 significa no topo da tela */
    transform: translateY(0); 

}

/* Mini Player */
body.fs-active #music-player {
    opacity: 0; 
    transform: translateY(100%); 

}

/* Container para a primeira linha (Capa, Controles, Volume) */
.player-main-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    z-index: 9999 !important;
    height: 70px; /* Espaço para o conteúdo principal */
}

/* LADO ESQUERDO: Capa e Info */
.player-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    width: 25%;
    margin-top: 1%;
}
.player-left img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
}
.player-info {

    overflow: hidden;
    white-space: nowrap; /* Impede a quebra de linha do texto */
}

/* Garante que o texto rolável esteja no mesmo nível */
#player-title, #player-artist {
    display: block; /* Para garantir que o span ocupe a largura total */
}

.player-info {
    /* MANTENHA estas três regras CRUCIAIS: */
    max-width: 150px; /* <--- GARANTA ESTE VALOR FIXO OU AJUSTE */
    overflow: hidden;
    white-space: nowrap; 

    /* 🛑 REMOVIDO: O mask-image PADRÃO FOI REMOVIDO DAQUI */
    /* Ele será aplicado através da nova classe .fade-active */
}

/* NOVO: Classe que aplica o Efeito Fade SOMENTE quando o texto rola */
.player-info.fade-active {
    /* O gradiente que cria o efeito de fade nas laterais */
    -webkit-mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,      /* Início (Fade esquerdo) */
        rgba(0, 0, 0, 1) 10%,     /* Transição para visível */
        rgba(0, 0, 0, 1) 90%,     /* Transição para invisível */
        rgba(0, 0, 0, 0) 100%     /* Fim (Fade direito) */
    );
    mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 1) 10%,
        rgba(0, 0, 0, 1) 90%,
        rgba(0, 0, 0, 0) 100%
    );
}

/* 2. TEXTO e ANIMAÇÃO (mantido, mas com a correção de calc) */
#player-title, #player-artist {
    display: block; 
    white-space: nowrap;
}

/* ANIMAÇÃO: Ativa o scroll quando a classe 'scrolling' é adicionada pelo JS */
#player-title.scrolling,
#player-artist.scrolling {
    animation: text-scroll 8s linear infinite alternate; 
}

/* Define a animação de scroll (baseado no max-width de 150px) */
@keyframes text-scroll {
    0% { transform: translateX(0); }
    100% { 
        /* AJUSTE ESTE VALOR (150px) para ser IGUAL ao max-width do .player-info */
        transform: translateX(calc(-100% + 150px)); 
    }
}

.player-info span {
    font-family: 'Nationale Regular';
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}
.player-info #player-title {
    font-weight: bold;
    font-family: 'Nationale Bold';
    font-size: 1rem;
    color: white;
}
#player-artist {
    font-family: 'Nationale Regular';
    color: #b3b3b3;
    font-size: 0.8rem;
}

/* CENTRO: Controles */
.player-center {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1; /* Ocupa o espaço central restante */
}
.controls {
    display: flex;
    align-items: center;
    gap: 16px;
}
.controls button {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.85;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: background 0.2s, opacity 0.2s;
}
.controls button img {
    width: 28px;
    height: 28px;
    /* CORREÇÃO: Removido filter: invert(1); para ícones já brancos */
    filter: none;
}
.controls button:hover {
    background: rgba(255, 255, 255, 0.117);
    opacity: 1;
}

.play-btn {
    background: white;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    transition: transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.play-btn:hover {
    transform: scale(1.1);
}
.play-btn img {
    width: 40px;
    height: 40px;
    /* ICONE PRETO: O botão de play é branco, então o ícone deve ser preto para contraste */
    filter: none;
}

/* DIREITA: Volume e Fila */
.player-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 25%;
    margin-top: 1%;
    min-width: 150px;
    gap: 10px;
}
.player-right button {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.player-right button:hover {
    opacity: 1;
}
.player-right button img {
    width: 20px;
    height: 20px;
    /* CORREÇÃO: Removido filter: invert(1); para ícones já brancos */
    filter: none;
}
#volume-slider {
    width: 90px;
    accent-color: #ffffff;
}

.fs-volume-section {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 50; /* Garante que fique acima do fundo aurora */
}

.speaker {
    width: 30x;
    height: 0px;
}

.vlCtrl {
    width: 100%;
    max-width: 280px;
    height: 27px;
    cursor: pointer;
    touch-action: none; /* Desativa gestos padrão do navegador nesta área */
}

.volElem {
    fill: none;
    stroke-width: 6; /* Aumentado para facilitar o toque no mobile */
    stroke-linecap: round;
}

/* BARRA DE PROGRESSO (NOVA POSIÇÃO INFERIOR) */
.progress-bar-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 90%; /* Ocupa a maior parte da largura no PC */
    max-width: 900px;
    margin-bottom: 5px;
}
.progress-bar {
    flex: 1;
    height: 5px;
    background: #ffffff6d;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}
#progress-fill {
    width: 0%;
    height: 100%;
    background: #ffffff;
    transition: width 0.1s linear;
}
#current-time, #total-time {
    font-size: 12px;
    color: #ccc;
    white-space: nowrap;
}

/* IFRAME INVISÍVEL */
#yt-player {
    display: none;
}
/* * --------------------------------------------------------
 * --- MEDIA QUERY: ADAPTAÇÃO PARA MOBILE (MAX 768px) ---
 * --------------------------------------------------------
 */
@media (max-width: 768px) {
    #music-player {
        /* Ocupa a largura total com margens laterais de 15px */
       bottom: 100px !important; /* Valor maior para ficar acima da barra de navegação */
        width: calc(100% - 30px) !important;
        margin: 0 15px !important;
        z-index: 2147483647 !important;
        border-radius: 8px;
        position: fixed;
        transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
        /* CORREÇÃO: Remove o padding vertical para compactar */
        padding: 0 12px;
        height: auto; /* Deixa a altura ser definida pelo conteúdo */
    }

    /* ----------------------------------------------------------------- */
    /* CONTEÚDO PRINCIPAL (Capa, Título, Controles) */
    /* ----------------------------------------------------------------- */
    .player-main-content {
        /* CORREÇÃO: Remove altura fixa e usa padding para respiro. */
        height: auto;
        padding: 9px 0; /* Adiciona respiro vertical (topo e base) de 8px */

        /* O alinhamento central vertical (align-items: center) deve ser herdado
           do seu CSS base e garante que a capa e os botões fiquem alinhados. */
    }

    /* OCULTA VOLUME E SLIDER NO MOBILE */
    .player-right {
        /* O botão de Fila está no .player-right, então precisamos alinhá-lo */
        justify-content: flex-end; /* Garante que fique no canto direito */
        width: auto; /* Deixa a largura ser definida pelo conteúdo */
        min-width: 0;
        margin-top: 1%;
        gap: 0; /* Não há gap necessário se tiver apenas 1 botão visível */
        /* Ajuste a margem para criar o espaço entre o Play/Pause e o Fila */
        margin-left: 8px; 
    }
    .desktop-only-icon,
    .desktop-only-slider {
        display: none !important;
    }

    /* NOVO: OCULTA O BOTÃO 'PULAR ANTERIOR' */
    #prev-btn {
        display: none !important;
    }

    .player-left {
        /* Aumenta a largura para compensar a remoção do botão 'Previous' */
        width: 70%; /* Aumentado de 65% para dar mais espaço */
    }
    .player-left img {
        margin-bottom: 2%; /* Pode ser ajustado para 0 se o padding no .player-main-content for suficiente */
        width: 40px;
        height: 40px;
    }

    .player-info #player-title {
        margin-bottom: 2%; /* Pode ser ajustado para 0 */
        font-size: 0.85rem;
    }
    #player-artist {
        font-size: 0.7rem;
    }

    /* Player Centro (Controles de Skip e Play/Pause) */
    .player-center {
        /* Garante que o centro não ocupe espaço desnecessário */
        flex-grow: 0;
        /* Remove o padding-right para que os botões de controle fiquem na direita do player central */
        padding-right: 0; 
    }

    .controls {
        gap: 8px; /* Espaço entre os botões */
        /* Novo: Adicionado flex-grow para empurrar o botão de Fila no .player-right para o canto */
        flex-grow: 1;
        /* NOVO: Mova os botões para o final (Play/Pause e Skip Next) */
        justify-content: flex-end;
    }

    /* Botões Pequenos (Skip Next) - AUMENTADOS */
    .controls button {
        width: 36px; /* AUMENTADO */
        height: 36px; /* AUMENTADO */
    }
    .controls button img {
        width: 24px; /* AUMENTADO */
        height: 24px; /* AUMENTADO */
        filter: none;
    }

    /* Botão Play/Pause - AUMENTADO */
    .play-btn {
        width: 48px; /* AUMENTADO */
        height: 48px; /* AUMENTADO */
    }
    .play-btn img {
        width: 34px; /* AUMENTADO */
        height: 34px; /* AUMENTADO */
        /* ICONE PRETO: O botão de play é branco, então o ícone deve ser preto para contraste */
        filter: none;
    }
    .play-btn:hover {
        transform: scale(1.05);
    }

    /* ----------------------------------------------------------------- */
    /* BARRA DE PROGRESSO NO MOBILE */
    /* ----------------------------------------------------------------- */
    .progress-bar-bottom {
        width: 100%;
        max-width: none;
        height: 5px; /* Altura do container para a barra */
        margin-bottom: 0;

        /* CORREÇÃO: Puxa a barra para cima, colando no .player-main-content */
        margin-top: -3px;
    }

    #current-time, #total-time {
        display: none;
    }
    .progress-bar {
        height: 3px;
    }
}

/* --- DEFINIÇÕES DE FONTES (MANTIDAS) --- */
@font-face {
    font-family: 'Nationale Regular';
    src: url('./fonts/Nationale-Regular.woff2') format('woff2'),
         url('./fonts/Nationale-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Nationale Bold';
    src: url('./fonts/Nationale-Bold.woff2') format('woff2'),
         url('./fonts/Nationale-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'Nationale Black';
    src: url('./fonts/Nationale-Black.woff2') format('woff2'),
         url('./fonts/Nationale-Black.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}
/* --- DEFINIÇÕES DE FONTES (MANTIDAS) --- */
@font-face {
    font-family: 'Nationale Regular';
    src: url('./fonts/Nationale-Regular.woff2') format('woff2');
    font-weight: normal;
}
@font-face {
    font-family: 'Nationale Bold';
    src: url('./fonts/Nationale-Bold.woff2') format('woff2');
    font-weight: bold;
}
@font-face {
    font-family: 'Nationale Black';
    src: url('./fonts/Nationale-Black.woff2') format('woff2');
    font-weight: 900;
}

/* ============================================================
   PLAYER TELA CHEIA (FULL SCREEN) - DESIGN FINAL
   ============================================================ */

#full-screen-player {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background-color: #000; /* Fundo sólido para evitar transparência no slide */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 32px 40px 39px;
    transition: transform 0.6s cubic-bezier(0.32, 0.72, 0, 1);
    transform: translateY(100%); /* Escondido por padrão no mobile */
    overflow: hidden;
    touch-action: none;
    color: white;
    font-family: 'Nationale Regular', sans-serif;
    touch-action: pan-y; /* Habilita o gesto de fechar */
}

body.fs-active #full-screen-player {
    transform: translateY(0);
}

/* --- FUNDO AURORA E OVERLAY --- */
#fs-aurora-bg {
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at center, var(--artist-dominant-color, #333), #000);
    filter: blur(80px);
    z-index: 0;
    animation: rotateAurora 20s linear infinite;
}

@keyframes rotateAurora {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#fs-player-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
}

/* --- ELEMENTOS DE TOPO --- */
.fs-top-bar {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    z-index: 20;
}
.fs-grabber {
    width: 36px;
    height: 5px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

#fs-player-close-btn {
    display: none; /* Escondido no mobile, controlado via Media Query */
}

/* --- ÁREA DA CAPA E VÍDEO --- */
.fs-player-cover-container {
    width: 100%;
    max-width: 330px;
    aspect-ratio: 1;
    margin: 20px 0 40px 0;
    z-index: 10;
    position: relative;
        box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

#fs-player-cover, #youtube-embed-container {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;

}

/* --- TEXTOS E INFORMAÇÕES (ALINHADOS À ESQUERDA) --- */
.fs-main-content {
    width: 100%;
    max-width: 400px;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.fs-info-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.fs-text-group { text-align: left; max-width: 70%; }
#fs-player-title { font-size: 1.5rem; font-family: 'Nationale Bold'; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#fs-player-artist { font-size: 1.3rem; opacity: 0.6; margin: 2px 0 0 0; }

.fs-action-buttons { display: flex; gap: 12px; }
.fs-icon-btn { 
    background: rgba(255,255,255,0.1); border: none; 
    width: 36px; height: 36px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
}
.fs-icon-btn img { width: 20px; }

/* --- BARRA DE PROGRESSO --- */
.fs-progress-section { width: 100%; margin-bottom: 35px; }
#fs-player-bar-container { width: 100%; height: 4px; background: rgba(255,255,255,0.2); border-radius: 10px; margin-bottom: 12px; }
#fs-player-bar-fill { height: 100%; background: #fff; width: 0%; border-radius: 10px; opacity: 0.9; }
.fs-time-info { display: flex; justify-content: space-between; font-size: 0.75rem; color: rgba(255,255,255,0.5); font-weight: bold; }

/* --- CONTROLES (SEM CÍRCULO BRANCO - ÍCONES DIRETOS) --- */
.fs-controls-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 50px;
}

.fs-play-btn-transparent {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Ajuste dos ícones PNG */
.fs-play-btn-transparent img {
    width: 48px; /* Destaque maior para o Play central */
    height: auto;
}

.fs-skip { background: none; border: none; cursor: pointer; }
.fs-skip img { width: 38px; height: auto; }

/* --- BARRA DE VOLUME (EQUALIZADA) --- */
.fs-volume-section {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 60px;
    padding: 0 10px;
}

.vol-icon {
    height: 18px; /* Altura fixa igual para ambos os ícones */
    width: auto;
    opacity: 0.5;
}

.fs-vol-bar { flex: 1; height: 4px; background: rgba(255,255,255,0.2); border-radius: 10px; }
.fs-vol-fill { width: 50%; height: 100%; background: white; border-radius: 10px; }

/* --- FOOTER ACTIONS --- */
.fs-footer-actions { width: 100%; display: flex; justify-content: space-around; }
.fs-footer-btn { background: none; border: none; margin-top: 50px; }
.fs-footer-btn img { width: 24px; }

/* ============================================================
   MEDIA QUERIES - ADAPTAÇÃO PC (DESKTOP)
   ============================================================ */
@media (min-width: 1025px) {
    #full-screen-player {
        transform: translateY(0) !important;
        opacity: 0;
        pointer-events: none;
        flex-direction: row;
        justify-content: center;
        padding: 0 10%;
        gap: 100px;
    }

    body.fs-active #full-screen-player {
        opacity: 1;
        pointer-events: auto;
    }

    .fs-player-cover-container {
        flex: 0 0 400px; /* Tamanho fixo menor para não esmagar o texto */
        max-width: 400px;
        margin: 0;
        aspect-ratio: 1 / 1;
        display: flex; /* Garante que a imagem preencha o container */
        align-items: center;
        justify-content: center;
    }

    #fs-player-cover {
        width: 100%;
        height: 100%;
        border-radius: 20px; /* Bordas mais suaves no PC */
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.135); /* Sombra mais profunda no PC */
    }

    #fs-player-close-btn {
        display: flex !important;
        position: absolute;
        top: 40px;
        right: 40px;
        background: rgba(255,255,255,0.1);
        border: none;
        border-radius: 50%;
        padding: 12px;
        cursor: pointer;
        z-index: 100;
    }

    #fs-player-close-btn img { width: 20px; }
    .fs-top-bar { display: none; }
    .fs-player-cover-container { flex: 0 0 450px; max-width: 450px; margin: 0; }
    .fs-main-content { max-width: 500px; justify-content: center; }
    #fs-player-title { font-size: 3rem; white-space: normal; }
    #fs-player-artist { font-size: 1.8rem; }
}

.hidden { display: none !important; }