@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-blue: #2563eb;
    --primary-blue-hover: #3b82f6;
    --primary-glow: rgba(37, 99, 235, 0.3);
    
    --spotify-black: #080d16;
    --spotify-dark: #0f172a;
    --spotify-card: #1e293b;
    --spotify-card-hover: #334155;
    --spotify-grey: #1e293b;
    --spotify-text-muted: #94a3b8;
    --spotify-white: #f8fafc;
    
    --border-color: rgba(255, 255, 255, 0.06);
    --transition-smooth: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.light-theme {
    --spotify-black: #f1f5f9;
    --spotify-dark: #ffffff;
    --spotify-card: #e2e8f0;
    --spotify-card-hover: #cbd5e1;
    --spotify-grey: #e2e8f0;
    --spotify-text-muted: #64748b;
    --spotify-white: #0f172a;
    --border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .sidebar-panel {
    border: 1px solid var(--border-color);
}

body.light-theme .theme-toggle-btn {
    background-color: rgba(0, 0, 0, 0.06);
    color: #0f172a;
}

body.light-theme .theme-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .folder-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .sidebar-footer {
    border-top: 1px solid var(--border-color);
}

body.light-theme .sidebar-footer .user-menu {
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

body.light-theme .sidebar-footer .user-menu:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .user-dropdown button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .music-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.08); /* Aumentado contraste no hover da linha */
}

body.light-theme .music-table th {
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    color: #475569; /* Cabeçalho da tabela mais visível */
}

body.light-theme .track-index-col {
    color: #475569; /* Index (#) da música mais escuro no tema claro */
}

body.light-theme .music-icon-hover {
    color: #0f172a !important; /* Ícone de PLAY/PAUSE de cada música escuro e super visível */
}

body.light-theme .track-artist-sub {
    color: #475569; /* Texto de artista mais escuro por padrão */
}

body.light-theme .music-table tbody tr:hover .track-artist-sub {
    color: #0f172a; /* Texto do artista fica bem escuro no hover */
}

body.light-theme .music-table tbody tr.playing {
    background-color: rgba(37, 99, 235, 0.06); /* Linha tocando com fundo azul sutil */
}

body.light-theme .music-table tbody tr.playing:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

body.light-theme .progress-slider,
body.light-theme .volume-slider {
    background: #cbd5e1;
}

body.light-theme .progress-fill,
body.light-theme .volume-fill {
    background: var(--primary-blue);
}

body.light-theme input::placeholder {
    color: #475569; /* Placeholder do campo de busca mais escuro */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--spotify-black);
    color: var(--spotify-white);
    overflow: hidden;
    height: 100vh;
    display: flex;
    font-size: 14px;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ==========================================
   TELA DE LOGIN
   ========================================== */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--spotify-black);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.login-card {
    background: var(--spotify-dark);
    border: 1px solid var(--border-color);
    padding: 4rem 3rem;
    border-radius: 16px;
    width: 90%;
    max-width: 440px;
    text-align: center;
}

.login-card .logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--spotify-white);
    margin-bottom: 2.5rem;
}

.login-card .logo svg {
    color: var(--primary-blue);
    width: 40px;
    height: 40px;
}

.login-card p {
    color: var(--spotify-text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    background: var(--spotify-card);
    border: 1px solid var(--border-color);
    padding: 1rem 3.5rem 1rem 1.25rem;
    border-radius: 8px;
    color: var(--spotify-white);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.password-wrapper input:focus {
    border-color: var(--primary-blue);
    background: var(--spotify-card-hover);
}

.toggle-password-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--spotify-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
}

.toggle-password-btn svg {
    width: 22px;
    height: 22px;
}

.login-button {
    width: 100%;
    background: var(--primary-blue);
    border: none;
    padding: 1rem;
    border-radius: 50px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1.5rem;
    transition: var(--transition-smooth);
}

.login-button:hover {
    background: var(--primary-blue-hover);
    transform: scale(1.02);
}

/* ==========================================
   LAYOUT EM PAINÉIS FLUTUANTES (ESTILO SPOTIFY REAL)
   ========================================== */
#app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: 1fr 90px;
    width: 100vw;
    height: 100vh;
    padding: 8px 8px 0 8px;
    background-color: var(--spotify-black);
    gap: 8px;
}

