/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR OVERLAY
═══════════════════════════════════════════════════════════════════════════ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    overscroll-behavior: none;
}

.sidebar-overlay.is-visible {
    opacity: 1;
    pointer-events: all;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR DRAWER — left-side, icon nav rail + content column
═══════════════════════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(400px, 92vw);
    z-index: 210;
    display: flex;
    flex-direction: row;   /* icon rail | content */
    background: linear-gradient(175deg, #1A0C04 0%, #110804 40%, #0A0603 100%);
    border-right: 1px solid rgba(197, 160, 89, 0.28);
    box-shadow: 12px 0 48px rgba(0, 0, 0, 0.80);
    transform: translateX(-100%);
    transition: transform 0.30s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar.is-open {
    transform: translateX(0);
}

/* ── Vertical icon nav rail ──────────────────────────────────────────────── */
.sidebar-nav {
    width: 68px; /* Slightly wider for better icon breathing room */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0 0;
    background: rgba(0, 0, 0, 0.35);
    border-right: 1px solid rgba(197, 160, 89, 0.12);
}

.sidebar-nav-top {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; /* Uniform spacing */
}

.sidebar-nav-top::-webkit-scrollbar { display: none; }

.sidebar-nav-brand {
    width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Serif', serif;
    font-size: 1.0rem;
    letter-spacing: 2px;
    color: var(--gold);
    opacity: 0.72;
    margin-bottom: 10px;
    flex-shrink: 0;
    user-select: none;
    line-height: 1.3;
}

/* Icon nav buttons — prefixed sb- to avoid Bootstrap .nav-* conflicts */
.sb-btn {
    width: 54px;
    height: 54px;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: rgba(240, 237, 232, 0.45);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

/* Golden Shimmer Active State — No hard lines */
.sb-btn.active {
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.12) 0%, rgba(197, 160, 89, 0.04) 100%);
    color: var(--gold);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(197, 160, 89, 0.08);
    transform: scale(1.04);
}

.sb-btn.active svg {
    color: var(--gold);
    filter: drop-shadow(0 0 5px rgba(197, 160, 89, 0.5));
}

.sb-btn-label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.sb-btn.active .sb-btn-label {
    opacity: 1;
    text-shadow: 0 0 8px rgba(197, 160, 89, 0.3);
}

.sb-btn:hover:not(.active) {
    color: rgba(240, 237, 232, 0.8);
    background: rgba(255, 255, 255, 0.03);
}

/* Spacer pushes the bottom foot to the end of the rail */
.sidebar-nav-spacer { flex: 1; }

/* Bottom foot — mirrors the sidebar-footer height and border so both ends align */
.sidebar-nav-foot {
    width: 100%;
    height: 54px;
    border-top: 1px solid rgba(197, 160, 89, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Close button inside the foot */
.nav-close-btn {
    width: 42px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(197, 160, 89, 0.04);
    border: 1px solid rgba(197, 160, 89, 0.14);
    border-radius: 8px;
    color: rgba(240, 237, 232, 0.40);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.nav-close-btn:hover {
    background: rgba(197, 160, 89, 0.10);
    border-color: rgba(197, 160, 89, 0.38);
    color: var(--gold);
}

/* ── Content area ────────────────────────────────────────────────────────── */
.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* ── Panels — always display:flex, stacked via position:absolute.
   This lets opacity/transform transitions work (display:none kills them). */
.sidebar-panel {
    flex: 1;
    display: none;
    flex-direction: column;
    padding: 0; /* Let inner containers span full width */
    overflow-y: auto;
}

.sidebar-panel.active {
    display: flex;
}

.sidebar-panel-header {
    padding: 24px 16px 12px;
    border-bottom: 1px solid rgba(197, 160, 89, 0.16);
    flex-shrink: 0;
}

.sidebar-panel-title {
    font-family: 'Noto Serif', serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0;
    white-space: nowrap;
}

.sidebar-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px; /* Uniform element gap */
    scrollbar-width: thin;
    scrollbar-color: rgba(197, 160, 89, 0.30) transparent;
}

.sidebar-panel-body::-webkit-scrollbar       { width: 4px; }
.sidebar-panel-body::-webkit-scrollbar-track { background: transparent; }
.sidebar-panel-body::-webkit-scrollbar-thumb { background: rgba(197, 160, 89, 0.30); border-radius: 4px; }

/* ── Learn panel coaching toggle ────────────────────────────────────────── */
.learn-coach-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px 16px;
    border-radius: 10px;
    border: 1px solid rgba(197, 160, 89, 0.16);
    background: rgba(197, 160, 89, 0.06);
}

.learn-coach-top {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.learn-coach-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid rgba(197, 160, 89, 0.24);
    background: rgba(197, 160, 89, 0.08);
    color: var(--gold);
}

.learn-coach-copy {
    flex: 1;
    min-width: 0;
}

.learn-coach-copy h3 {
    margin: 0 0 3px;
    font-family: 'Noto Serif', serif;
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.4px;
}

.learn-coach-copy p,
.learn-coach-status {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.70rem;
    line-height: 1.35;
    color: rgba(240, 237, 232, 0.56);
}

.learn-coach-status {
    min-height: calc(0.70rem * 1.35 * 2);
    color: rgba(197, 160, 89, 0.82);
}

/* Keep Spoonfeeder toggle visually identical to Sound panel toggles */
.learn-coach-panel .toggle-switch {
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    cursor: pointer;
}

.learn-coach-panel .toggle-track {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(197, 160, 89, 0.25);
    border-radius: 4px;
    transition: background 0.22s, border-color 0.22s;
}

.learn-coach-panel .toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: rgba(240, 237, 232, 0.50);
    box-shadow: 0 1px 4px rgba(0,0,0,0.45);
    transition: transform 0.22s cubic-bezier(0.4,0,0.2,1), background 0.22s;
}

.learn-coach-panel .toggle-switch input:checked + .toggle-track {
    background: rgba(197, 160, 89, 0.35);
    border-color: var(--gold);
}

.learn-coach-panel .toggle-switch input:checked + .toggle-track::after {
    transform: translateX(18px);
    background: var(--gold);
}


/* .learn-toggle replaced by .toggle-switch in controls.css */

/* ── Sidebar Footer ──────────────────────────────────────────────────────── */
.sidebar-footer {
    height: 54px;              /* matches sidebar-nav-foot */
    padding: 0 14px;
    display: flex;
    align-items: center;       /* vertically center the exit button */
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.45) 100%
    );
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.sb-btn-exit-main {
    width: 100%;
    height: 34px; /* Explicit — matches close button height */
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(224, 112, 112, 0.02);
    border: 1px solid rgba(224, 112, 112, 0.14);
    border-radius: 8px;
    color: rgba(255, 128, 128, 0.7);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.sb-btn-exit-main:hover {
    background: rgba(224, 112, 112, 0.09);
    border-color: rgba(224, 112, 112, 0.32);
    color: #ff8888;
    box-shadow: 0 2px 12px rgba(224, 112, 112, 0.12);
}

.sb-btn-exit-main:active {
    transform: scale(0.98);
}

.sb-btn-exit-main svg {
    opacity: 0.85;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
