/* ==========================================================
   SIDE MENU – HOVEDRAMME
========================================================== */

.side-menu {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;

    width: 340px;
    max-width: 88vw;
    height: 100%;

    padding:
        max(24px, env(safe-area-inset-top))
        24px
        max(24px, env(safe-area-inset-bottom));

    background: #020617;

    box-shadow:
        0 20px 45px
        rgba(0, 0, 0, 0.5);

    box-sizing: border-box;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;

    transform: translateX(-100%);

    transition:
        transform 0.25s ease;
}

.side-menu.open {
    transform: translateX(0);
}


/* ==========================================================
   FELLES LENKER
========================================================== */

.side-menu a {
    display: block;

    padding: 14px 0;

    color: var(--text, #ffffff);

    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;

    text-decoration: none;

    transition:
        color 0.15s ease,
        background 0.15s ease;
}

.side-menu a:hover {
    color: #60a5fa;
}

.side-menu a:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 3px;
}


/* ==========================================================
   OVERLAY
========================================================== */

#overlay {
    position: fixed;
    z-index: 900;
    inset: 0;

    display: none;

    background: rgba(
        0,
        0,
        0,
        0.55
    );
}

#overlay.open {
    display: block;
}


/* ==========================================================
   BRUKERINFORMASJON
========================================================== */

.side-menu-user {
    margin-bottom: 18px;
    padding: 12px 4px 20px;

    border-bottom: 1px solid #334155;
}

.side-menu-user-type {
    margin-bottom: 10px;

    color: #9ca3af;

    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
}

.side-menu-user-number {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;

    color: #ffffff;

    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}

.side-menu-user-icon {
    display: block;

    font-size: 24px;
    line-height: 1;
}

.side-menu-user-name {
    margin-top: 4px;
    margin-left: 36px;

    color: #d1d5db;

    font-size: 20px;
    font-weight: 500;
    line-height: 1.35;

    overflow-wrap: anywhere;
}


/* ==========================================================
   HOVEDKNAPPER – MIN SIDE OG ADMINISTRASJON
========================================================== */

.side-menu-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    width: 100%;

    margin: 10px 0 16px;
    padding: 14px 0;

    background: transparent;
    color: #ffffff;

    border: 0;

    font-family: inherit;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;

    cursor: pointer;

    transition:
        color 0.15s ease;
}

.side-menu-parent:hover {
    color: #60a5fa;
}

.side-menu-parent:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 3px;
}

.side-menu-arrow {
    flex: 0 0 auto;

    margin-left: 12px;

    font-size: 21px;
    line-height: 1;
}


/* ==========================================================
   UNDERMENY
========================================================== */

.side-submenu {
    margin: -4px 0 18px 24px;
    padding-left: 14px;

    border-left: 2px solid #334155;
}

.side-submenu[hidden] {
    display: none;
}

.side-submenu a {
    margin: 0;
    padding: 10px 0;

    font-size: 19px;
    line-height: 1.4;
}


/* ==========================================================
   SKILLELINJE
========================================================== */

.side-menu-separator {
    margin: 18px 0;

    border: 0;
    border-top: 1px solid #334155;
}


/* ==========================================================
   VARSEL OM SKIFTINTERESSER
========================================================== */

.side-menu a.side-menu-skiftvarsel {
    display: grid;
    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;
    align-items: center;
    gap: 10px;

    margin: 14px 0 8px;
    padding: 13px 14px;

    background: rgba(
        202,
        138,
        4,
        0.18
    );

    color: #ffffff;

    border: 1px solid rgba(
        250,
        204,
        21,
        0.55
    );

    border-radius: 10px;
}

.side-menu a.side-menu-skiftvarsel:hover {
    background: rgba(
        202,
        138,
        4,
        0.28
    );

    color: #ffffff;
}

.side-menu-skiftvarsel-ikon {
    font-size: 23px;
    line-height: 1;
}

.side-menu-skiftvarsel-tekst {
    min-width: 0;

    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;

    overflow-wrap: anywhere;
}

.side-menu-skiftvarsel-antall {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 30px;
    height: 30px;
    padding: 0 8px;

    background: #facc15;
    color: #111827;

    border-radius: 999px;

    box-sizing: border-box;

    font-size: 15px;
    font-weight: 900;
}


/* ==========================================================
   MOBIL
========================================================== */

@media (max-width: 600px) {
    .side-menu {
        width: min(88vw, 340px);

        padding:
            max(20px, env(safe-area-inset-top))
            20px
            max(20px, env(safe-area-inset-bottom));
    }

    .side-menu a {
        font-size: 19px;
    }

    .side-menu-parent {
        font-size: 19px;
    }

    .side-submenu a {
        font-size: 18px;
    }

    .side-menu-user-number {
        font-size: 22px;
    }

    .side-menu-user-name {
        font-size: 18px;
    }
}


/* ==========================================================
   REDUSERT BEVEGELSE
========================================================== */

@media (prefers-reduced-motion: reduce) {
    .side-menu {
        transition: none;
    }
}

/* NESTET UNDERMENY – ADMINISTRER SJÅFØRER */

.side-submenu
.side-menu-nested-parent {
    margin: 2px 0 5px;
    padding: 11px 0;

    color: #e2e8f0;
    font-size: 18px;
}

.side-submenu-nested {
    margin: 0 0 10px 12px;
    padding-left: 13px;

    border-left: 2px solid #334155;
}

.side-submenu-nested a {
    padding: 10px 0;

    color: #cbd5e1;
    font-size: 17px;
}

.side-submenu-nested a:hover {
    color: #60a5fa;
}
