/**
 * ============================================================================
 * File:        /html/assets/css/wizard.css
 * Project:     Neural Core 5 - Wizard Admin Portal
 * Version:     1.0.0
 *
 * Description: Custom styles for Wizard Admin Portal.
 *              Bootstrap 5.3 controls layout/styles first; keep this minimal.
 *
 * Created:     2025-10-10
 * Updated:     2025-12-12
 *
 * Copyright:   Copyright 2025 © by Mister Wizard
 * ============================================================================
 */

/* Bootstrap-first: only the hero height behavior needs custom CSS. */
.wizard-hero-image {
    min-height: 220px;   /* Mobile header height */
    height: 34vh;        /* Responsive header height */
    background-size: cover;
    background-position: center;
}

@media (min-width: 992px) {
    .wizard-hero-image {
        min-height: 100vh; /* Desktop: full-height right panel */
        height: 100%;
    }
}

/* ---------------------------------------------------------------------
   Dashboard layout styles
   --------------------------------------------------------------------- */

:root {
    --app-notifybar-h: 0px; /* set dynamically by wizard.js when notify bar exists */
}

/* IMPORTANT: no bottom border on the notify bar wrapper (prevents the “cap”) */
.app-notifybar { border-bottom: 0; }

.app-topbar { border-bottom: 1px solid var(--bs-border-color); }
.app-mobilebar { border-bottom: 1px solid var(--bs-border-color); }
.app-pagehead { border-bottom: 1px solid var(--bs-border-color); }
.app-footer { border-top: 1px solid var(--bs-border-color); }

.app-sidebar-left { border-right: 1px solid var(--bs-border-color); }
.app-sidebar-right { border-left: 1px solid var(--bs-border-color); }

.everything-else {
    height: calc(100vh - 100px - var(--app-notifybar-h)); /* topbar 50 + mobilebar 50 + notifybar */
    position: relative;
}
@media (min-width: 992px) {
    .everything-else { height: calc(100vh - 50px - var(--app-notifybar-h)); }
}

/* Console pages do NOT render the mobilebar; avoid top “cap” on mobile */
.everything-else.console-everything-else {
    height: calc(100vh - 50px - var(--app-notifybar-h));
}

.center-shell { position: relative; }

/* ---------------------------------------------------------------------
   Notify bar (full-width items, subtle background, colored border)
   --------------------------------------------------------------------- */

#notifyBar .notify-stack {
    display: flex;
    flex-direction: column;
}

.notify-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;

    padding: .75rem 1rem;

    border-top: 1px solid rgba(255,255,255,.06);
    border-left: 4px solid var(--notify-border);

    background: var(--notify-bg);
    color: var(--bs-body-color);
}

.notify-item:first-child {
    border-top: 0;
}

.notify-item-content {
    min-width: 0;
    flex: 1 1 auto;
}

.notify-item-title {
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
}

.notify-item-text {
    margin-top: .25rem;
    opacity: .9;
    font-size: .95rem;
    line-height: 1.25;
}

.notify-item-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: 900;
    line-height: 1;
    padding: 0;
    margin: .1rem 0 0 0;
    cursor: pointer;
    opacity: .9;
}
.notify-item-close:hover { opacity: 1; }

.notify-item.is-hiding {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 180ms ease, transform 180ms ease;
}

/* Theme variants using Bootstrap rgb vars */
.notify-item--success {
    --notify-border: rgb(var(--bs-success-rgb));
    --notify-bg: rgba(var(--bs-success-rgb), .12);
}
.notify-item--info {
    --notify-border: rgb(var(--bs-info-rgb));
    --notify-bg: rgba(var(--bs-info-rgb), .12);
}
.notify-item--warning {
    --notify-border: rgb(var(--bs-warning-rgb));
    --notify-bg: rgba(var(--bs-warning-rgb), .14);
}
.notify-item--danger {
    --notify-border: rgb(var(--bs-danger-rgb));
    --notify-bg: rgba(var(--bs-danger-rgb), .12);
}

/* ---------------------------------------------------------------------
   Sidebar + mobile overlays
   --------------------------------------------------------------------- */

.sidebar-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 2.5rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bs-border-color);
    background: rgba(0, 0, 0, 0.15);
    color: var(--bs-body-color);
    line-height: 1;
    user-select: none;
}
.sidebar-toggle:focus {
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}
.sidebar-toggle-left {
    left: 0;
    border-left: 0;
    border-radius: 0 .6rem .6rem 0;
}
.sidebar-toggle-right {
    right: 0;
    border-right: 0;
    border-radius: .6rem 0 0 .6rem;
}

