/* ================================== */
/* 1. CONFIGURAÇÕES GLOBAIS E FONTES  */
/* ================================== */
:root {
    --primary-color: #8a4fff;
    --primary-color-hover: #a479ff;
    --background-color: #000000;
    --content-background-color: #121212;
    --surface-color: #181818;
    --surface-color-hover: #282828;
    --text-color: #ffffff;
    --text-secondary-color: #b3b3b3;
	--main-view-gradient-start: #22153a;
}
body.theme-blue { --primary-color: #3D8BFF; --primary-color-hover: #5a9eff; --main-view-gradient-start: #1e4a8b; }
body.theme-green { --primary-color: #1DB954; --primary-color-hover: #1ed760; --main-view-gradient-start: #2a4a3a; }
body.theme-red { --primary-color: #e53935; --primary-color-hover: #f44336; --main-view-gradient-start: #6c2d2d; }

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif; background-color: var(--background-color); color: var(--text-color); overflow: hidden; }
a { text-decoration: none; color: inherit; }

/* ================================== */
/* 2. ESTRUTURA PRINCIPAL             */
/* ================================== */
.app-container { display: grid; grid-template-areas: "sidebar main-view"; grid-template-columns: auto 1fr; grid-template-rows: 1fr; width: 100vw; height: 100dvh; }

/* ================================== */
/* 3. BARRA LATERAL (SIDEBAR)         */
/* ================================== */
.sidebar { grid-area: sidebar; background-color: #000; width: 280px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-section { background-color: var(--content-background-color); border-radius: 8px; padding: 12px 20px; }
.sidebar-section ul { list-style: none; }
.sidebar-section li { padding: 8px 0; }
.sidebar-section a { color: var(--text-secondary-color); font-weight: bold; font-size: 16px; display: flex; align-items: center; gap: 15px; transition: color 0.2s; }
.sidebar-section a:hover, .sidebar-section a.active { color: var(--text-color); }
.sidebar-section .icon { font-size: 24px; width: 24px; text-align: center; }
.library-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.library-header .header-icon-btn { background: none; border: none; color: var(--text-secondary-color); font-size: 16px; cursor: pointer; padding: 8px; border-radius: 50%; transition: background-color 0.2s, color 0.2s; }
.library-header .header-icon-btn:hover { background-color: var(--surface-color-hover); color: white; }
.sidebar-section-library { flex-grow: 1; display: flex; flex-direction: column; }
.library-list { list-style: none; flex-grow: 1; flex-basis: 0; overflow-y: auto; }
.library-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 6px; cursor: pointer; transition: background-color 0.2s; }
.library-item:hover { background-color: var(--surface-color-hover); }
.library-item-cover { font-size: 20px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background-color: var(--surface-color); border-radius: 4px; flex-shrink: 0; }
.library-item-info h4 { font-size: 16px; color: var(--text-color); font-weight: 500;}
.library-item-info p { font-size: 14px; color: var(--text-secondary-color); }


/* ================================== */
/* 4. CONTEÚDO PRINCIPAL (MAIN VIEW)  */
/* ================================== */
.main-view { grid-area: main-view; background: linear-gradient(to bottom, var(--main-view-gradient-start), var(--content-background-color) 350px); border-radius: 8px; overflow-y: auto; }
.main-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 32px; background-color: rgba(20,20,20,0.7); backdrop-filter: blur(5px); position: sticky; top: 0; z-index: 10; gap: 15px; height: 65px; }
.header-nav { display: flex; gap: 8px; }
.header-nav button { background-color: rgba(0,0,0,0.7); border: none; color: white; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px; }
.user-profile { display: flex; align-items: center; gap: 15px; }
.user-profile button { background-color: #282828; border: none; color: white; padding: 4px 12px 4px 4px; border-radius: 20px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: bold; }
.user-profile .avatar { width: 28px; height: 28px; border-radius: 50%; background-color: #535353; }
.playlist-details { padding: 32px; padding-top: 20px; display: flex; align-items: flex-end; gap: 24px; }
.playlist-cover img { width: 232px; height: 232px; box-shadow: 0 4px 60px rgba(0,0,0,0.5); border-radius: 8px; }
.playlist-info h2 { font-size: 5rem; font-weight: 900; }

/* --- Tabela de Músicas --- */
.song-list-container { padding: 0 32px; padding-bottom: 50px; }
.song-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.song-table thead { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.song-table th { text-align: left; color: var(--text-secondary-color); font-size: 14px; font-weight: 400; padding: 10px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-table th:nth-child(1) { width: 5%; text-align: center; } /* Número da música */
.song-table th:nth-child(2) { width: 3%; text-align: center; } /* Status Offline */
.song-table th:nth-child(3) { width: 35%; } /* Título */
.song-table th:nth-child(4) { width: 20%; } /* Playlist */
.song-table th:nth-child(5) { width: 5%; text-align: center; cursor: pointer; } /* Ícone de Coração */
.song-table th:nth-child(6) { width: 5%; text-align: center; } /* Download */
.song-table th:nth-child(7) { width: 5%; text-align: center; } /* Excluir */
.song-row { cursor: pointer; border-radius: 4px; }
.song-row:hover { background-color: rgba(255, 255, 255, 0.05); }
.song-row.playing { background-color: rgba(255, 255, 255, 0.1); }
.song-row td { padding: 12px 8px; color: var(--text-secondary-color); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-row .song-number-text { display: inline; }
.song-row.playing .song-number-text { display: none; }
.song-row .song-number-playing { display: none; color: var(--primary-color); }
.song-row.playing .song-number-playing { display: block; }
.song-row td.song-title-cell { display: flex; align-items: center; }
.song-row .song-title-info .title { color: var(--text-color); font-size: 16px; margin-bottom: 4px; margin-right: 10px; }
.song-row.playing .song-title-info .title { color: var(--primary-color); }
.song-row .song-title-info .artist { font-size: 14px; }
.song-row .icon-action.icon-heart.favorited { color: var(--primary-color); }
.main-header.stuck {
    background-color: var(--content-background-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    backdrop-filter: none;
}
/* Adicione este trecho ao final da seção da tabela de músicas */
.song-row .icon-action,
.song-row .icon-action + .icon-action {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.song-row .icon-cell {
    text-align: center; /* Mantém o alinhamento de texto para fallback */
    vertical-align: middle;
}

.song-row .icon-cell a,
.song-row .icon-cell i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* ================================== */
/* 5. PLAYER CENTRAL FLUTUANTE        */
/* ================================== */
.floating-player-container { padding: 0 32px 24px 32px; position: sticky; top: 70px; z-index: 5; transition: top 0.3s ease-in-out, padding 0.3s ease-in-out; }
.floating-player-container.stuck { padding: 0; top: 70px; background-color: rgba(18, 18, 18, 0.95); backdrop-filter: blur(0px); }
.floating-player-content { background-color: rgba(20, 20, 20, 0.8); backdrop-filter: blur(10px); border-radius: 12px; padding: 24px; display: flex; align-items: center; gap: 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); transition: all 0.3s ease-in-out; }
.floating-player-container.stuck .floating-player-content { border-radius: 0; border-left: none; border-right: none; }
.floating-player-cover { width: 150px; height: 150px; border-radius: 8px; background-color: #333; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 60px; color: var(--text-secondary-color); }
.floating-player-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.floating-player-details { flex-grow: 1; display: flex; flex-direction: column; gap: 10px; }
.floating-player-details h3 { font-size: 24px; font-weight: 700; }
.floating-player-details p { font-size: 16px; color: var(--text-secondary-color); }
.progress-container-floating { width: 100%; }
.progress-bar-floating { background-color: #535353; height: 5px; border-radius: 2.5px; cursor: pointer; }
.progress-floating { background-color: var(--text-color); height: 100%; width: 0%; border-radius: 2.5px; }
.progress-bar-floating:hover .progress-floating { background-color: var(--primary-color); }
.time-container-floating { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary-color); margin-top: 5px; }
.player-buttons-floating { display: flex; align-items: center; justify-content: center; gap: 20px; }
.control-btn-floating { background: none; border: none; color: var(--text-secondary-color); font-size: 20px; cursor: pointer; transition: color 0.2s; }
.control-btn-floating:hover { color: var(--text-color); }
.control-btn-floating.active { color: var(--primary-color); }
.play-button-large-floating { background-color: var(--text-color); color: #000; border: none; width: 50px; height: 50px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 22px; cursor: pointer; transition: transform 0.2s, background-color 0.2s; }
.play-button-large-floating:hover { transform: scale(1.1); background-color: var(--primary-color); }



.floating-player-content {
    display: grid;
    grid-template-areas:
        "cover details actions"
        ". . .";
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background-color: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease-in-out;
}

.floating-player-cover {
    grid-area: cover;
}

.floating-player-details {
    grid-area: details;
}

.floating-player-actions {
    grid-area: actions;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; /* Espaço entre o grupo de botões e o botão de download */
}

/* Modifique a regra para o player-buttons-floating para ser mais flexível */
.player-buttons-floating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* Ajuste o alinhamento e o tamanho do botão de download */
.floating-player-actions a {
    font-size: 20px; /* Garante que o ícone do link tenha um tamanho adequado */
}
/* Adicione este trecho para posicionar os botões de letra e download */
.floating-player-cover-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; /* Espaço entre a capa e os botões */
}

.floating-cover-buttons {
    display: flex;
    gap: 15px; /* Espaço entre os botões de letra e download */
}
/* ================================== */
/* 6. BOTÕES DE AÇÃO SECUNDÁRIOS      */
/* ================================== */
.playlist-actions-secondary { padding: 0 32px 24px 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.action-btn-secondary { background-color: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--text-secondary-color); padding: 8px 16px; border-radius: 50px; cursor: pointer; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; transition: background-color 0.2s, color 0.2s; }
.action-btn-secondary:hover { background-color: rgba(255, 255, 255, 0.15); color: var(--text-color); }
.action-btn-secondary.active { background-color: var(--primary-color); color: #000; border-color: var(--primary-color); }

/* ================================== */
/* 7. MODAIS E MENUS DE CONTEXTO      */
/* ================================== */
.modal { display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.7); justify-content: center; align-items: center; }
.modal-content { background-color: var(--surface-color-hover); padding: 30px; border-radius: 10px; width: 90%; max-width: 500px; position: relative; box-shadow: 0 5px 20px rgba(0,0,0,0.5); }
.modal-content h2 { margin-top: 0; margin-bottom: 20px; color: var(--text-color); }
.close-button { color: #aaa; position: absolute; top: 15px; right: 20px; font-size: 28px; font-weight: bold; cursor: pointer; transition: color 0.2s; }
.close-button:hover { color: white; }
.hidden { display: none !important; }
.context-menu { position: absolute; z-index: 2001; background-color: #282828; border-radius: 6px; box-shadow: 0 5px 15px rgba(0,0,0,0.5); padding: 5px; min-width: 180px; border: 1px solid rgba(0,0,0,0.2); }
.context-menu ul { list-style: none; padding: 0; margin: 0; }
.context-menu li { padding: 12px 15px; cursor: pointer; transition: background-color 0.2s; color: var(--text-secondary-color); font-size: 14px; border-radius: 4px; }
.context-menu li:hover { background-color: #3e3e3e; color: var(--text-color); }
.context-menu li.destructive:hover { background-color: #d93f3f; color: white; }

/* ESTILOS PARA O NOVO MODAL DE GERENCIAMENTO */
#song-management-controls { margin-bottom: 15px; }
#song-management-controls .input-group { margin-bottom: 10px; }
#song-management-song-list { max-height: 40vh; overflow-y: auto; border: 1px solid #444; border-radius: 5px; padding: 10px; }
.song-management-item { display: flex; align-items: center; padding: 8px; border-radius: 4px; }
.song-management-item:hover { background-color: var(--surface-color); }
.song-management-item label { display: flex; align-items: center; width: 100%; cursor: pointer; }
.song-management-item input[type="checkbox"] { margin-right: 15px; width: 18px; height: 18px; }
.song-management-item-info .title { font-size: 15px; color: var(--text-color); }
.song-management-item-info .artist { font-size: 13px; color: var(--text-secondary-color); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.select-all-container {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.select-all-container label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
}

.select-all-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
}


/* ================================== */
/* 8. PÁGINA DE LOGIN E UTILITÁRIOS   */
/* ================================== */
.login-page { display: flex; justify-content: center; align-items: center; height: 100vh; background: #121212; }
.login-container { background-color: var(--surface-color); padding: 40px; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.5); width: 100%; max-width: 400px; text-align: center; }
.login-container h2 { margin-bottom: 20px; color: var(--primary-color); }
.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; margin-bottom: 5px; color: var(--text-secondary-color); }
.input-group input, .input-group textarea, .input-group select { width: 100%; padding: 10px; border-radius: 5px; border: 1px solid #535353; background-color: #333; color: var(--text-color); font-family: 'Roboto', sans-serif; font-size: 14px; resize: vertical; }
.button-primary { background-color: var(--primary-color); color: white; font-weight: bold; border: none; padding: 12px 20px; border-radius: 50px; cursor: pointer; transition: background-color 0.3s; width: 100%; margin-top: 10px; }
.button-primary:hover { background-color: var(--primary-color-hover); }
.button-secondary { background-color: #535353; color: white; font-weight: bold; border: none; padding: 12px 20px; border-radius: 50px; cursor: pointer; transition: background-color 0.3s; }

/* --- Scrollbar Customizada --- */
.main-view::-webkit-scrollbar, .library-list::-webkit-scrollbar, .song-list-nested::-webkit-scrollbar, #song-management-song-list::-webkit-scrollbar { width: 8px; }
.main-view::-webkit-scrollbar-track, .library-list::-webkit-scrollbar-track, .song-list-nested::-webkit-scrollbar-track, #song-management-song-list::-webkit-scrollbar-track { background: transparent; }
.main-view::-webkit-scrollbar-thumb, .library-list::-webkit-scrollbar-thumb, .song-list-nested::-webkit-scrollbar-thumb, #song-management-song-list::-webkit-scrollbar-thumb { background-color: transparent; border-radius: 4px; transition: background-color 0.2s ease-in-out; }
.main-view:hover::-webkit-scrollbar-thumb, .library-list:hover::-webkit-scrollbar-thumb, .song-list-nested:hover::-webkit-scrollbar-thumb, #song-management-song-list:hover::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.4); }
.main-view, .library-list, .song-list-nested, #song-management-song-list { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.4) transparent; }

.feedback-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: var(--primary-color); color: white; padding: 10px 20px; border-radius: 20px; z-index: 2000; font-weight: bold; animation: fade-in-out 3s ease-in-out forwards; }
@keyframes fade-in-out { 0%, 100% { opacity: 0; transform: translate(-50%, 10px); } 10%, 90% { opacity: 1; transform: translate(-50%, 0); } }

/* --- CORREÇÕES ESPECÍFICAS --- */
.file-upload-label { display: inline-block; padding: 12px 20px; cursor: pointer; text-align: center; width: 100%; margin-bottom: 15px; background-color: #535353; border-radius: 50px; font-weight: bold; }
.label-with-button { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.button-secondary-small { background-color: #535353; color: white; border: none; padding: 5px 10px; font-size: 12px; border-radius: 20px; cursor: pointer; transition: background-color 0.3s; font-weight: bold; flex-shrink: 0; }
.button-secondary-small:hover { background-color: #737373; }
.header-search-container { position: relative; flex-grow: 1; max-width: 350px; }
.header-search-container .search-icon { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: var(--text-secondary-color); }
#search-input { width: 100%; height: 40px; border-radius: 20px; border: none; padding: 6px 12px 6px 36px; background-color: #242424; color: var(--text-color); font-size: 14px; }
#search-input:focus { outline: 2px solid var(--primary-color); }
.theme-swatches { display: flex; gap: 8px; }
.theme-swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.2s, border-color 0.2s; }
.theme-swatch.active { border-color: var(--text-color); }
.lyrics-popup { position: fixed; bottom: 30px; right: 30px; width: 380px; max-height: 60vh; background-color: rgba(24, 24, 24, 0.92); backdrop-filter: blur(5px); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; z-index: 1050; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; opacity: 0; transform: translateY(20px); transition: opacity 0.4s ease, transform 0.4s ease; }
.lyrics-popup:not(.hidden) { opacity: 1; transform: translateY(0); }
.lyrics-popup-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); cursor: move; }
.lyrics-popup-header h3 { margin: 0; font-size: 16px; }
.close-popup-btn { background: none; border: none; color: var(--text-secondary-color); font-size: 24px; line-height: 1; cursor: pointer; padding: 0 5px; transition: color 0.2s; }
.close-popup-btn:hover { color: var(--text-color); }
.lyrics-popup-content { padding: 15px; overflow-y: auto; color: var(--text-secondary-color); font-size: 15px; line-height: 1.6; white-space: pre-wrap; }
#lyrics-textarea { width: 100%; height: 40vh; padding: 15px; border-radius: 5px; border: 1px solid #535353; background-color: #333; color: var(--text-color); font-size: 16px; resize: vertical; }
.playlist-checkbox-container { max-height: 150px; overflow-y: auto; border: 1px solid #535353; padding: 10px; border-radius: 5px; background-color: #333; }
.playlist-checkbox-item { display: block; margin-bottom: 8px; }
.playlist-checkbox-item label { display: flex; align-items: center; padding: 5px 0; cursor: pointer; }
.playlist-checkbox-item input[type="checkbox"] { width: 18px; height: 18px; margin-right: 12px; }
.youtube-add-link-container { display: flex; align-items: flex-end; gap: 10px; }
.youtube-add-link-container .input-group { flex-grow: 1; margin-bottom: 0; }
.youtube-add-link-container textarea { min-height: 40px; height: 40px; resize: none; overflow-y: hidden; padding-top: 10px; }
.button-add-link { background-color: var(--primary-color); color: white; font-weight: bold; border: none; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; font-size: 24px; transition: background-color 0.3s; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.button-add-link:hover { background-color: var(--primary-color-hover); }
.youtube-link-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; background-color: var(--surface-color); border-radius: 4px; margin-bottom: 8px; font-size: 14px; }
.remove-link-btn { background: none; border: none; color: #ff4d4d; font-size: 18px; cursor: pointer; margin-left: 10px; padding: 5px; }
.cache-status-icon { font-size: 8px; color: var(--primary-color); text-shadow: 0 0 4px var(--primary-color); vertical-align: middle; transition: opacity 0.3s; }
.cache-status-icon.not-cached { opacity: 0; }

/* ================================== */
/* 9. ÍNDICE DE ARTISTAS (GRADE)      */
/* ================================== */
.artist-index-grid { display: none; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; padding: 10px 0; }
.artist-index-grid.expanded { display: grid; }
.artist-index-letter { display: flex; align-items: center; justify-content: center; height: 40px; background-color: var(--surface-color-hover); color: var(--text-secondary-color); border-radius: 6px; font-weight: bold; text-decoration: none; transition: all 0.2s ease-in-out; }
.artist-index-letter:hover { background-color: var(--primary-color); color: white; transform: scale(1.05); }

/* ================================== */
/* 10. RESPONSIVO PARA MOBILE         */
/* ================================== */
.hamburger-btn { display: none; background: none; border: none; color: var(--text-color); font-size: 20px; cursor: pointer; margin-right: 10px; }
.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 1999; }
@media (max-width: 768px) {
    /* Estilos para o menu hambúrguer, barra lateral, etc. */
    .hamburger-btn { display: block; }
    .header-nav { display: none; }
    .song-list-container { padding: 0 16px; }

    /* Oculta as colunas de "Playlist", "Download" e "Excluir" */
    .song-table th:nth-child(4), .song-table td:nth-child(4) { display: none; }
    .song-table th:nth-child(6), .song-table td:nth-child(6) { display: none; }
    .song-table th:nth-child(7), .song-table td:nth-child(7) { display: none; }

    /* Ajusta a largura das colunas visíveis e na linha 303 child 3 empurra titulo */
    .song-table th:nth-child(3) { width: 30%; }
    .song-table th:nth-child(5) { width: 15%; }
    .song-row .song-title-info { display: block; }
    .song-row .song-title-info .title { white-space: normal; word-break: break-word; font-size: 15px; }
    .song-row .song-title-info .artist { font-size: 13px; }

    /* Estilos para a barra lateral em mobile */
    .sidebar { position: fixed; top: 0; left: 0; height: 100%; width: 85%; max-width: 320px; transform: translateX(-100%); transition: transform 0.3s ease-in-out; z-index: 2000; box-shadow: 2px 0 10px rgba(0,0,0,0.5); padding-top: 60px; }
    .sidebar.visible { transform: translateX(0); }
    .playlist-details { flex-direction: column; align-items: center; text-align: center; }
    .playlist-info h2 { font-size: 2.5rem; }
    .floating-player-content { flex-direction: column; text-align: center; }
    .floating-player-cover { width: 120px; height: 120px; }
    #header-categories-btn span {
        display: none; /* Oculta o texto "Categorias" */
    }
    #header-categories-btn {
         width: 38px; /* Deixa o botão quadrado, como os de navegação */
         height: 38px;
         border-radius: 50%;
         justify-content: center;
         padding: 0;
    }
    .header-categories-container {
        margin-left: 0; /* Remove a margem para se alinhar com outros botões */
    }
}
/* ================================== */
/* 11. GERAIS PERSONALIZADOS          */
/* ================================== */

/* Estilos para o novo modal de progresso de download */
.download-progress-modal {
    display: flex; /* Garante que o modal fique no centro */
    align-items: center;
    justify-content: center;
}

.download-progress-content {
    text-align: center;
    max-width: 400px;
    padding: 30px;
}

.download-progress-content h2 {
    color: var(--primary-color); /* Cor verde para o título */
    margin-bottom: 20px;
}

.status-text {
    color: var(--primary-color); /* Cor verde para o texto de status */
    font-weight: bold;
    margin-bottom: 15px;
}

.progress-bar-container-modal {
    width: 100%;
    background-color: #535353;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar-fill-modal {
    background-color: var(--primary-color);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease-in-out;
}

.progress-info-modal {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary-color);
}

#hide-progress-btn {
    margin-top: 20px;
}

/* Oculta os elementos antigos de status de cache */
#offline-cache-status {
    display: none !important;
}
/* MELHORAR A LEITURA DO TÍTULO/ARTISTA */
.song-row .song-title-info {
    display: block; /* Faz o container empilhar os filhos verticalmente */
}

.song-row .song-title-info .title {
    display: block;
    white-space: normal;   /* Permite que o título ocupe várias linhas */
    word-break: break-word;/* Força a quebra de palavras longas */
    font-size: 15px;
    margin-bottom: 2px;
}

.song-row .song-title-info .artist {
    display: block;
    font-size: 13px;
    color: var(--text-secondary-color);
}

.song-row .song-title-info .artist::before {
    content: "(";
}

.song-row .song-title-info .artist::after {
    content: ")";
}
/* Ajusta o padding das células para economizar espaço */
.song-table th {
    padding: 10px 4px;
}
.song-row td {
    padding: 12px 4px;
    vertical-align: middle; /* Centraliza o conteúdo verticalmente */
}
/* Adicione este trecho ao final do arquivo, ou na seção de MODAIS E MENUS DE CONTEXTO */
#user-menu {
    top: calc(100% + 5px); /* Posiciona abaixo do botão */
    right: 0; /* Alinha à direita do contêiner pai */
}
    #user-profile-btn {
        /* Garante que o botão use um layout flexível para o avatar e o texto */
        display: flex; 
        align-items: center;
        padding: 6px 10px 6px 6px; /* Ajusta o padding para ficar compacto */
        gap: 6px; /* Espaço entre avatar e nome */
        max-width: 140px; /* Limite a largura total do botão para economizar espaço */
        overflow: hidden; /* Garante que nada transborde */
    }

    #user-profile-btn #username-display {
        font-size: 12px; /* Reduz o tamanho da fonte para caber mais */
        white-space: nowrap; /* Impede que o texto quebre linha */
        overflow: hidden; /* Esconde o texto que ultrapassa */
        text-overflow: ellipsis; /* Adiciona "..." se o texto for cortado */
        max-width: 90px; /* Limite a largura do texto do nome em particular */
    }

    /* Opcional: Ajusta o tamanho do avatar dentro do botão do perfil se necessário */
    #user-profile-btn .avatar {
        width: 28px; /* Avatar um pouco menor */
        height: 28px;
        min-width: 28px; /* Garante que o avatar não diminua muito */
    }
/* Adicione este trecho ao final do arquivo, ou na seção de Modais */
.avatar-upload-container {
    width: 150px; /* Defina a largura do contêiner */
    height: 150px; /* Defina a altura do contêiner */
    border-radius: 50%;
    overflow: hidden; /* Importante para esconder partes da imagem que ultrapassam o círculo */
    margin: 0 auto 20px; /* Centraliza o contêiner */
    position: relative; /* Necessário para posicionar o botão de alterar */
}

.avatar-preview {
    width: 100%; /* Garante que a imagem ocupe toda a largura do contêiner */
    height: 100%; /* Garante que a imagem ocupe toda a altura do contêiner */
    object-fit: cover; /* Redimensiona a imagem para preencher o contêiner sem distorção */
}
/* Adicione este trecho ao final do arquivo, ou na seção de Modais */
.avatar-change-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.6); /* Fundo semi-transparente */
    color: white;
    padding: 8px 0;
    font-size: 14px;
    cursor: pointer;
    opacity: 0; /* Começa oculto */
    transition: opacity 0.3s ease;
}

.avatar-upload-container:hover .avatar-change-label {
    opacity: 1; /* Exibe ao passar o mouse */
}

.file-upload-label {
    /* Mantenha o estilo atual do seu botão de upload */
    display: inline-block;
    padding: 12px 20px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    margin-bottom: 15px;
    background-color: #535353;
    border-radius: 50px;
    font-weight: bold;
}

#musicFile {
    /* Oculta o input de arquivo nativo */
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

#file-name-display {
    /* Garante que o nome do arquivo selecionado seja visível */
    display: block;
    margin-top: -5px; /* Ajuste para espaçamento adequado */
    text-align: center;
    color: var(--text-secondary-color);
    font-size: 14px;
}
/* ================================== */
/* 12. MENU DE CATEGORIAS NO HEADER   */
/* ================================== */
.header-categories-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: auto; /* Empurra o menu para perto do perfil do usuário */
}

#header-categories-btn {
    background-color: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 6px 16px;
    height: 38px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s;
}

