/* =========================================================
   SIDEBAR FOOTER — Layout switch + collapse toggle
   Pairs with sidebar-controller-v2.0.js
   ========================================================= */

/* Footer wrapper: sits above the main page footer */
.cs-sidebar-footer {
    margin-top: auto;                 /* push to bottom if sidebar is flex */
    padding: 14px 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: inherit;
}

/* Section row */
.cs-footer-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cs-footer-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    user-select: none;
}

/* Toggle group (full / boxed) */
.cs-toggle-group {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

/* Individual mode buttons */
.cs-mode-btn {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1;
    width: 30px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.cs-mode-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.cs-mode-btn:focus-visible {
    outline: 2px solid #c9a24a;       /* gold focus ring — adjust to your accent */
    outline-offset: 2px;
}

.cs-mode-btn.active,
.cs-mode-btn[aria-pressed="true"] {
    background: #c9a24a;              /* gold accent */
    color: #111;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.cs-mode-btn.active:hover {
    background: #d8b45c;
    color: #000;
}

/* Divider between layout switch and collapse toggle */
.cs-footer-divider {
    height: 1px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    margin: 2px 0;
}

/* Collapse / expand toggle (footer variant) */
.cs-sidebar-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.cs-sidebar-toggle:hover {
    background: rgba(201, 162, 74, 0.15);   /* faint gold hover */
    border-color: rgba(201, 162, 74, 0.35);
    color: #fff;
}

.cs-sidebar-toggle:focus-visible {
    outline: 2px solid #c9a24a;
    outline-offset: 2px;
}

/* Icon + label inside the toggle */
.cs-toggle-icon {
    display: inline-block;
    transition: transform 0.25s ease;
    font-size: 11px;
    line-height: 1;
}

.cs-toggle-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* =========================================================
   COLLAPSED STATE — hide labels, center icons, shrink
   (triggered by .is-collapsed on #csSidebar by the controller)
   ========================================================= */

/* Footer behavior when collapsed */
#csSidebar.is-collapsed .cs-sidebar-footer {
    padding-left: 10px;
    padding-right: 10px;
    align-items: center;
}

#csSidebar.is-collapsed .cs-footer-section {
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}

#csSidebar.is-collapsed .cs-footer-label {
    display: none;
}

#csSidebar.is-collapsed .cs-toggle-group {
    flex-direction: column;
    padding: 2px;
    gap: 2px;
}

#csSidebar.is-collapsed .cs-toggle-label {
    display: none;              /* hide "Collapse"/"Expand" word */
}

#csSidebar.is-collapsed .cs-sidebar-toggle {
    padding: 8px 0;
    width: 34px;
    gap: 0;
}

#csSidebar.is-collapsed .cs-footer-divider {
    width: 24px;
}

/* Flip arrow direction when collapsed is handled in JS (icon.textContent) —
   but we also smooth it here in case of any CSS-only fallback */
#csSidebar.is-collapsed .cs-toggle-icon {
    transform: rotate(180deg);
}

/* =========================================================
   MOBILE — hide the desktop collapse toggle button
   ========================================================= */
@media (max-width: 1024px) {
    .cs-desktop-only,
    .cs-sidebar-toggle.cs-desktop-only {
        display: none !important;
    }
}

/* =========================================================
   BOXED MODE — small visual cue when layout button is active
   (the controller toggles .boxed on .cs-dashboard; adjust
    these two rules if your boxed class lives elsewhere)
   ========================================================= */
.cs-dashboard.boxed {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* =========================================================
   Accessibility: reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    .cs-mode-btn,
    .cs-sidebar-toggle,
    .cs-toggle-icon {
        transition: none;
    }
}