/* ======================= KEY DROPDOWN ======================= */
.dropdown {
    position: relative;
    min-width: 60px;
    background-color: var(--surface);
    border-radius: 8px;
    height: 35px;
    align-items: center;
    display: flex;
    justify-content: center;
    margin-left: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.dropdown:hover {
    border-color: var(--accent);
}

.dropdown * {
    box-sizing: border-box;
}

.dropdown .selected {
    background-color: transparent;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-sans);
    font-weight: 600;
    cursor: pointer;
    padding-right: 5px;
    transition: color 0.2s ease;
}

.dropdown .select {
    width: 100%;
    justify-content: center;
    display: flex;
    align-items: center;
    cursor: pointer;
    background-color: transparent;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-sans);
    font-weight: 600;
    transition: all 0.2s ease;
    user-select: none;
    padding: 0 8px;
}

.dropdown .select:hover {
    transform: scale(1.02);
}

.dropdown .caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-secondary);
    transition: all 0.2s ease;
    margin-left: 6px;
}

.dropdown.open .caret {
    transform: rotate(180deg);
}

.dropdown .menu {
    list-style: none;
    padding: 8px 0;
    background-color: var(--surface-elevated);
    border: 1px solid var(--border); /* Keep border */
    box-shadow: var(--shadow-md);
    border-radius: 8px;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    margin-top: 4px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    max-height: 500px;
    overflow-y: auto;
}

.dropdown.open .menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.dropdown .menu li {
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-weight: 500;
}

.dropdown .menu li:hover {
    background-color: var(--surface);
    color: var(--accent);
}

.dropdown .menu li.active {
    background-color: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
    font-weight: 600;
}


/* ======================= KEY + MODE ROW ======================= */
.key-mode-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.key-mode-row .dropdown {
    margin-left: 0;
    flex: 1;
    min-width: 0;
    width: 0; /* lets flex control width instead of content */
}


/* ======================= SETTINGS / FONT DROPDOWNS ======================= */
.settings-dropdown {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    height: 38px;
    justify-content: flex-start;
}

.settings-dropdown .select {
    justify-content: space-between;
    padding: 0 12px;
}

.settings-dropdown .menu {
    width: 100%;
    left: 0;
}


/* ======================= TIME SIGNATURE DROPDOWN ======================= */
.timesig-dropdown {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    height: 38px;
    justify-content: center;
}

.timesig-dropdown .select {
    justify-content: center;
    padding: 0 8px;
}

.timesig-dropdown .menu {
    width: 100%;
    min-width: 90px;
}
