/* ======================= TOP NAVIGATION ======================= */
.top-navigation-bar {
    height: var(--nav-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    padding-left: 12px;
    position: relative;
    z-index: 100;

    /* Mobile: allow horizontal scroll instead of squishing */
    /* overflow-x: auto; */
    overflow-y: visible;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.top-navigation-bar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.navigation-bar-left,
.navigation-bar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0; /* prevent either side from shrinking */
}

.icon-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
    flex-shrink: 0; /* buttons never shrink */
    text-decoration: none;
}

.icon-btn:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn.active {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    margin: 0 8px;
}


/* ======================= OVERFLOW / MOBILE MENU ======================= */

#overflow-menu-btn {
    display: none;
    flex-shrink: 0;
}

.overflow-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 12px;
    width: 200px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 10px 0;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

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

.overflow-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    padding: 6px 14px 2px;
}

.overflow-row {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;
}

.overflow-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

/* Drag handle: hidden on desktop, shown in mobile bottom sheet */
.overflow-drag-handle {
    display: none;
}

/* Button labels: hidden on desktop, shown in mobile bottom sheet */
.overflow-btn-label {
    display: none;
}

/* Backdrop: hidden everywhere — mobile shows it via responsive.css */
.overflow-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 195;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.overflow-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* ======================= SIDEBAR TOGGLE + LOGOUT ======================= */

/* Settings logout section: hidden on desktop, visible via responsive.css on tablet/mobile */
.settings-logout-section {
    display: none;
}

/* ======================= SIDEBAR TOGGLE + LOGOUT ======================= */

/* Collapsed state: hide both sidebars when toggle is active */
.main-container.sidebars-hidden .left-small-sidebar,
.main-container.sidebars-hidden .main-sidebar {
    display: none;
}

/* Sidebar toggle button: plain icon style, NO active/green highlight.
   It's a utility button, not a tab — it shouldn't look selected. */
#sidebar-toggle-btn {
    color: var(--text-secondary);
    background: transparent;
}

#sidebar-toggle-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* ======================= EDIT CONTEXT MENU ======================= */

.edit-context-menu {
    position: fixed;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 300;
    min-width: 190px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
}

.edit-context-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.edit-ctx-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 10px;
    background: none;
    border: none;
    border-radius: 7px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    cursor: pointer;
    text-align: left;
}

.edit-ctx-option:hover {
    background: var(--surface-hover);
}

.edit-ctx-option i {
    width: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.edit-ctx-disabled {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
}

.ctx-divider {
    height: 1px;
    margin: 3px 6px;
    background: color-mix(in srgb, var(--border) 40%, transparent);
}

/* ── Context menu section label ──────────────────────────────── */

.ctx-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-tertiary);
    padding: 4px 10px 2px;
}


/* ======================= TONALITY PANEL ======================= */

.tonality-panel-wrapper {
    position: relative;
    margin-left: 8px;
}

.tonality-panel-btn {
    min-width: 60px;
    height: 35px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-sans);
    font-weight: 600;
    cursor: pointer;
    padding: 0 12px;
    transition: border-color 0.2s ease;
    white-space: nowrap;
}

.tonality-panel-btn:hover {
    border-color: var(--accent);
}

.tonality-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 14px;
    z-index: 200;
    min-width: 252px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.tonality-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tonality-panel-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.tonality-panel-section-label + .capo-row {
    margin-top: 0;
}

.tonality-keys-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin-bottom: 14px;
}

.tonality-key-btn {
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    padding: 7px 2px;
    text-align: center;
    transition: background 0.12s ease, color 0.12s ease;
}

.tonality-key-btn:hover {
    background: var(--surface-hover);
    color: var(--accent);
}

.tonality-key-btn.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
}

.capo-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.capo-stepper {
    width: 34px;
    height: 34px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    flex-shrink: 0;
    font-family: var(--font-sans);
}

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

.capo-stepper:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.capo-stepper:disabled:hover {
    border-color: var(--border);
    color: var(--text-primary);
}


.capo-input {
    flex: 1;
    min-width: 0;
    height: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-sans);
    font-weight: 500;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.capo-input::-webkit-outer-spin-button,
.capo-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.capo-input:focus {
    border-color: var(--accent);
}

/* ======================= SUGGESTION MODAL ======================= */

.suggestion-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.suggestion-modal {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.suggestion-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.suggestion-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.suggestion-modal-song {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.suggestion-modal-note {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.55;
    margin: 0;
}

.suggestion-textarea {
    width: 100%;
    min-height: 120px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    padding: 10px 12px;
    resize: vertical;
    outline: none;
    line-height: 1.5;
}

.suggestion-textarea:focus {
    border-color: var(--accent);
}

.suggestion-counter {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: right;
}

.suggestion-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.suggestion-btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: background 0.15s ease;
}

.suggestion-btn-cancel {
    background: var(--surface-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.suggestion-btn-cancel:hover {
    background: var(--border);
}

.suggestion-btn-send {
    background: var(--accent);
    color: #fff;
}

.suggestion-btn-send:hover {
    background: var(--accent-dark);
}

.suggestion-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}