.app-pagehead { position: relative; }
.page-head-title { font-weight: 700; letter-spacing: 0.02em; }
.page-head-title-shift { padding-left: 30px; }
.breadcrumb-shift { padding-right: 30px; }

.mobile-split-btn {
    border: 1px solid var(--bs-border-color) !important;
    border-radius: 0 !important;
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
    background: var(--bs-body-bg);
    padding: 0;
}
.mobile-overlay.show { display: block; }
.mobile-overlay-panel {
    height: 100%;
    background: var(--bs-body-bg);
}
.mobile-overlay-close {
    border: 0;
    background: transparent;
    color: var(--bs-body-color);
    font-weight: 700;
    line-height: 1;
    padding: .25rem .5rem;
}

/* Sidebar nav: make it “notification style” */
.sidebar-nav.sidebar-nav-flush {
    padding: 0;
}

.sidebar-nav.sidebar-nav-flush .nav {
    gap: 0;
}

.sidebar-nav.sidebar-nav-flush .nav-link {
    width: 100%;
    margin: 0;

    border-radius: 0;
    display: flex;
    align-items: center;

    gap: .6rem;

    padding: .65rem 1rem;
    color: var(--bs-body-color);

    border-top: 1px solid rgba(255,255,255,.06);
    border-left: 4px solid transparent;
}

.sidebar-nav.sidebar-nav-flush .nav-link:first-child {
    border-top: 0;
}

.sidebar-nav.sidebar-nav-flush .nav-link:hover {
    background: rgba(255,255,255,.06);
    color: var(--bs-body-color);
}

.sidebar-nav.sidebar-nav-flush .nav-link.active {
    background: rgba(255,255,255,.12);
    border-left-color: rgb(var(--bs-info-rgb));
    color: var(--bs-body-color);
}

/* Keep icon visually stable and centered regardless of label show/hide */
.sidebar-nav .nav-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 1.5rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 1.1rem;
    line-height: 1;
}
.sidebar-nav .nav-label { white-space: nowrap; }

/* Sidebar title: swap to globe icon on collapse (no vertical shift) */
.sidebar-title {
    display: flex;
    align-items: center;
    min-height: 44px;
}
.sidebar-title-icon {
    display: none;
    width: 100%;
    text-align: center;
    font-size: 1.25rem;
    line-height: 1;
}

/* Desktop-only: give the header menu extra clearance from the right toggle tab */
@media (min-width: 992px) {
    .console-chat-menu { margin-right: 3.5rem; }

    body.left-collapsed #leftSidebar {
        width: 72px !important;
        flex: 0 0 72px !important;
    }

    body.left-collapsed #leftSidebar .sidebar-title-text {
        display: none !important;
    }
    body.left-collapsed #leftSidebar .sidebar-title-icon {
        display: inline-flex !important;
        justify-content: center;
        align-items: center;
    }

    body.left-collapsed #leftSidebar .nav-label,
    body.left-collapsed #leftSidebar .sidebar-hint {
        display: none !important;
    }

    body.left-collapsed #leftSidebar .nav-link {
        justify-content: flex-start;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    body.right-collapsed #rightSidebar { display: none !important; }

    /* Console: keep chat visible and expand correctly when right sidebar is collapsed */
    body.right-collapsed main.consoleChatMain#centerMain {
        display: block !important;
        width: 75% !important;  /* 100% - left (25%) */
        flex: 0 0 auto !important;
    }

    body:not(.right-collapsed) main.consoleChatMain#centerMain {
        display: block !important;
        width: 58.3333333% !important; /* col-lg-7 */
        flex: 0 0 auto !important;
    }

    /* Keep original dashboard rules for pages that use the nav left sidebar */
    body.left-collapsed:not(.right-collapsed) #centerMain {
        width: calc(100% - 72px - 16.6666667%) !important;
        flex: 0 0 auto !important;
    }

    body.right-collapsed #centerMain {
        width: 83.3333333% !important;
        flex: 0 0 auto !important;
    }

    body.left-collapsed.right-collapsed #centerMain {
        width: calc(100% - 72px) !important;
        flex: 0 0 auto !important;
    }
}