/* Variáveis e Reset */
:root {
    --primary-color: #4a6bff;
    --secondary-color: #6930c3;
    --accent-color: #80ffdb;
    --dark-color: #10101c;
    --darker-color: #0a0a14;
    --medium-dark: #1a1a30;
    --light-dark: #242440;
    --text-color: #e0e0ff;
    --text-light: #b4b4db;
    --text-muted: #8888a0;
    --glow-blue: rgba(74, 107, 255, 0.5);
    --glow-purple: rgba(105, 48, 195, 0.5);
    --glow-teal: rgba(128, 255, 219, 0.5);
    --gradient-primary: linear-gradient(135deg, #4a6bff, #6930c3);
    --gradient-secondary: linear-gradient(135deg, #6930c3, #80ffdb);
    --gradient-dark: linear-gradient(135deg, #05050d, #131320);
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    --glow-shadow: 0 0 20px rgba(128, 255, 219, 0.3);
    --transition: all 0.3s ease;
    --border-radius: 12px;
    --card-border-radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--dark-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(74, 107, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 60%, rgba(105, 48, 195, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 50% 90%, rgba(128, 255, 219, 0.1) 0%, transparent 20%);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* Cabeçalho */
header {

    background: var(--gradient-dark);
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(74, 107, 255, 0.2);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
}

header h1 {
    font-size: 2.2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    margin: 0;
}

/* Container Principal */
.container {
    width: 100%;
    max-width: 800px;
    margin: 30px auto;
    padding: 0 10px;
    padding: 70px 20px 70px; 
}

/* Player de Música */
.music-player {
    display: flex;
    background: var(--darker-color);
    border-radius: var(--card-border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    min-height: 500px;
    border: 1px solid rgba(74, 107, 255, 0.2);
}

/* Botão para expandir/ocultar lista */
.toggle-list {
    position: absolute;
    top: 50%;
    left: 300px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: var(--medium-dark);
    border: none;
    border-radius: 50%;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.toggle-list:hover {
    background: var(--primary-color);
}

/* Lista de Músicas */
.songs-list {
    width: 300px;
    background: var(--medium-dark);
    padding: 20px;
    transition: var(--transition);
    border-right: 1px solid rgba(74, 107, 255, 0.2);
    overflow-y: auto;
    max-height: 600px;
}

.songs-list h2 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
    color: var(--text-light);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.songs-list.hidden {
    width: 0;
    padding: 0;
    overflow: hidden;
}

.song-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: var(--light-dark);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid transparent;
}

.song-item:hover {
    background: var(--medium-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    border-color: rgba(74, 107, 255, 0.3);
}

.song-item.active {
    background: linear-gradient(135deg, rgba(74, 107, 255, 0.1), rgba(105, 48, 195, 0.1));
    border-left: 3px solid var(--primary-color);
    box-shadow: 0 0 15px var(--glow-blue);
}

.song-number {
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: var(--text-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    box-shadow: 0 0 10px var(--glow-blue);
}

.song-title {
    font-weight: 500;
    margin-bottom: 5px;
    margin-left: 20px;
}

.song-album {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 20px;
}

.song-artist {
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-left: 20px;
    margin-bottom: 3px;
}

/* Player */
.player {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.player.expanded {
    flex: 1;
}

/* Capa do Álbum */
.album-cover {
    width: 250px;
    height: 250px;
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.album-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}

/* Informações da Música */
.song-info {
    text-align: center;
    margin-bottom: 30px;
}

.song-info h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.song-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.song-info p#song-artist {
    color: var(--accent-color);
    font-size: 1rem;
    margin-bottom: 5px;
}

/* Controles do Player */
.player-controls {
    width: 100%;
    max-width: 400px;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.control-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--light-dark);
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
}

#play-button, #pause-button {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    box-shadow: 0 0 15px var(--glow-blue);
}

.control-button:hover {
    transform: scale(1.1);
    background: var(--primary-color);
}

/* Barra de Progresso */
.progress-container {
    margin-top: 20px;
}

.progress-bar {
    height: 6px;
    background: var(--medium-dark);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

#progress {
    width: 0;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    position: relative;
    transition: width 0.1s linear;
}

#progress::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--glow-teal);
}

.time {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Modo de Reprodução */
.playback-mode {
    margin-top: 20px;
    text-align: center;
}

.mode-button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.mode-button:hover {
    color: var(--primary-color);
}

.mode-button[data-mode="shuffle"] {
    color: var(--primary-color);
}

.mode-button[data-mode="single"] {
    color: var(--accent-color);
}

/* Rodapé */
footer {
    background-color: var(--darker-color);
    text-align: center;
    padding: 15px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 50px;
    border-top: 1px solid rgba(74, 107, 255, 0.2);
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 100;
}


/* Responsividade */
@media (max-width: 992px) {
    .music-player {
        flex-direction: column;
        min-height: auto;
    }
    
    .songs-list {
        width: 100%;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid rgba(74, 107, 255, 0.2);
    }
    
    .songs-list.hidden {
        max-height: 0;
        height: 0;
        padding: 0;
    }
    
    .toggle-list {
        left: 50%;
        top: 300px;
        transform: translateX(-50%);
        width: 30px;
        height: 30px;
    }
    
    .player {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .album-cover {
        width: 200px;
        height: 200px;
    }
    
    .song-info h3 {
        font-size: 1.3rem;
    }
    
    .controls {
        gap: 10px;
    }
    
    .control-button {
        width: 45px;
        height: 45px;
    }
    
    #play-button, #pause-button {
        width: 55px;
        height: 55px;
    }
}

@media (max-width: 480px) {
    .album-cover {
        width: 180px;
        height: 180px;
    }
    
    .control-button {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    #play-button, #pause-button {
        width: 50px;
        height: 50px;
    }
    
    .song-info h3 {
        font-size: 1.2rem;
    }
}

/* Animações */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}

.song-item.active .song-number {
    animation: pulse 1.5s infinite;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Estado quando não há músicas */
.no-songs {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    background: var(--light-dark);
    border-radius: var(--border-radius);
}

 /* Animação de piscar */
 @keyframes piscar {
    0% { background-color: #6a0dad; } 
    33% { background-color: #00008b; } 
    66% { background-color: #0000ff; } 
    100% { background-color: #6a0dad; } 
  }

  /* Estilo do botão */
  .botao-baixa {
    padding: 18px 80px;
    font-size: 20px;
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    animation: piscar 1.5s infinite;
    transition: transform 0.2s;
  }

  .botao-baixa:hover {
    transform: scale(1.1);
  }
  

/* Melhorias para telas pequenas (368px a 480px) */
@media (max-width: 480px) {
    /* Ajustes para a lista de músicas */
    .song-item {
        padding: 10px 12px;
        margin-bottom: 8px;
    }
    
    .song-title {
        font-size: 0.9rem;
        margin-left: 18px;
        word-break: break-word;
    }
    
    .song-artist, .song-album {
        font-size: 0.75rem;
        margin-left: 18px;
    }
    
    .song-number {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
        left: -5px;
    }
    
    /* Ajuste no container principal para dar mais espaço */
    .container {
        padding: 70px 15px 100px;
    }
    
    /* Espaçamento para o botão de download */
    .botao-baixa {
        margin-top: 30px;
        margin-bottom: 40px;
        padding: 15px 40px;
        font-size: 16px;
        display: block;
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    .songs-list.hidden + .player .toggle-list,
    .songs-list.hidden ~ .toggle-list {
        top: 15px;
        left: 50%;
        z-index: 20;
    }

    .toggle-list i.fa-chevron-right {
        transition: transform 0.3s ease;
    }

    .songs-list.hidden + .player .toggle-list i.fa-chevron-right,
    .songs-list.hidden ~ .toggle-list i.fa-chevron-right {
        transform: rotate(90deg);
    }
    
    .songs-list:not(.hidden) + .player .toggle-list i.fa-chevron-right,
    .songs-list:not(.hidden) ~ .toggle-list i.fa-chevron-right {
        transform: rotate(-90deg);
    }

}

/* Para telas muito pequenas */
@media (max-width: 368px) {
    .song-title {
        font-size: 0.85rem;
    }
    
    .song-artist, .song-album {
        font-size: 0.7rem;
    }
    
    .botao-baixa {
        width: 95%;
        padding: 12px 20px;
        font-size: 14px;
    }

    /* Ajuste mais específico para telas de 368px a 480px */
    .songs-list.hidden + .player .toggle-list,
    .songs-list.hidden ~ .toggle-list {
        top: 15px;
        left: 50%;
        z-index: 20;
    }
    
    /* Ajuste na rotação do ícone para indicar a direção corretamente */
    .toggle-list i.fa-chevron-right {
        transition: transform 0.3s ease;
    }
    
    .songs-list.hidden + .player .toggle-list i.fa-chevron-right,
    .songs-list.hidden ~ .toggle-list i.fa-chevron-right {
        transform: rotate(90deg); /* Aponta para baixo quando recolhido */
    }
    
    .songs-list:not(.hidden) + .player .toggle-list i.fa-chevron-right,
    .songs-list:not(.hidden) ~ .toggle-list i.fa-chevron-right {
        transform: rotate(-90deg);
    }

}

/* Adicionar estas regras ao seu arquivo CSS para ajustar a posição do botão toggle em telas pequenas */

@media (max-width: 992px) {
    /* Regras existentes para telas de tablets */
    .toggle-list {
        left: 50%;
        top: 300px;
        transform: translateX(-50%);
    }
    
    /* Quando a lista está oculta, ajustar a posição do botão para cima */
    .songs-list.hidden + .player .toggle-list,
    .songs-list.hidden ~ .toggle-list {
        top: 15px; /* Posiciona no topo */
        transform: translateX(-50%) rotate(180deg);
    }
}
