/* =========================================
   Header
   ========================================= */

.app-header {
    background-color: var(--md-canvas);
    color: var(--md-primary);
    border-bottom: 1px solid var(--md-line);
    box-shadow: 0 .56rem 30px rgba(40, 70, 76, .05);
    position: relative;
    z-index: 1030;
}

.app-header .navbar {
    min-height: 78px;
    padding: 0;
}


/* =========================================
   Brand
   ========================================= */

.app-brand {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    text-decoration: none;
}

  

    /*
    The wordmark SVGs carry their own intrinsic size (994x172 and 1489x340), so
    they must be constrained here or they render at full width.

    max-height rather than height: with an explicit height, max-width kicking in
    would squash the aspect ratio. This way the logo scales down whole.
*/
    .app-brand img {
        display: block;
        width: auto;
        height: auto;
        max-height: 56px;
        max-width: 100%;
    }


/* =========================================
   Main Navigation
   ========================================= */

.app-main-nav {
    align-items: center;
    gap: .2rem;
}

    .app-main-nav .nav-item {        
        display: flex;
        align-items: center;
    }

    /*
    IMPORTANT:
    Both NavLink <a> elements and the Resources <button>
    get exactly the same sizing.
*/
    .app-main-nav .nav-link {
      
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 42px;
        padding: .65rem 1rem !important;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--md-primary);;
        font-family: inherit;
        font-size: 1rem;
        font-weight: 500;
        line-height: 1;
        text-decoration: none;
        white-space: nowrap;
        transition: 
            background-color: .18s ease,
            color .18s ease;
    }


        /* Main link hover */

        .app-main-nav .nav-link:hover,
        .app-main-nav .nav-link:focus {
            color: var(--md-primary);
            background-color: rgba(111, 132, 92, .08);
        }


        /* no underline */

        .app-main-nav .nav-link::before {
           display:none;
        }

      



        /* Blazor active link */

        .app-main-nav .nav-link.active {
            color: var(--md-primary);
            background-color: var(--md-confirmSoft);
            font-weight: 600;
        }

         

/* =========================================
   Resources Button
   ========================================= */

.app-resource-toggle{
    cursor: pointer;
}


    /*
    Bootstrap uses ::after for its dropdown chevron,
    so leave ::after alone.

    Our sage underline is using ::before above.
*/

    .app-resource-toggle[aria-expanded="true"] {
        color: var(--md-primary);
        background-color: rgba(111, 132, 92, .08);
        font-weight: 600;
    }



    /* Bootstrap chevron */

    .app-resource-toggle.dropdown-toggle::after {
        margin-left: .5rem;
        vertical-align: middle;
        border-top-width: .3rem;
    }


/* =========================================
   Resources Dropdown
   ========================================= */

.app-resource-dropdown {
    position: relative;
}


/*
    Soft Sage dropdown
*/

.app-resource-menu {
    width: 360px;
    top: calc(100% + 2px) !important;
    left: 50% !important;
    margin: 0 !important;
    padding: .6rem;
    transform: translateX(-50%) !important;
    background-color: var(--md-confirmSoft);
    border: 1px solid var(--md-confirm);
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(15, 27, 51, .16);
}


    /*
    Arrow between Resources and dropdown.

    This becomes visible only when Bootstrap adds
    .show to the dropdown menu.
*/

    .app-resource-menu.show::before {
        content: "";
        position: absolute;
        top: -9px;
        left: 50%;
        width: 18px;
        height: 18px;
        background-color: #E8EFE5;
        border-top: 1px solid rgba(15, 27, 51, .08);
        border-left: 1px solid rgba(15, 27, 51, .08);
        transform: translateX(-50%) rotate(45deg);
        z-index: -1;
    }


/* =========================================
   Resource Items
   ========================================= */

.app-resource-item {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    padding: .9rem .85rem;
    border-radius: 8px;
    color: var(--md-primary);
    white-space: normal;
    transition: background-color .15s ease, color .15s ease;
}

    .app-resource-item:hover,
    .app-resource-item:focus {
        color: var(--md-primary);
        background-color: rgba(113, 137, 107, .14);
    }


/* Icon */

.resource-icon {
    width: 27px;
    min-width: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: .15rem;
    color: var(--md-primary);
    font-size: 1.2rem;
}

