/* javascript/css/legend.css
Contém: Legenda flutuante no canto superior direito do braço da guitarra. */

/* --- LEGEND WRAPPER (NOVA ESTRUTURA) --- */
/* Posiciona o conjunto (botão + popup) no canto superior direito do braço */
.legend-wrapper {
    position: absolute;
    
    /* CORREÇÃO AQUI: */
    top: 5px;   /* Era -10px. Mude para 5px positivo para descer o botão */
    right: 20px; /* Ajuste fino para não colar na borda direita */
    
    z-index: 50;
}

/* --- BOTÃO (i) --- */
.legend-toggle {
    background: rgba(50, 50, 50, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 28px;
    /* Levemente menor para ser discreto */
    height: 28px;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: bold;
    font-family: serif;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.legend-toggle:hover {
    transform: scale(1.1);
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

/* --- CONTEÚDO DA LEGENDA (POPUP) --- */
.legend-content {
    position: absolute;
    top: 35px;
    /* Abre logo abaixo do botão 'i' */
    right: 0;
    /* Alinhado à direita do botão */

    background: rgba(15, 15, 15, 0.98);
    /* Fundo bem escuro */
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.9);
    z-index: 100;

    /* Animação */
    opacity: 1;
    transform: translateY(0) scale(1);
    transform-origin: top right;
    transition: all 0.2s ease-out;
    pointer-events: auto;
}

.legend-content.collapsed {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
    pointer-events: none;
}

/* Itens da legenda */
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    /* Fonte compacta */
    color: #ddd;
    font-weight: 500;
    white-space: nowrap;
    /* Não quebrar linha */
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Cores das bolinhas */
.legend-item .dot.in-root {
    background: var(--color-root-fill);
}

.legend-item .dot.in-third {
    background: var(--color-third-fill);
}

.legend-item .dot.in-fifth {
    background: var(--color-fifth-fill);
}

.legend-item .dot.in-extension {
    background: var(--color-ext-fill);
}

.legend-item .dot.in-scale {
    background: transparent;
    border: 2px solid var(--color-scale-border);
}