/* Sidebar Wrapper */
.sidebar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    overflow: hidden;
}

/* Painéis Individuais da Sidebar */
.sidebar-panel {
    background-color: var(--spotify-dark);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.nav-panel {
    gap: 1.25rem;
}

.logo-container .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--spotify-white);
    text-decoration: none;
}

.logo-container .logo svg {
    color: var(--primary-blue);
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    color: var(--spotify-text-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    transition: var(--transition-smooth);
}

.nav-links li.active a, .nav-links li a:hover {
    color: var(--spotify-white);
}

.nav-links li a svg {
    width: 24px;
    height: 24px;
}

/* Painel de Biblioteca */
.library-panel {
    flex-grow: 1;
    gap: 1.25rem;
    overflow: hidden;
}

.library-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--spotify-text-muted);
    font-weight: 700;
    font-size: 0.95rem;
}

.library-header svg {
    width: 24px;
    height: 24px;
}

/* Lista de Pastas na Sidebar */
.library-list-container {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-right: -0.5rem;
    padding-right: 0.5rem;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--spotify-text-muted);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.folder-item:hover {
    color: var(--spotify-white);
    background-color: rgba(255,255,255,0.03);
}

.folder-item.active {
    color: var(--primary-blue);
    background-color: rgba(37, 99, 235, 0.1);
}