.app-resource-item:hover .resource-icon {
    color: #71896B;
}


/* Dropdown Text */

.resource-content {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.resource-title {
    color: var(--md-primary);
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.25;
}

.resource-description {
    color: #5A6478;
    font-size: .8rem;
    font-weight: 400;
    line-height: 1.4;
}


/* =========================================
   User
   ========================================= */

.app-user-menu {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.app-user-button {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .4rem .6rem;
    border: 0;
    border-radius: 0px;
    color: var(--md-primary);
    background: transparent;
    font-weight: 600;
    font-size: 1rem;

    transition: background-color .18s ease, color .18s ease;
}

    .app-user-button:hover,
    .app-user-button:focus,
    .app-user-button.show {
        color: var(--md-primary);
        background-color: rgba(111, 132, 92, .08) !important;
        border-radius: 10px;
    }


/* Avatar */

.app-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--md-confirmSoft);
    color: var(--md-confirm);
}

    .app-avatar i {
        font-size: 1.05rem;
    }


/* =========================================
   Desktop spacing
   ========================================= */

@media (min-width: 1200px) {

    .app-header .navbar-collapse {
        align-items: center;
    }

    .app-user-menu {
        margin-left: 1rem;
    }
}

/* =========================================
   Tablet / Mobile
   ========================================= */

@media (max-width: 1199.98px) {

    .app-header .navbar {
        min-height: 72px;
        padding: .55rem 0;
    }

    /*
    The brand and the toggler must share one row. The collapse div is display:
    none on mobile (the drawer replaces it, so Bootstrap never opens it), which
    is what makes nowrap safe here - nothing is relying on wrapping to a second
    line. min-width lets the brand shrink instead of shoving the toggler down.
*/
    .navbar {
        flex-wrap: nowrap;
    }

    .app-brand {
        min-width: 0;
    }

    .app-brand img {
        max-height: 34px;
    }

    .app-main-nav {
        gap: 0;
        margin-top: 1rem;
    }

        .app-main-nav .nav-item {
            display: block;
        }

        .app-main-nav .nav-link {
            justify-content: flex-start;
            width: 100%;
            min-height: auto;
            padding: .8rem 1rem;
            border-radius: 10px;
        }

            .app-main-nav .nav-link.active {
                background-color: var(--md-confirmSoft);
            }


    /* Resources dropdown */

    .app-resource-menu {
        width: 100%;
        top: auto !important;
        left: auto !important;
        margin-top: .25rem !important;
        transform: none !important;
        box-shadow: none;
    }

        .app-resource-menu.show::before {
            display: none;
        }


    /* User */

    .app-user-menu {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--md-line);
    }

    .app-user-button {
        width: 100%;
        border-radius: 10px;
    }
}
/* =========================================
   Public Homepage Navigation
   ========================================= */

.public-navbar {
    background-color: var(--md-canvas);
    min-height: 104px;
    padding: 0;
}


/* Same width as homepage hero */
.public-nav-container {
    max-width: 1480px;
    margin: 0 auto;
    padding-left: 5rem;
    padding-right: 5rem;
}


/* =========================================
   Brand
   ========================================= */

.public-brand {
    gap: .75rem;
    padding: 0;
    margin-right: 2rem;
    color: var(--md-primary);
    text-decoration: none;
}

    .public-brand:hover,
    .public-brand:focus {
        color: var(--md-primary);
    }

/* =========================================
   Main Links
   ========================================= */

.public-nav-links {
    gap: 1.35rem;
}

    .public-nav-links .nav-link {
        position: relative;
        padding: 2.35rem .35rem;
        color: var(--md-primary);
        font-size: .95rem;
        font-weight: 600;
        white-space: nowrap;
        transition: color .2s ease;
    }

        .public-nav-links .nav-link:hover,
        .public-nav-links .nav-link:focus {
            color: var(--md-primaryPressed);
        }


        /* Sage underline on hover */

        .public-nav-links .nav-link::after {
            content: "";
            position: absolute;
            left: .35rem;
            right: .35rem;
            bottom: 22px;
            height: 2px;
            background-color: var(--md-confirm);
            transform: scaleX(0);
            transform-origin: center;
            transition: transform .2s ease;
        }

        .public-nav-links .nav-link:hover::after,
        .public-nav-links .nav-link:focus::after {
            transform: scaleX(1);
        }


