﻿/* ========================================================================
   app-shell.css v3 – responzivni layout aplikace
   Nacist v _Host.cshtml JAKO POSLEDNI css (za site.css i {Projekt}.styles.css)

   Chovani (ridi jedna trida .toggled na .app):
     bez .toggled : desktop = menu viditelne (280px sloupec vlevo)
                    mobil   = menu schovane
     s  .toggled  : desktop = menu sbalene
                    mobil   = menu otevrene jako overlay pres obsah
   ======================================================================== */

:root {
    --sb-w: 280px;
    --topbar-h: 56px;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* ---------- SIDEBAR – mobilni vychozi stav: schovany off-canvas ---------- */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sb-w);
    z-index: 1045;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s;
    background-color: var(--bs-body-bg, #fff);
}

.app.toggled .app-sidebar {
    transform: translateX(0);
    visibility: visible;
    transition: transform .25s ease, visibility 0s;
}

/* ---------- BACKDROP ---------- */
.app-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1040;
    display: none;
}

.app.toggled .app-backdrop {
    display: block;
}

/* ---------- MAIN ---------- */
.app-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .75rem;
    background: var(--bs-body-bg, #fff);
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    z-index: 1020;
}

.app-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: .75rem;
}

/* ========================================================================
   DESKTOP >= 992px : sidebar jako pevny sloupec
   .toggled = sbalit: slide ven + visibility:hidden
   (visibility na predkovi schova VSECHNY potomky, i position:fixed –
    zadne stare CSS to nemuze prebit)
   ======================================================================== */
@media (min-width: 992px) {

    .app .app-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        flex: 0 0 var(--sb-w);
        width: var(--sb-w);
        max-width: var(--sb-w);
        transform: none;
        visibility: visible;
        transition: margin-left .25s ease, visibility 0s;
        margin-left: 0;
    }

    .app.toggled .app-sidebar {
        margin-left: calc(-1 * var(--sb-w));
        transform: none;
        visibility: hidden;
        transition: margin-left .25s ease, visibility 0s linear .25s;
    }

    .app-backdrop {
        display: none !important;
    }

    .app-content {
        padding: 1rem 1.5rem;
    }
}

/* ---------- Mobil: pohodlnejsi ovladani ---------- */
@media (max-width: 991.98px) {
    .app .app-sidebar .nav-link-devops {
        min-height: 44px;
    }

    .app-topbar .navbar-text {
        max-width: 45vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 14px;
    }
}

/* ========================================================================
   POJISTKA proti staremu scoped CSS (position:fixed na .sidebar-wrapper)
   ======================================================================== */
.app .app-sidebar .sidebar-wrapper {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    bottom: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    margin: 0 !important;
    transform: none !important;
    z-index: auto !important;
}

    /* Texty a sipky v menu se NIKDY neschovavaji */
    .app .app-sidebar .sidebar-wrapper span,
    .app .app-sidebar .sidebar-wrapper .menu-text {
        display: block !important;
    }

    .app .app-sidebar .sidebar-wrapper .accordion-button::after {
        display: inline-block !important;
    }

/* ---------- ostatni ---------- */
@media print {
    .app-sidebar, .app-topbar, .app-backdrop {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar {
        transition: none;
    }
}
ss /* ========================================================================
   Dropdowny v topbaru (ThemeSwitcher apod.) – zarovnat k prave hrane,
   aby menu neuteklo mimo obrazovku
   ======================================================================== */
.app-topbar .dropdown-menu {
    left: auto !important;
    right: 0 !important;
    transform: none !important;
    inset: 100% 0 auto auto !important; /* top:100% (pod tlacitkem), right:0 */
}