.folder-item-art {
    width: 36px;
    height: 36px;
    background-color: var(--spotify-card);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.folder-item:hover .folder-item-art {
    background-color: var(--spotify-card-hover);
}

.sidebar-footer {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.sidebar-footer .user-menu {
    width: 100%;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
}

.sidebar-footer .user-menu:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-footer .user-menu .user-dropdown {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 120%; /* Abre para CIMA do nome Léo para evitar corte de overflow */
    top: auto;
}

main {
    background: linear-gradient(to bottom, #101c33 0%, var(--spotify-dark) 40%);
    border-radius: 8px;
    padding: 2rem 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
}

body.light-theme main {
    background: linear-gradient(to bottom, #dbeafe 0%, var(--spotify-dark) 40%);
}

/* Header Geral (Oculto no Desktop, reposicionado na sidebar) */
header, .mobile-header {
    display: none;
}

.search-bar {
    position: relative;
    width: 360px;
}

.search-bar input {
    width: 100%;
    background-color: var(--spotify-grey);
    border: none;
    border-radius: 50px;
    padding: 0.65rem 1rem 0.65rem 2.8rem;
    color: var(--spotify-white);
    outline: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.search-bar input:focus {
    background-color: #333333;
    box-shadow: 0 0 0 1px var(--primary-green);
}

.search-bar svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--spotify-text-muted);
    width: 18px;
    height: 18px;
}

/* Controles Cabeçalho */
.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle-btn {
    background-color: rgba(0,0,0,0.5);
    border: none;
    color: var(--spotify-text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
    color: var(--spotify-white);
    transform: scale(1.05);
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* User Menu */
/* Controles extras na lateral esquerda (Sidebar) */
.sidebar-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
}

.sidebar-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.75rem 0;
    width: 100%;
}

.search-bar-sidebar {
    position: relative;
    width: 100%;
    margin-bottom: 0.25rem;
}

.search-bar-sidebar input {
    width: 100%;
    background-color: var(--spotify-black);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.65rem 1rem 0.65rem 2.8rem;
    color: var(--spotify-white);
    outline: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.search-bar-sidebar input:focus {
    background-color: var(--spotify-card);
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 1px var(--primary-blue);
}

.search-bar-sidebar svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--spotify-text-muted);
    width: 18px;
    height: 18px;
}

/* Divisor lateral sutil separando a sidebar do painel principal */
#app-container {
    border-left: none;
}
.sidebar-wrapper {
    border-right: 1px solid var(--border-color);
    padding-right: 8px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 2px 8px 2px 2px;
    border-radius: 30px;
    cursor: pointer;
    position: relative;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.user-menu:hover {
    background-color: var(--spotify-grey);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background-color: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-dropdown {
    position: absolute;
    top: 115%;
    right: 0;
    background-color: var(--spotify-grey);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 150px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: none;
    flex-direction: column;
    z-index: 100;
}

.user-dropdown button {
    background: none;
    border: none;
    color: var(--spotify-text-muted);
    padding: 0.75rem 1rem;
    text-align: left;
    width: 100%;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-dropdown button:hover {
    color: var(--spotify-white);
    background-color: rgba(255,255,255,0.05);
}

/* Seção de Boas-Vindas */
.welcome-section h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.quick-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.quick-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    cursor: pointer;
    height: 64px;
    position: relative;
    transition: background-color 0.3s ease;
}

.quick-card:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.quick-card-art {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #080d16 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.quick-card-title {
    padding: 0 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Botão de play azul redondo que aparece no hover do quick-card */
.quick-card::after {
    content: '▶';
    position: absolute;
    right: 16px;
    width: 38px;
    height: 38px;
    background-color: var(--primary-blue);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.quick-card:hover::after {
    opacity: 1;
    transform: scale(1);
}

/* 📁 SEÇÃO DE PLAYLISTS QUADRADAS ESTILO SPOTIFY REAL */
.playlists-section {
    margin-top: 1rem;
}

.playlists-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--spotify-white);
}

.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.playlist-card {
    background-color: var(--spotify-card);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease;
}

.playlist-card:hover {
    background-color: var(--spotify-card-hover);
}

.playlist-card-art {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--spotify-card-hover) 0%, var(--spotify-dark) 100%);
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.playlist-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-card-desc {
    font-size: 0.8rem;
    color: var(--spotify-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Botão de play azul redondo no hover do card de playlist */
.playlist-card .play-btn-float {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 48px;
    height: 48px;
    background-color: var(--primary-blue);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.2s cubic-bezier(0.3, 0, 0, 1);
    border: none;
    cursor: pointer;
}

.playlist-card:hover .play-btn-float {
    opacity: 1;
    transform: translateY(0);
}

.playlist-card .play-btn-float:hover {
    transform: scale(1.06);
    background-color: var(--primary-blue-hover);
}

/* ==========================================
   TABELA DE MÚSICAS ESTILO SPOTIFY
   ========================================== */
.music-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.music-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.music-table th, .music-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: none;
    vertical-align: middle;
}

.music-table th {
    color: var(--spotify-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.music-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.music-table tbody tr td:first-child {
    border-radius: 4px 0 0 4px;
}
.music-table tbody tr td:last-child {
    border-radius: 0 4px 4px 0;
}

.music-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.track-index-header {
    width: 60px;
    text-align: center !important;
}

/* Coluna de index da música */
.track-index-col {
    width: 60px;
    text-align: center;
    position: relative;
    color: var(--spotify-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.music-icon-hover {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    color: #ffffff;
}

.music-icon-hover svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.equalizer-container {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.equalizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: 14px;
    height: 14px;
}

.equalizer .bar {
    width: 3px;
    height: 100%;
    background-color: var(--primary-blue);
    animation: bounce 0.8s infinite ease-in-out alternate;
}

.equalizer .bar:nth-child(1) { animation-delay: 0.1s; }
.equalizer .bar:nth-child(2) { animation-delay: 0.3s; }
.equalizer .bar:nth-child(3) { animation-delay: 0.5s; }

@keyframes bounce {
    10% { height: 30%; }
    30% { height: 100%; }
    60% { height: 40%; }
    80% { height: 80%; }
    100% { height: 50%; }
}

.equalizer-container-player {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.equalizer-container-player .equalizer {
    width: 20px;
    height: 20px;
    gap: 3px;
}

.equalizer-container-player .equalizer .bar {
    width: 4px;
    background-color: #ffffff; /* Barras brancas que contrastam bem no gradiente azul */
}

/* Controla exibição no hover */
.music-table tbody tr:hover .track-index-number {
    display: none;
}

.music-table tbody tr:hover .music-icon-hover {
    display: block;
}

/* Quando estiver tocando */
.music-table tbody tr.playing .track-index-number {
    display: none;
}

.music-table tbody tr.playing .equalizer-container {
    display: block;
}

.music-table tbody tr.playing .track-name {
    color: var(--primary-blue) !important;
}

.music-table tbody tr.playing:hover .equalizer-container {
    display: none;
}

.music-table tbody tr.playing:hover .music-icon-hover {
    display: block;
}

/* Alterna Play vs Pause no hover se a música estiver ativa */
.music-table tbody tr .music-icon-hover .play-svg { display: block; }
.music-table tbody tr .music-icon-hover .pause-svg { display: none; }

.music-table tbody tr.playing .music-icon-hover .play-svg { display: none; }
.music-table tbody tr.playing .music-icon-hover .pause-svg { display: block; }

/* Controlar estado pausado global */
body.audio-paused .equalizer .bar {
    animation-play-state: paused;
}

.track-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.track-art-small {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.track-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--spotify-white);
}

.track-artist-sub {
    font-size: 0.8rem;
    color: var(--spotify-text-muted);
    margin-top: 0.15rem;
}

/* ==========================================
   PLAYER DE ÁUDIO INFERIOR
   ========================================== */
.player-bar {
    grid-column: 1 / -1;
    background-color: #000000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 10;
    margin: 0 -8px -8px -8px; /* Cola nas bordas inferiores do grid */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-theme .player-bar {
    background-color: #f1f5f9;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Track Info */
.current-track-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 30%;
    min-width: 180px;
}

.track-art {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.4rem;
}

.track-details {
    overflow: hidden;
}

.track-details h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--spotify-white);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-details p {
    font-size: 0.75rem;
    color: var(--spotify-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Controls */
.player-controls-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    width: 40%;
    max-width: 500px;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.control-btn {
    background: none;
    border: none;
    color: var(--spotify-text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    color: var(--spotify-white);
}

.control-btn.play-pause {
    background: #ffffff;
    color: #000000;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

body.light-theme .control-btn.play-pause {
    background: #0f172a;
    color: #ffffff;
}

.control-btn.play-pause:hover {
    transform: scale(1.08);
    background-color: #f6f6f6;
}

body.light-theme .control-btn.play-pause:hover {
    background-color: #1e293b;
}

.control-btn svg {
    width: 18px;
    height: 18px;
}

.control-btn.play-pause svg {
    width: 18px;
    height: 18px;
    fill: #000000;
}

body.light-theme .control-btn.play-pause svg {
    fill: #ffffff;
}

/* Progress Slider */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.time-label {
    font-size: 0.7rem;
    color: var(--spotify-text-muted);
    min-width: 30px;
}

.progress-slider {
    flex-grow: 1;
    height: 4px;
    background: #4f4f4f;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.progress-slider:hover .progress-fill {
    background: var(--primary-blue);
}

.progress-fill {
    height: 100%;
    background: #ffffff;
    border-radius: 2px;
    width: 0%;
    position: relative;
    transition: background-color 0.1s ease;
}

.progress-slider:hover .progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Volume */
.volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 30%;
    justify-content: flex-end;
}

.volume-container svg {
    color: var(--spotify-text-muted);
    width: 18px;
    height: 18px;
}

.volume-slider {
    width: 100px;
    height: 4px;
    background: #4f4f4f;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.volume-slider:hover .volume-fill {
    background: var(--primary-blue);
}

.volume-fill {
    height: 100%;
    background: #ffffff;
    border-radius: 2px;
    width: 75%;
    position: relative;
    transition: background-color 0.1s ease;
}

.volume-slider:hover .volume-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* ==========================================
   RESPONSIVIDADE E DISPOSITIVOS MÓVEIS (A PROVA DE FALHAS)
   ========================================== */

/* 📱 TABLETS (Telas entre 769px e 1024px) */
@media (max-width: 1024px) {
    #app-container {
        grid-template-columns: 80px 1fr;
    }
    
    .sidebar-wrapper {
        width: 80px;
    }
    
    .sidebar-panel {
        padding: 1rem 0.25rem;
        align-items: center;
    }
    
    .logo-container .logo span, 
    .nav-links li a span,
    .library-header span,
    .scan-button span,
    .folder-item span {
        display: none; /* Oculta textos */
    }
    
    .logo-container {
        padding: 0;
        display: flex;
        justify-content: center;
    }
    
    .nav-links li a, .library-header {
        justify-content: center;
    }
    
    .sidebar-footer .user-menu span,
    .sidebar-footer .user-menu svg {
        display: none !important;
    }
    
    .sidebar-footer .user-menu {
        padding: 2px !important;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
    }
    
    .folder-item {
        justify-content: center;
        padding: 0.5rem 0;
    }
}

/* 📱 CELULARES (Telas até 768px) */
@media (max-width: 768px) {
    #app-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        padding: 0;
        gap: 0;
    }
    
    .sidebar-wrapper {
        display: none; /* Sidebar oculta */
    }
    
    main {
        border-radius: 0; /* Ocupa a tela inteira */
        padding: 0.5rem 1rem 110px 1rem;
        height: 100vh;
        overflow-y: auto;
        background: linear-gradient(to bottom, #0d1527 0%, var(--spotify-black) 40%);
    }
    
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 1rem;
        background-color: #0d1527;
        padding: 0.75rem 0;
        position: sticky;
        top: 0;
        z-index: 100;
        border-bottom: 1px solid var(--border-color);
        margin-left: 0;
        margin-right: 0;
    }
    
    body.light-theme .mobile-header {
        background-color: #dbeafe;
        border-bottom: 1px solid var(--border-color);
    }
    
    .search-bar {
        flex-grow: 1;
        width: auto;
    }
    
    .quick-cards-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .music-table th, .music-table td {
        padding: 0.8rem 0.5rem;
    }

    /* Mini Player Flutuante */
    .player-bar {
        position: fixed;
        bottom: 12px;
        left: 8px;
        right: 8px;
        width: calc(100% - 16px);
        height: 64px;
        background-color: rgba(18, 18, 18, 0.9);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        padding: 0 1rem;
        grid-column: unset;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .current-track-info {
        width: 65%;
        gap: 0.5rem;
    }
    
    .track-art {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .track-details h4 {
        font-size: 0.85rem;
    }
    
    .track-details p {
        font-size: 0.75rem;
    }
    
    .player-controls-container {
        width: 35%;
        flex-direction: row;
        justify-content: flex-end;
        gap: 0;
    }
    
    .control-buttons {
        gap: 0.5rem;
    }
    
    #prev-btn,
    #next-btn,
    .time-label {
        display: none !important;
    }
    
    .control-btn.play-pause {
        width: 36px;
        height: 36px;
        background-color: var(--spotify-white);
        color: var(--spotify-black);
    }
    
    .control-btn.play-pause svg {
        fill: var(--spotify-black);
    }
    
    .progress-bar-container {
        position: absolute;
        top: 0;
        left: 8px;
        width: calc(100% - 16px);
        padding: 0;
    }
    
    .progress-slider {
        height: 2px;
        border-radius: 0;
        margin: 0;
        background: rgba(255, 255, 255, 0.05);
    }
    
    .progress-fill {
        border-radius: 0;
    }
    
    .volume-container {
        display: none !important;
    }
}

/* 📱 CELULARES PEQUENOS (Telas até 480px) */
@media (max-width: 480px) {
    .quick-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-section h2 {
        font-size: 1.5rem;
    }
    
    .user-menu span {
        display: none;
    }
    
    .user-menu {
        padding: 4px;
    }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

body.light-theme ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

body.light-theme ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}
