/* ============================================================
   FLOATING OVERLAY SIDEBAR
   Replaces the fixed col-xl-4 sidebar with a slide-in overlay
   ============================================================ */

/* ── Pull sidebar column completely out of the flex row ────── */
/* Use position:absolute so it takes zero space in the flex flow.
   Must NOT be display:none — that hides position:fixed children too. */
.col-xl-4:has(#inner-pages-sidebar) {
    display: block !important;    /* never allow display:none */
    position: absolute !important; /* out of flex flow → row treats it as if absent */
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    overflow: visible !important;  /* fixed children escape the zero-size box */
}

/* ── Content column takes the full row width ─────────────── */
.col-xl-8.right_module,
.col-xl-11.content-expand {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* ── Floating toggle tab (left edge of screen) ────────────── */
.sidebar-float-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1040;
    background: #00568f;
    color: #fff;
    border: none;
    padding: 18px 10px;
    border-radius: 0 14px 14px 0;
    cursor: pointer;
    box-shadow: 3px 0 18px rgba(0, 86, 143, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: Montserrat, sans-serif;
    transition: background 0.25s, padding-left 0.25s, box-shadow 0.25s;
    outline: none;
    border: 3px solid #FCB912;
}

.sidebar-float-btn:hover,
.sidebar-float-btn:focus {
    background: #004070;
    padding-left: 15px;
    box-shadow: 4px 0 22px rgba(0, 64, 112, 0.5);
    color: #fff;
}

.sidebar-float-btn .sfb-icon {
    font-size: 20px;
    line-height: 1;
}

.sidebar-float-btn .sfb-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fcb912;
    display: block;
}

.sidebar-float-btn .sfb-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

/* ── Backdrop ─────────────────────────────────────────────── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1049;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: fadeInBackdrop 0.25s ease;
}

.sidebar-backdrop.show {
    display: block;
}

@keyframes fadeInBackdrop {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Overlay panel ────────────────────────────────────────── */
#inner-pages-sidebar.sidebar-panel {
    /* reset styles from style.css */
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding: 0 !important;

    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    box-shadow: 6px 0 40px rgba(0, 0, 0, 0.18);
    z-index: 1050;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#inner-pages-sidebar.sidebar-panel.sidebar-open {
    left: 0;
}

/* ── Panel header ─────────────────────────────────────────── */
.sidebar-panel-header {
    background: linear-gradient(135deg, #00568f 0%, #003d6b 100%);
    color: #fff;
    padding: 0 20px;           /* vertical centering done by height + flex */
    height: 64px;              /* fixed height ensures perfect centering */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-panel-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1;
}

.sidebar-panel-title .panel-title-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    /* flex centering of the icon inside */
    display: flex;
    align-items: center;
    justify-content: center;
    /* reset any inherited button padding/margin */
    padding: 0;
    margin: 0;
    line-height: 1;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
    outline: none;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ensure FA icon inside button has no extra spacing */
.sidebar-close-btn i {
    display: block;
    line-height: 1;
}

/* ── Current page label (mobile-style strip) ──────────────── */
.sidebar-current-page {
    background: #f0f7ff;
    border-bottom: 1px solid #dce8f4;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #00568f;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ── Nav list ─────────────────────────────────────────────── */
.sidebar-panel-nav {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    overflow-y: auto;
    flex: 1;
}

.sidebar-panel-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-panel-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-panel-nav::-webkit-scrollbar-thumb {
    background: #c5d8e8;
    border-radius: 4px;
}

/* ── Nav item ─────────────────────────────────────────────── */
.sidebar-panel-nav .sp-nav-item {
    margin: 2px 12px;
    border-radius: 10px;
    overflow: hidden;
}

.sidebar-panel-nav .sp-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: #4a4a4a;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
    position: relative;
}

.sidebar-panel-nav .sp-nav-link:hover {
    background: #f0f7ff;
    color: #00568f;
    text-decoration: none;
}

.sidebar-panel-nav .sp-nav-link.active {
    background: #e6f0fa;
    color: #00568f;
    font-weight: 700;
}

.sidebar-panel-nav .sp-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: #fcb912;
    border-radius: 0 4px 4px 0;
}

.sidebar-panel-nav .sp-nav-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.75;
    transition: opacity 0.2s;
}

.sidebar-panel-nav .sp-nav-link:hover .sp-nav-icon,
.sidebar-panel-nav .sp-nav-link.active .sp-nav-icon {
    opacity: 1;
}

.sidebar-panel-nav .sp-nav-caption {
    flex: 1;
    line-height: 1.3;
}

/* ── Sub-menu ─────────────────────────────────────────────── */
.sidebar-panel-nav .sp-sub-menu {
    list-style: none;
    padding: 4px 0 4px 52px;
    margin: 0;
    background: #f8fafd;
    border-radius: 0 0 10px 10px;
}

.sidebar-panel-nav .sp-sub-menu li {
    margin: 2px 0;
}

.sidebar-panel-nav .sp-sub-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 6px;
    color: #5a5a5a;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.sidebar-panel-nav .sp-sub-menu a:hover {
    background: #e6f0fa;
    color: #00568f;
    text-decoration: none;
}

.sidebar-panel-nav .sp-sub-menu a.active,
.sidebar-panel-nav .sp-sub-menu a[style*="font-weight: 600"] {
    color: #00568f !important;
    font-weight: 700 !important;
    background: #e6f0fa;
}

.sidebar-panel-nav .sp-sub-menu .sp-sub-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.8;
}

/* ── Divider inside nav ───────────────────────────────────── */
.sidebar-panel-divider {
    height: 1px;
    background: #eef2f7;
    margin: 8px 20px;
}

/* ── Footer strip (optional branding) ────────────────────── */
.sidebar-panel-footer {
    border-top: 1px solid #eef2f7;
    padding: 14px 20px;
    font-size: 11px;
    color: #999;
    text-align: center;
    flex-shrink: 0;
    background: #fafafa;
}

/* ── Tooltip badge on nav item ────────────────────────────── */
.sp-info-badge {
    width: 16px;
    height: 16px;
    background: #dce8f4;
    color: #00568f;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: help;
}

/* ── When sidebar is open: shift float button right ──────── */
body.sidebar-is-open .sidebar-float-btn {
    left: 300px;
    border-radius: 0 14px 14px 0;
    background: #003d6b;
}

/* ── Hide floating button on mobile (has its own menu) ───── */
@media (max-width: 1199px) {
    .sidebar-float-btn {
        display: none !important;
    }
}