#header-categories-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

#header-categories-menu {
    top: calc(100% + 10px);
    width: 240px;
}

#header-category-list {
    max-height: 300px;
    overflow-y: auto;
}

#header-category-list a {
    display: block;
    width: 100%;
}

.context-menu-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px;
    margin-top: 5px;
}
.context-menu-footer a {
    display: block;
    padding: 8px 15px;
    font-size: 13px;
    color: var(--text-secondary-color);
    border-radius: 4px;
    text-align: center;
}
.context-menu-footer a:hover {
     background-color: #3e3e3e;
     color: var(--text-color);
}
/* ================================== */
/* 13. ESTILOS DE PERSONIFICAÇÃO      */
/* ================================== */

/* Barra de Aviso de Personificação */
.masquerade-banner {
    background-color: #ffc107; /* Amarelo alerta */
    color: #000;
    text-align: center;
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: sticky; /* Fica preso abaixo do header */
    top: 65px; /* Altura do header */
    z-index: 9;
}

.masquerade-banner strong {
    font-weight: 700;
}

.masquerade-banner a {
    color: #0056b3;
    font-weight: 700;
    text-decoration: underline;
    background: rgba(0,0,0,0.1);
    padding: 3px 8px;
    border-radius: 5px;
}

.masquerade-banner a:hover {
    color: #002752;
    background: rgba(0,0,0,0.2);
}

