 /* ============================================================
  TOOLBAR STYLING
   ============================================================ */
.toolbar-btn {
    background: var(--surface-hover);
    border: none;
    padding: 8px 14px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 15px;
    border-radius: 8px;
    transition: background 0.25s ease, transform 0.2s ease, color 0.25s ease;
}

.toolbar-btn:hover {
    background: var(--surface-elevated);
    transform: translateY(-2px);
}

 .toolbar-progress {
     font-size: 15px;
     opacity: 0.85;
     margin: 0 8px;
 }

 #flashToolbarBar {
     box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
 }

 /* Segmented mode buttons */
.modeBtn {
    background: var(--surface-hover);
    border: 1px solid transparent;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1;
    box-sizing: border-box;
    transform: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.modeBtn:hover {
    background: var(--surface-elevated);
}

.modeBtn.active {
    background: color-mix(in srgb, var(--accent-primary), transparent 35%) !important;
    border: 1px solid color-mix(in srgb, var(--accent-primary), transparent 10%);
    color: white;
}

.modeBtn:active,
.modeBtn:focus,
.modeBtn:focus-visible,
.modeBtn.active:focus,
.modeBtn.active:focus-visible {
    transform: none;
    outline: none;
}

 #toolbarInner {
     max-width: var(--card-width);
     width: 100%;
 }

 /* ============================================================
   TOOLBAR — LEFT SECTION
   ============================================================ */

 #sidePanelToggle {
     padding: 0.5rem;
     margin-left: 10px;
     font-size: 1.25rem;
 }

#toolbarTitle {
    margin-left: 20px;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0.9;
    max-width: min(42vw, 520px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#toolbarTitle:empty {
    display: none;
    margin-left: 0;
}

@media (max-width: 900px) {
    #flashToolbarBar.notes-toolbar-active #toolbarTitle {
        display: none !important;
    }
}

/* Force nav buttons to follow theme even with inline styles */
#tbPrev,
#tbFlip,
#tbNext {
    background: var(--surface-hover) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--surface-border) !important;
    font-weight: 600;
    min-width: 40px;
}

#tbPrev:hover,
#tbFlip:hover,
#tbNext:hover {
    background: var(--surface-elevated) !important;
}

 /* ============================================================
   TOOLBAR — DROPDOWNS
   ============================================================ */

#difficultyBtn {
    margin-left: 10px;
    padding: 0.5rem 0.65rem;
    background: var(--surface-hover) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--surface-border) !important;
}

#difficultyBtn:hover {
    background: var(--surface-elevated) !important;
}

#difficultyMenu {
    display: none;
    position: absolute;
    top: 45px;
    background: var(--surface-muted);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    min-width: 150px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
    z-index: 9999;
     padding: 5px 0;
 }

 #tbMoreMenu {
     z-index: 9999;
 }

#flashToolbarBar .toolbar-btn,
#flashToolbarBar .modeBtn,
#flashToolbarBar #difficultyBtn,
#flashToolbarBar #instanceBtn,
#flashToolbarBar #tbMore,
#flashToolbarBar #tbPrev,
#flashToolbarBar #tbFlip,
#flashToolbarBar #tbNext {
    height: var(--toolbar-control-height);
    min-height: var(--toolbar-control-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
}

#flashToolbarBar .toolbar-btn {
    padding: 0 12px;
}

#flashToolbarBar .modeBtn {
    padding: 0 10px;
}

#flashToolbarBar #difficultyBtn,
#flashToolbarBar #instanceBtn,
#flashToolbarBar #tbMore {
    padding: 0 10px !important;
}

#flashToolbarBar #tbMore {
    min-width: 40px;
    font-size: 18px;
    line-height: 1;
}

#flashToolbarBar #difficultyBtn,
#flashToolbarBar #instanceBtn {
    border: 1px solid var(--surface-border) !important;
    transform: none !important;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#flashToolbarBar #difficultyBtn:hover,
#flashToolbarBar #instanceBtn:hover,
#flashToolbarBar #difficultyBtn:active,
#flashToolbarBar #instanceBtn:active,
#flashToolbarBar #difficultyBtn:focus-visible,
#flashToolbarBar #instanceBtn:focus-visible,
#flashToolbarBar #difficultyBtn.active,
#flashToolbarBar #instanceBtn.active {
    transform: none !important;
}
