/* /Components/Layout/MainLayout.razor.rz.scp.css */
/* -------------------------------------------------------
   Wizionic — Main Layout Styles (Clean Architecture)
   ------------------------------------------------------- */

/* ----------------------------------------
   Page Structure
   ---------------------------------------- */
.page[b-g1efjqhwzr] {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

/* Main content area */
main[b-g1efjqhwzr] {
    flex: 1;
    background: var(--light-blue-3);
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;

    /* NEW: push content below fixed top-row */
    margin-top: 3.5rem;
}

/* ----------------------------------------
   Sidebar Container
   ---------------------------------------- */
.sidebar[b-g1efjqhwzr] {
    background: var(--light-blue-2);
    color: var(--text-dark);
    width: 250px;

    /* UPDATED: sidebar now starts below top-row */
    position: fixed;
    top: 3.5rem;
    left: 0;

    height: calc(100vh - 3.5rem);
    overflow-y: auto;
    z-index: 900;
    overflow: visible;
}

/* Sidebar visibility controlled by toggle */
.sidebar.show[b-g1efjqhwzr] {
    display: block;
}

.sidebar.hide[b-g1efjqhwzr] {
    display: none;
}

.overlay[b-g1efjqhwzr] {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    z-index: 1400;
}

/* ----------------------------------------
   Top Row (Inside <main>)
   ---------------------------------------- */
.top-row[b-g1efjqhwzr] {
    background: var(--light-blue-2);
    border-bottom: var(--border-light);
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-4);

    /* UPDATED: fixed instead of sticky */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    z-index: 1000; /* above sidebar */
}

.top-row[b-g1efjqhwzr]  a,
.top-row[b-g1efjqhwzr]  .btn-link {
    color: var(--primary-dark);
    text-decoration: none;
    white-space: nowrap;
    margin-left: var(--space-0);
}

.top-row[b-g1efjqhwzr]  a:hover,
.top-row[b-g1efjqhwzr]  .btn-link:hover {
    text-decoration: underline;
}

.top-left[b-g1efjqhwzr] {
    display: flex;
    align-items: center;
    gap: var(--space-11); /* spacing between fish + toggle */
    margin-left: 200px;
}

/* ----------------------------------------
   Content Area
   ---------------------------------------- */
.content[b-g1efjqhwzr] {
    padding: 0 !important;
    margin: 0 !important;
    background: var(--grey-50);
}

/* ----------------------------------------
   Responsive Layout
   ---------------------------------------- */

/* DESKTOP */
@media (min-width: 641px) {

    /* Desktop layout uses flex, not grid */
    .page[b-g1efjqhwzr] {
        display: flex;
        flex-direction: row;
        height: 100vh;
        width: 100%;
    }

    /* Sidebar behavior */
    .sidebar.show[b-g1efjqhwzr] {
        display: block;
        width: 250px;
        flex-shrink: 0;

        /* UPDATED: still fixed + offset */
        position: fixed;
        top: 3.5rem;
        height: calc(100vh - 3.5rem);
    }

    .sidebar.hide[b-g1efjqhwzr] {
        display: none;
    }

        /* When sidebar is hidden, main should expand fully */
    .page .sidebar.hide ~ main[b-g1efjqhwzr] {
        margin-left: 0 !important;
    }


    /* Main content expands fully */
    main[b-g1efjqhwzr] {
        flex: 1;
        width: 100%;
        min-width: 0; /* prevents overflow */

        /* stays pushed down */
        margin-top: 3.5rem;
        margin-left: 250px; /* align with sidebar */
    }

    /* Overlay never appears on desktop */
    .overlay[b-g1efjqhwzr] {
        display: none !important;
    }

    /* Keep your existing padding rules */
    .top-row[b-g1efjqhwzr],
    article[b-g1efjqhwzr] {
        padding-left: var(--space-8) !important;
        padding-right: var(--space-6) !important;
    }
}

/* MOBILE */
@media (max-width: 640.98px) {

    /* Mobile layout is vertical */
    .page[b-g1efjqhwzr] {
        display: block;
        height: 100vh;
        width: 100%;
    }

    /* Sidebar becomes a slide-in drawer */
    .sidebar[b-g1efjqhwzr] {
        position: fixed;
        top: 3.5rem; /* UPDATED: below top-row */
        left: 0;
        width: 250px;
        height: calc(100vh - 3.5rem);
        z-index: 1500;
        background: var(--light-blue-2);
        transform: translateX(-260px);
        transition: transform 0.25s ease;
    }

    .sidebar.show[b-g1efjqhwzr] {
        transform: translateX(0);
    }

    .sidebar.hide[b-g1efjqhwzr] {
        transform: translateX(-260px);
    }

    /* Top row spacing for mobile */
    .top-row[b-g1efjqhwzr] {
        justify-content: space-between;
    }

    .top-row[b-g1efjqhwzr]  a,
    .top-row[b-g1efjqhwzr]  .btn-link {
        margin-left: 0;
    }

    /* Main content stays pushed down */
    main[b-g1efjqhwzr] {
        margin-top: 3.5rem;
        margin-left: 0;
    }
}

/* ----------------------------------------
   Sidebar Toggle Button
   ---------------------------------------- */
.sidebar-toggle[b-g1efjqhwzr] {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: black;
}

/* ----------------------------------------
   Blazor Error UI (unchanged)
   ---------------------------------------- */
#blazor-error-ui[b-g1efjqhwzr] {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss[b-g1efjqhwzr] {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
