﻿/* =========================================================
   Wash Support / Istobal
   Adaptive navigation

   Colors are supplied by MudTheme / ThemeService.
   ========================================================= */


/* =========================================================
   SIDEBAR
   ========================================================= */

.modern-sidebar {
    width: var(--app-drawer-width, 280px) !important;
    max-width: var(--app-drawer-width, 280px) !important;
    overflow: hidden !important;
    border-right: 1px solid rgba(15, 23, 42, .08) !important;
    background: linear-gradient( 180deg, #ffffff 0%, #f8fafc 100% ) !important;
    color: var( --mud-palette-text-primary, #0f172a ) !important;
}


    /*
 * Very subtle theme-colored glow.
 *
 * It automatically becomes:
 * - WashSupport blue
 * - ISTOBAL red
 * - UNO-X yellow
 * - Wennstrom blue
 */
    .modern-sidebar::before {
        content: '';
        position: absolute;
        top: -150px;
        left: -130px;
        width: 380px;
        height: 380px;
        border-radius: 50%;
        background: rgba( var(--mud-palette-primary-rgb), .08 );
        filter: blur(35px);
        pointer-events: none;
    }


/* =========================================================
   DARK MODE
   ========================================================= */

.mud-theme-dark .modern-sidebar,
html.dark .modern-sidebar,
body.dark .modern-sidebar,
.modern-sidebar-dark {
    background: radial-gradient( circle at top left, rgba( var(--mud-palette-primary-rgb), .12 ), transparent 34% ), linear-gradient( 180deg, #0f172a 0%, #0b1220 58%, #070d19 100% ) !important;
    color: var( --mud-palette-text-primary, #f8fafc ) !important;
    border-right-color: rgba( 255, 255, 255, .08 ) !important;
}


/* =========================================================
   DRAWER
   ========================================================= */

.modern-sidebar .mud-drawer,
.modern-sidebar .mud-drawer-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    color: inherit !important;
}


.modern-sidebar .mud-drawer-content {
    padding: 0 !important;
    overflow: hidden !important;
}


/* =========================================================
   NAVIGATION SHELL
   ========================================================= */

.app-nav-shell {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    color: inherit;
}


.app-nav-inner {
    display: flex;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    padding: 18px 16px 16px;
    overflow: hidden;
}


/* =========================================================
   LOGO
   ========================================================= */

.app-nav-logo {
    display: flex;
    flex: 0 0 auto;
    height: 125px;
    align-items: center;
    justify-content: center;
    padding: 8px 8px 20px;
    margin-bottom: 8px;
}


.app-nav-logo-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 215px;
    max-height: 95px;
    object-fit: contain;
}


.app-nav-logo-washsupport {
    height: 132px;
}


    .app-nav-logo-washsupport .app-nav-logo-image {
        max-width: 220px;
        max-height: 105px;
    }


.app-nav-logo-unox .app-nav-logo-image {
    max-width: 175px;
    max-height: 90px;
}


.app-nav-logo-wennstrom .app-nav-logo-image {
    max-width: 210px;
    max-height: 92px;
}


.app-nav-logo-istobal .app-nav-logo-image {
    max-width: 185px;
    max-height: 90px;
}


/* =========================================================
   NAV LIST
   ========================================================= */

.app-nav-list {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 1px 12px;
}


    .app-nav-list::-webkit-scrollbar {
        width: 5px;
    }


    .app-nav-list::-webkit-scrollbar-track {
        background: transparent;
    }


    .app-nav-list::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba( 148, 163, 184, .24 );
    }


        .app-nav-list::-webkit-scrollbar-thumb:hover {
            background: rgba( 148, 163, 184, .42 );
        }


/* =========================================================
   EMPTY STATE
   ========================================================= */

.app-nav-empty {
    margin: 4px;
    padding: 12px 13px;
    border: 1px solid rgba( 148, 163, 184, .18 );
    border-radius: 12px;
    color: var( --mud-palette-text-secondary, #64748b );
    font-size: .82rem;
    line-height: 1.5;
}


/* =========================================================
   NAV ITEM
   ========================================================= */

.app-nav-link {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    height: 46px;
    min-height: 46px;
    flex: 0 0 auto;
    align-items: center;
    gap: 0;
    margin: 1px 0;
    padding: 0 13px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var( --mud-palette-text-secondary, #475569 );
    font-family: inherit;
    font-size: .9rem;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    outline: none;
    transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}


/* =========================================================
   ICON
   ========================================================= */

.app-nav-icon {
    display: inline-flex;
    width: 34px;
    min-width: 34px;
    height: 46px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    color: var( --mud-palette-text-secondary, #64748b );
    transition: color 150ms ease;
}


.app-nav-svg {
    display: inline-flex;
    width: 21px;
    height: 21px;
    align-items: center;
    justify-content: center;
}


    .app-nav-svg svg {
        display: block;
        width: 21px;
        height: 21px;
    }


/* =========================================================
   TEXT
   ========================================================= */

.app-nav-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    color: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   INACTIVE
   ========================================================= */

.app-nav-link-inactive {
    color: var( --mud-palette-text-secondary, #475569 );
}


    /* =========================================================
   HOVER
   ========================================================= */

    .app-nav-link-inactive:hover,
    .app-nav-link-inactive:focus-visible {
        background: rgba( var(--mud-palette-primary-rgb), .075 );
        color: var( --mud-palette-text-primary, #0f172a );
    }


        .app-nav-link-inactive:hover .app-nav-icon,
        .app-nav-link-inactive:focus-visible .app-nav-icon {
            color: var( --mud-palette-primary );
        }


/* =========================================================
   ACTIVE
   ========================================================= */

.app-nav-link-active {
    background: rgba( var(--mud-palette-primary-rgb), .13 );
    color: var( --mud-palette-primary );
    font-weight: 750;
    box-shadow: inset 3px 0 0 var(--mud-palette-primary);
}


    .app-nav-link-active .app-nav-icon {
        color: var(--mud-palette-primary);
    }


    /*
 * A tiny marker makes the active state look cleaner
 * without making the entire button too colorful.
 */
    .app-nav-link-active::after {
        content: '';
        position: absolute;
        right: 13px;
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: var(--mud-palette-primary);
        opacity: .75;
    }


/* =========================================================
   DARK MODE ACTIVE / HOVER
   ========================================================= */

.mud-theme-dark .app-nav-link,
html.dark .app-nav-link,
body.dark .app-nav-link {
    color: var( --mud-palette-text-secondary, #cbd5e1 );
}


.mud-theme-dark .app-nav-link-inactive:hover,
.mud-theme-dark .app-nav-link-inactive:focus-visible,
html.dark .app-nav-link-inactive:hover,
html.dark .app-nav-link-inactive:focus-visible,
body.dark .app-nav-link-inactive:hover,
body.dark .app-nav-link-inactive:focus-visible {
    background: rgba( var(--mud-palette-primary-rgb), .11 );
    color: var( --mud-palette-text-primary, #f8fafc );
}


.mud-theme-dark .app-nav-link-active,
html.dark .app-nav-link-active,
body.dark .app-nav-link-active {
    background: rgba( var(--mud-palette-primary-rgb), .17 );
    color: var(--mud-palette-primary);
}


/* =========================================================
   GROUP BUTTON
   ========================================================= */

.app-nav-group-button {
    text-align: left;
}


/* =========================================================
   CHEVRON
   ========================================================= */

.app-nav-chevron {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    color: var( --mud-palette-text-disabled, #94a3b8 );
    transition: transform 160ms ease, color 160ms ease;
}


    .app-nav-chevron .app-nav-svg,
    .app-nav-chevron svg {
        width: 17px;
        height: 17px;
    }


.app-nav-chevron-open {
    transform: rotate(90deg);
    color: var(--mud-palette-primary);
}


/* =========================================================
   CHILD ITEMS
   ========================================================= */

.app-nav-children {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 3px 0 5px 22px;
    padding-left: 12px;
    border-left: 1px solid rgba( var(--mud-palette-primary-rgb), .18 );
}


    .app-nav-children .app-nav-link {
        height: 42px;
        min-height: 42px;
        font-size: .855rem;
    }


    .app-nav-children .app-nav-icon {
        height: 42px;
    }


/* =========================================================
   DISABLED
   ========================================================= */

.app-nav-link-disabled {
    opacity: .42;
    cursor: default;
    pointer-events: none;
}


/* =========================================================
   FOOTER
   ========================================================= */

.app-nav-footer {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 7px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba( 148, 163, 184, .15 );
}


/* =========================================================
   DARK MODE SWITCH
   ========================================================= */

.app-theme-toggle {
    display: flex;
    width: 100%;
    height: 44px;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border-radius: 13px;
    color: var( --mud-palette-text-secondary, #475569 );
    font-size: .875rem;
    font-weight: 650;
    cursor: pointer;
    user-select: none;
    transition: background-color 150ms ease, color 150ms ease;
}


    .app-theme-toggle:hover {
        background: rgba( var(--mud-palette-primary-rgb), .07 );
        color: var( --mud-palette-text-primary );
    }


.app-theme-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   SWITCH
   ========================================================= */

.app-theme-switch {
    position: relative;
    display: inline-flex;
    width: 36px;
    height: 20px;
    flex: 0 0 36px;
    align-items: center;
    border-radius: 999px;
    background: rgba( 100, 116, 139, .38 );
    transition: background-color 150ms ease;
}


.app-theme-switch-dot {
    position: absolute;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba( 15, 23, 42, .25 );
    transition: transform 150ms ease;
}


.peer:checked + .app-theme-switch {
    background: var(--mud-palette-primary);
}


    .peer:checked + .app-theme-switch
    .app-theme-switch-dot {
        transform: translateX(16px);
    }


/* =========================================================
   LOGOUT
   ========================================================= */

/*
 * Supports the Logout component classes already used
 * by the application.
 */

.app-logout-button,
.modern-logout-link {
    color: var( --mud-palette-error, #e11d48 ) !important;
}


    .app-logout-button:hover,
    .modern-logout-link:hover {
        background: rgba( var(--mud-palette-error-rgb), .09 ) !important;
        color: var( --mud-palette-error, #e11d48 ) !important;
    }


/* =========================================================
   FOCUS
   ========================================================= */

.app-nav-link:focus-visible,
.app-theme-toggle:focus-within {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 960px) {

    .app-nav-inner {
        padding: 14px 12px calc( 14px + env(safe-area-inset-bottom) );
    }


    .app-nav-logo {
        height: 112px;
        padding-bottom: 14px;
    }


    .app-nav-logo-image {
        max-width: 200px;
        max-height: 88px;
    }


    .app-nav-link {
        height: 48px;
        min-height: 48px;
        border-radius: 14px;
        font-size: .92rem;
    }


    .app-nav-icon {
        height: 48px;
    }


    .app-theme-toggle {
        height: 48px;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 520px) {

    .app-nav-inner {
        padding-inline: 10px;
    }


    .app-nav-logo {
        height: 100px;
    }


    .app-nav-logo-image {
        max-width: 185px;
        max-height: 80px;
    }


    .app-nav-link {
        padding-inline: 11px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .app-nav-link,
    .app-nav-icon,
    .app-nav-chevron,
    .app-theme-switch,
    .app-theme-switch-dot,
    .app-theme-toggle {
        transition: none !important;
    }
}