/* =========================================
   Right Actions
   ========================================= */

.public-nav-actions {
    margin-left: 2rem;
}

.login-link {
    padding: .65rem .5rem;
    color: var(--md-primary);
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
}

    .login-link:hover {
        color: var(--md-primaryPressed);
    }


.signup-button {
    padding: .7rem 1.45rem;
    background-color: var(--md-primary);
    border: 1px solid var(--md-primary);
    border-radius: 7px;
    color: #ffffff;
    font-size: .95rem;
    font-weight: 600;
}

    .signup-button:hover,
    .signup-button:focus {
        background-color: var(--md-primaryPressed);
        border-color: var(--md-primaryPressed);
        color: #ffffff;
    }


/* =========================================
   Mobile Toggle
   ========================================= */

.navbar-toggler {
    border: 1px solid rgba(15, 27, 51, .18);
}

    .navbar-toggler:focus {
        box-shadow: none;
    }


/* =========================================
   Responsive
   ========================================= */

@media (max-width: 991.98px) {

    .public-navbar {
        min-height: auto;
        padding: 1rem 0;
    }

    .public-nav-container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    /* The desktop gutter is wasted space once the row is brand + toggler only. */
    .public-brand {
        margin-right: 1rem;
    }

    .public-nav-links {
        gap: 0;
        padding-top: 1.25rem;
    }

        .public-nav-links .nav-link {
            padding: .75rem 0;
        }

            .public-nav-links .nav-link::after {
                display: none;
            }

    .public-nav-actions {
        flex-direction: column;
        align-items: stretch !important;
        margin-left: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(15, 27, 51, .10);
    }

    .login-link {
        text-align: center;
    }

    .signup-button {
        width: 100%;
        text-align: center;
    }
}


/* =========================================
   Mobile Drawer (left side panel)
   ========================================= */

/* Keeps the page behind the panel from scrolling on touch devices. */
body.app-drawer-open {
    overflow: hidden;
}

.app-drawer-scrim {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background-color: rgba(15, 27, 51, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease;
}

    .app-drawer-scrim.open {
        opacity: 1;
        pointer-events: auto;
    }

/*
    One drawer style for everyone. The panel used to switch between a dark
    (signed-in) and light (public) variant; it is now always canvas, and the
    only difference between the two is which links are inside it.
*/
.app-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1045;
    display: flex;
    flex-direction: column;
    width: 80%;
    max-width: 420px;
    padding: 1.15rem 1.15rem 1.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: var(--md-canvas);
    color: var(--md-primary);
    transform: translateX(-100%);
    transition: transform .28s ease;
}

    .app-drawer.open {
        transform: translateX(0);
    }


/* Header */

.app-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.app-drawer-brand {
    display: flex;
    line-height: 1;
}

    .app-drawer-brand img {
        display: block;
        width: auto;
        height: 58px;
        max-width: 100%;
    }

.app-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    background-color: rgba(40, 70, 76, .07);
    border: 0;
    border-radius: 50%;
    color: var(--md-primary);
    font-size: .9rem;
    cursor: pointer;
    transition: background-color .18s ease;
}

    .app-drawer-close:hover,
    .app-drawer-close:focus {
        background-color: rgba(40, 70, 76, .13);
    }


/* Links */

    .app-drawer-nav {
    display: flex;
    flex-direction: column;
}