/* Ajuste no main-view quando a barra estiver ativa */
.main-header + .masquerade-banner + .main-view {
    /* Este seletor garante que o ajuste de altura só aconteça quando a barra existe */
   height: calc(100vh - 65px - 45px); /* Altura da viewport - header - banner */
}

/* Menu de Personificação */
#user-menu .has-submenu {
    position: relative;
}

#user-menu .has-submenu > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#user-menu .has-submenu .fa-chevron-right {
    font-size: 0.8em;
}

.context-submenu {
    position: absolute;
    right: 100%; /* Alterado de 'left' para 'right' */
    top: -5px;
    margin-right: 5px; /* Adiciona um pequeno espaço entre os menus */
    background-color: #282828;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    padding: 5px;
    min-width: 180px;
    border: 1px solid rgba(0,0,0,0.2);
    list-style: none;
}

.context-submenu li a {
    display: block;
    padding: 10px 15px;
    white-space: nowrap;
}
/* ================================== */
/* 13. AJUSTES E MENU DE CACHE        */
/* ================================== */

/* Ajusta o novo botão de engrenagem no header */
#settings-btn {
    background-color: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-color);
    width: 25px;
    height: 25px;
    font-size: 16px; /* Tamanho do ícone */
    border-radius: 50%;
    cursor: pointer;
    margin-left: 0px;
    margin-right: 0px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
    padding: 0; /* Garante que não haja preenchimento interno */
    line-height: 1; /* Garante que a altura da linha não desalinhe o ícone */
}

#settings-btn i {
    margin: 0; /* Remove qualquer margem do próprio ícone */
}

#settings-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Os estilos para .context-menu .context-menu-header continuam os mesmos */
.context-menu .context-menu-header {
    padding: 10px 15px 5px 15px;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-secondary-color);
    text-transform: uppercase;
    cursor: default;
}

.context-menu .context-menu-header:hover {
    background-color: transparent; /* Remove efeito de hover */
}
/* ================================== */
/* 13. AJUSTES E MENU DE CACHE        */
/* ================================== */

/* Alinha o ícone dentro do item de menu */
#user-menu li a {
    display: flex;
    align-items: center;
}

#user-menu li a .fas {
    width: 20px; /* Largura fixa para o ícone */
    margin-right: 12px;
    text-align: center;
}
/* EM style.css */

.download-item-details {
    margin-top: 20px;
    width: 100%;
}
.download-item-details.hidden {
    display: none;
}
.download-item-details .divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}
#download-item-title {
    font-size: 14px;
    color: var(--text-secondary-color);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-progress-bar {
    height: 6px;
}
.item-progress-info {
    font-size: 12px;
}
