/* ... (Mantenha o reset e estilos básicos do arquivo anterior) ... */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: sans-serif;
    background-color: #fdfdfd;
    color: #333;
    padding-top: 50px; 
    overflow-y: scroll;
}

/* --- Barra Superior --- */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 45px;
    background-color: #f0f0f0;
    border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 1000;
}

/* --- Barra de Alfabeto --- */
.alphabet-bar {
    position: fixed;
    top: 45px;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: #fff;
    border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 5px;
    z-index: 999;
    overflow-x: auto;
    white-space: nowrap;
    font-family: monospace;
    font-size: 14px;
}

.alphabet-bar a {
    text-decoration: none;
    color: #800000;
    font-weight: bold;
    padding: 2px 4px;
}

.alphabet-bar a:hover {
    background-color: #eee;
    border-radius: 3px;
}

/* --- Botões Gerais --- */
.btn-back, .btn-action, .btn-col {
    text-decoration: none;
    color: #333;
    background: #ddd;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    border: 1px solid #ccc;
}
.btn-col.active { background-color: #800000; color: white; }

/* --- Botões Primários Unificados --- */
.btn-primary {
    display: inline-block;
    background-color: #800000;
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    text-align: center;
}
.btn-primary:hover {
    background-color: #600000;
}

/* --- Botão de Sugestão (usa estilo primário) --- */
.btn-suggest {
    composes: btn-primary;
}

/* --- NOVO: Formulário de Sugestão --- */
.suggestion-box {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: sans-serif;
    font-size: 1rem;
    margin-bottom: 15px;
    resize: vertical;
}

.btn-submit {
    background-color: #008000; /* Verde */
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
}
.btn-submit:hover { background-color: #006000; }

.btn-clear {
    composes: btn-primary;
}

/* --- NOVO: Botão Nova Música --- */
.btn-new-song {
    composes: btn-primary;
}

/* --- Container de botões de ação centralizado --- */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.action-buttons form {
    display: inline;
    margin: 0;
    padding: 0;
}

/* --- Container Principal da Lista --- */
.container-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

/* --- Índice de Artistas --- */
details {
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 5px;
    background: #fafafa;
}
summary {
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    color: #555;
    outline: none;
}

/* GRID DE ARTISTAS RESPONSIVO */
.artist-grid {
    margin-top: 10px;
    /* Padrão Desktop: 4 Colunas */
    column-count: 4;
    column-gap: 20px;
    column-rule: 1px solid #eee;
}

/* Mobile: Ajuste para 2 colunas */
@media (max-width: 768px) {
    .artist-grid {
        column-count: 2;
    }
}

.artist-grid a {
    display: block;
    text-decoration: none;
    color: #0056b3;
    font-size: 0.85rem;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.artist-grid a:hover { text-decoration: underline; }

.separator { border: 0; border-top: 1px solid #eee; margin: 10px 0; }

/* --- Lista de Músicas Compacta (Mantido igual) --- */
.song-list-compact ul { list-style: none; }
.letter-separator {
    background-color: #800000;
    color: white;
    font-weight: bold;
    padding: 2px 10px;
    font-size: 0.9rem;
    margin-top: 10px;
    border-radius: 3px;
    scroll-margin-top: 90px; 
}
.song-item { border-bottom: 1px solid #f0f0f0; line-height: 1.2; }
.song-link {
    display: block;
    padding: 6px 5px;
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}
.song-link:hover { background-color: #fff8f8; color: #800000; }
.song-link.visited {
    background-color: #fff5f5;
    border-left: 3px solid #800000;
}
.song-link.visited .s-artist {
    color: #666;
}
.s-artist { font-weight: bold; color: #555; }
.s-divider { margin: 0 5px; color: #ccc; }
.s-title { color: #000; }
.artist-anchor { position: absolute; margin-top: -90px; }

/* --- Visualização da Música (Song Page) - Mantido --- */
.container { 
    padding: 10px;
    padding-top: 5px; /* Reduce top padding to remove space */
    max-width: 100%; 
}
.song-content {
    font-family: 'Courier New', Courier, monospace;
    font-size: 15px;
	font-weight: bold;
    line-height: 0.95;
    column-gap: 20px;
    column-rule: 1px solid #eee;
    widows: 1; orphans: 1;
    margin-top: 0;
    padding-top: 0;
}
.song-content.single-col-mode {
    height: auto !important;
    column-count: 1 !important;
    width: 100%;
    padding-bottom: 50px;
}
.line-wrapper {
    display: block;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 0 0;
    padding: 0;
}
.line { 
    display: block; 
    min-height: 0.7em; 
    white-space: pre; 
    margin: 0;
    padding: 0;
}

/* Remove space before first line */
.line-wrapper:first-child {
    margin-top: 0;
}

.song-content .line-wrapper:first-child .line {
    margin-top: 0;
    padding-top: 0;
}
.chord-line { color: #800000; font-weight: bold; }
.song-title-header {
    font-weight: bold; font-size: 0.9rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 50%; text-align: center;
}
.bar-actions { display: flex; gap: 5px; align-items: center; }
.col-label { font-size: 0.8rem; display: none; }

@media (min-width: 768px) {
    .song-title-header { font-size: 1.1rem; }
    .col-label { display: inline; }
    .song-content { font-size: 16px; }
}
@media (max-width: 767px) {
    .song-content { font-size: 14px; line-height: 1.1; }
}

/* JavaScript automatic column classes */
.col-info { 
    font-size: 0.8rem; 
    color: #666; 
    font-style: italic;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
}

.auto-1-col {
    height: auto !important;
    column-count: 1 !important;
    width: 100%;
    padding-bottom: 50px;
}

.auto-2-cols {
    height: calc(100vh - 60px) !important;
    column-count: 2 !important;
}

.auto-3-cols {
    height: calc(100vh - 60px) !important;
    column-count: 3 !important;
}

.auto-4-cols {
    height: calc(100vh - 60px) !important;
    column-count: 4 !important;
}

.auto-5-cols {
    height: calc(100vh - 60px) !important;
    column-count: 5 !important;
}

.auto-6-cols {
    height: calc(100vh - 60px) !important;
    column-count: 6 !important;
}

.auto-7-cols {
    height: calc(100vh - 60px) !important;
    column-count: 7 !important;
}

.auto-8-cols {
    height: calc(100vh - 60px) !important;
    column-count: 8 !important;
}

/* === CHORD SIDEBAR STYLES === */
.chord-sidebar {
    position: fixed;
    left: 0;
    top: 45px;
    width: 80px; /* #90px; */
    height: calc(100vh - 45px);
    background: #f8f8f8;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    z-index: 100;
    padding: 10px 5px;
}

.chord-sidebar-header {
    text-align: center;
    margin-bottom: 3px;
    padding-bottom: 3px;
    border-bottom: 1px solid #ddd;
}

.chord-sidebar-header h3 {
    font-size: 0.9rem;
    color: #800000;
    margin: 0;
}

.chord-list {
    display: flex;
    flex-direction: column;
    gap: 2px; /* 10px; */
}

.chord-item {
    text-align: center;
    padding: 02px 0px; /* 8px 5px; */
    background: white;
    border: 1px solid #ddd;
    border-radius: 1px; /* 4px; */
    cursor: pointer;
    transition: all 0.2s ease;
}

.chord-item:hover {
    background: #f0f0f0;
    border-color: #800000;
    transform: translateX(2px);
}

.chord-name {
    font-weight: bold;
    font-size: 0.85rem;
	line-height: 0.9;
    color: #800000;
    margin-bottom: 1px; /* 5px; */
    font-family: 'Courier New', Courier, monospace;
}

.chord-diagram-container {
    margin: 1px 0; /* 5px 0; */
}

.chord-diagram-container svg {
    display: block;
    margin: 0 auto;
}

.position-indicator {
    font-size: 0.7rem;
    color: #666;
    margin-top: 3px;
}

/* Content adjustment when sidebar is present */
.with-chord-sidebar {
    margin-left: 90px;
}

/* Hide chord sidebar on mobile */
@media (max-width: 767px) {
    .chord-sidebar {
        display: none;
    }
    .chord-sidebar.hidden {
        display: none !important;
    }
    .with-chord-sidebar {
        margin-left: 0;
    }
}

/* Toggle button for chord sidebar */
.btn-toggle-chords {
    background: #800000;
    color: white;
    border: 1px solid #800000;
}

.btn-toggle-chords:hover {
    background: #600000;
}

.btn-toggle-chords.hidden-state {
    background: #ddd;
    color: #333;
    border: 1px solid #ccc;
}

.btn-toggle-chords.hidden-state:hover {
    background: #ccc;
}

/* Hidden state for chord sidebar (desktop) */
.chord-sidebar.hidden {
    display: none;
}

/* Adjust container when sidebar is hidden */
.with-chord-sidebar.without-chord-sidebar {
    margin-left: 0;
}

/* === CHORD MODAL STYLES === */
.chord-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f8f8;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.modal-header h3 span {
    color: #800000;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: #eee;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
}

.position-option {
    text-align: center;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.position-option:hover {
    border-color: #800000;
    background: #f8f8f8;
}

.position-svg {
    margin-bottom: 8px;
}

.position-svg svg {
    display: block;
    margin: 0 auto;
}

.position-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
}

.btn-select-position {
    background: #800000;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s ease;
}

.btn-select-position:hover {
    background: #600000;
}

/* === SONG EDIT PAGE STYLES === */
html.edit-page {
    overflow: hidden;
}

html.edit-page body {
    padding-top: 0;
    overflow: hidden;
}

.error-message {
    position: fixed;
    top: 45px;
    left: 0;
    right: 0;
    background-color: #ffebee;
    color: #c62828;
    padding: 12px 20px;
    border-bottom: 2px solid #ef9a9a;
    z-index: 999;
    font-weight: bold;
    text-align: center;
}

.edit-container {
    position: fixed;
    top: 45px;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0;
    margin: 0;
}

.edit-container form {
    height: 100%;
    width: 100%;
}

.edit-textarea {
    width: 100%;
    height: 100%;
    padding: 15px;
    border: none;
    resize: none;
    font-family: 'Courier New', Courier, monospace;
    font-size: 15px;
    line-height: 1.4;
    background-color: #fdfdfd;
    outline: none;
    white-space: pre;
    overflow: auto;
}

.btn-save {
    background-color: #4caf50;
    color: white;
    border-color: #4caf50;
}

.btn-save:hover {
    background-color: #45a049;
}