.app-drawer-link,
.app-drawer-link-small {
    display: flex;
    align-items: center;
    gap: .95rem;
    width: 100%;
    padding: .85rem .35rem;
    border: 0;
    border-bottom: 1px solid var(--md-line);
    border-radius: 0;
    background: transparent;
    color: var(--md-primary);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

    .app-drawer-link:hover,
    .app-drawer-link:focus,
    .app-drawer-link-small:hover,
    .app-drawer-link-small:focus {
        color: var(--md-primary);
        background-color: rgba(111, 132, 92, .08);
    }

    /* The submenu supplies the separation under an open Resources row. */
    .app-drawer-link[aria-expanded="true"] {
        border-bottom-color: transparent;
    }

    .app-drawer-link.active,
    .app-drawer-link-small.active {
        color: var(--md-primary);
        background-color: var(--md-confirmSoft);
        border-bottom-color: transparent;

    }

.app-drawer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.app-drawer-label {
    flex: 1;
}

.app-drawer-chevron {
    font-size: .95rem;
    color: var(--md-muted);
    transition: transform .2s ease;
}

    .app-drawer-chevron.expanded {
        transform: rotate(180deg);
    }

/* Trailing ">" affordance on the plain navigation rows. */
.app-drawer-caret {
    margin-left: auto;
    color: var(--md-muted);
    font-size: .95rem;
}


/* Resources submenu - same soft sage panel as the desktop dropdown */

.app-drawer-submenu {
    padding: .5rem;
    margin: .2rem 0 .6rem;
    background-color: var(--md-confirmSoft);
    border-radius: 12px;
}


/* =========================================
   Drawer - User card
   ========================================= */

/* Sits directly under the nav links, not pinned to the bottom. */

.app-drawer-user {
    margin-top: 1rem;
    padding: .75rem;
    background-color: var(--md-surface);
    border: 1px solid var(--md-line);
    border-radius: 16px;
}

.app-drawer-user-button {
    display: flex;
    align-items: center;
    gap: .85rem;
    width: 100%;
    padding: .35rem;
    background: transparent;
    border: 0;
    color: var(--md-primary);
    text-align: left;
    cursor: pointer;
}

.app-drawer-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 50%;
    background-color: var(--md-confirm);
    color: #ffffff;
    font-size: 1.35rem;
}

.app-drawer-user-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}

.app-drawer-user-name {
    font-size: 1.05rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-drawer-user-status {
    color: var(--md-muted);
    font-size: .85rem;
}

.app-drawer-user-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--md-muted);
    font-size: .95rem;
}

    .app-drawer-user-chevron i {
        transition: transform .2s ease;
    }

        /* The caret points right while collapsed, so a quarter turn opens it. */
        .app-drawer-user-chevron i.expanded {
            transform: rotate(90deg);
        }

.app-drawer-user-menu {
    padding: .4rem;
    margin-top: .55rem;
    background-color: rgba(40, 70, 76, .04);
    border-radius: 12px;
}

.app-drawer-user-item {
    display: flex;
    align-items: center;
    gap: .8rem;
    width: 100%;
    padding: .7rem .8rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--md-primary);
    font-size: 1rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

    .app-drawer-user-item:hover,
    .app-drawer-user-item:focus {
        background-color: var(--md-confirmSoft);
        color: var(--md-primary);
    }

.app-drawer-user-divider {
    margin: .4rem .8rem;
    border-top: 1px solid var(--md-line);
    opacity: 1;
}

.app-drawer-logout {
    color: var(--md-danger);
}

    .app-drawer-logout:hover,
    .app-drawer-logout:focus {
        background-color: var(--md-dangerSoft);
        color: var(--md-danger);
    }


/* Footer - sits directly under the nav links, not pinned to the bottom. */

.app-drawer-footer {
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(28, 43, 72, .12);
}

.app-drawer-footer-prompt {
    margin-bottom: .85rem;
    color: var(--md-text);
    font-size: .95rem;
    text-align: center;
}

.app-drawer-login,
.app-drawer-signup {
    display: block;
    padding: .85rem 1rem;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.app-drawer-login {
    border: 1px solid var(--md-primary);
    color: var(--md-primary);
}

.app-drawer-signup {
    margin-top: .7rem;
    background-color: var(--md-primary);
    border: 1px solid var(--md-primary);
    color: #ffffff;
}

    .app-drawer-signup:hover,
    .app-drawer-signup:focus {
        background-color: var(--md-primary);
        color: #ffffff;
    }

.app-drawer-footer-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin: .9rem 0 0;
    color: #5A6478;
    font-size: .82rem;
}


/* The drawer only exists while the navbar is collapsed. */

@media (min-width: 1200px) {

    .app-drawer,
    .app-drawer-scrim {
        display: none;
    }
}


/* Hamburger sits on the canvas header. */

.app-header .app-drawer-toggler {
    border-color: var(--md-primary);
}