/* javascript/css/layout.css`

Contém: Estrutura macro (Top Bar, Main, Neck Container, Bottom Controls) e Grid básico.*/

/* --- TOP BAR --- */
.top-bar {
    background: transparent;
    padding: 0 0 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    z-index: 20;
    height: auto;
    position: relative;
    width: 100%;
    max-width: 1000px;
}

.progression-bar {
    display: flex;
    gap: 15px;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    /* 60px na direita reserva espaço para o botão de som */
    padding: 30px 60px 30px 30px;
    max-width: 80%;
    scrollbar-width: thin;
    scrollbar-color: #444 #222;
}

.progression-bar::-webkit-scrollbar {
    height: 6px;
}

.progression-bar::-webkit-scrollbar-track {
    background: #222;
    border-radius: 3px;
}

.progression-bar::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.prog-chord {
    background: #222;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 5px 12px;
    color: #888;
    font-weight: 700;
    font-size: 1rem;
    min-width: 40px;
    text-align: center;
    transition: all 0.2s;
}

.prog-chord.active {
    background: var(--color-chord-fill);
    color: #111;
    border-color: var(--color-chord-fill);
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    z-index: 5;
}

.prog-chord.next {
    border-color: var(--color-next-fill);
    color: #ccc;
}

.sound-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 1px solid #444;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- MAIN AREA --- */
main {
    flex: 0 0 auto;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    width: 100%;
}

.scroll-viewport {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    align-items: center;
    padding: 0;
}

.neck-container {
    margin: 0 auto;
    padding: 20px 40px;
    min-width: min-content;

    /* Torna este container a referência para a legenda */
    position: relative;
}

.fretboard {
    display: grid;
    grid-template-rows: repeat(6, var(--fret-height));
    grid-template-columns: 35px repeat(13, var(--fret-width));
    background: #161616;
    border: 2px solid #333;
    border-top: 5px solid #444;
    border-radius: 6px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    user-select: none;
    position: relative;
    transition: grid-template-rows 0.1s, grid-template-columns 0.1s;
}

.fretboard.with-numbers {
    grid-template-rows: repeat(6, var(--fret-height)) 30px;
}

.string-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #555;
    font-size: 0.75rem;
    background: #111;
    border-right: 3px solid #444;
    z-index: 5;
}

.fret {
    position: relative;
    border-right: 2px solid #3a3a3a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fret::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: var(--string-h, 1px);
    background: #555;
    transform: translateY(-50%);
    z-index: 1;
}

/* --- BOTTOM CONTROLS CONTAINER --- */
.bottom-controls {
    background: transparent;
    padding: 20px 0 0 0;
    border-top: none;
    flex-shrink: 0;
    z-index: 20;
    position: relative;
    box-shadow: none;
    width: 100%;
    max-width: 1000px;
}