:root {
    --navWidth: 300px;
    --designerWidthBreakpoint: 900px;
    scroll-behavior: smooth;
}

::-webkit-scrollbar-track
{
	border-radius: 10px;
	background-color: #a8a8a8;
}

::-webkit-scrollbar
{
	width: 8px;
    height: 8px;
	background-color: #a8a8a8;
}

::-webkit-scrollbar-thumb
{
	background-color: var(--taurusNetworkDarkBlue);
}

header.site-header {
    position: fixed;
    z-index: 50;

    .container {
        max-width: unset;
        justify-content: space-between;
    }

    .user {
        display: flex;
        gap: 20px;
        color: white;
        align-items: center;
        margin-left: 20px;
        width: 500px;

        div.menu-toggle {
            display: block !important;
            width: 30px;
            flex-shrink: 0;

            svg {
                fill: white;

                &:hover {
                    fill: var(--taurusNetworkPrimary);
                }
            }
        }

        div.avatar {
            width: 50px;
            height: 50px;
            border-radius: var(--borderRadius);
            background-color: silver;
            flex-shrink: 0;
            background-size: cover;
            background-repeat: no-repeat;

            display: flex;
            justify-content: center;
            align-items: center;

            > div.initials {
                font-weight: bold;
                font-size: 18px;
            }
        }

        div.identity {
            .name {
                font-weight: bold;
                font-size: 18px;
            }

            .email {
                font-size: 12px;
            }

            width: 200px;
            overflow: hidden;
            
            >span {
                text-wrap: nowrap;
                text-overflow: ellipsis;
                overflow: hidden;
                width: 170px;
                display: block;
            }
        }

        a.logout {
            flex-shrink: 0;
            svg {
                width: 30px;
                fill: white;

                &:hover {
                    fill: var(--taurusNetworkPrimaryDark);
                }
            }
        }

        a.impersonating {
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
        }
    }
}

div.designer {
    height: 80vh;

    > .auth {
        height: 100%;
        padding: 50px;
        padding-left: 150px;
        display: flex;
        flex-direction: column;
        justify-content: center;

        > .decorator {
            background-image: url("../images/authentication/pexels-andrea-piacquadio-3771079-xJ8NKey.jpg");
            background-size: cover;
            background-repeat: no-repeat;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: -1;
        }

        @media screen and (max-width: 750px) {
            padding-left: 50px;
        }

        @media screen and (max-width: 600px) {
            padding: 10px;
        }
    }

    > nav.navigation {
        --shuntHeight: 0px;

        display: none;
        position: fixed;
        z-index: 49;
        top: calc(var(--headerHeight) + var(--shuntHeight));
        left: 0;
        bottom: 0;
        width: var(--navWidth);
        background-color: white;
        box-shadow: 0px -4px 8px rgba(0, 0, 0, 0.25);
        padding-bottom: 40px;
        overflow-x: hidden;
        overflow-y: auto;

        div.has-children {
            div.caret {
                margin-left: auto;
                margin-right: 20px;

                svg {
                    width: 12px;
                }
            }

            a {
                cursor: pointer;
            }

            &.open {
                div.caret {
                    svg {
                        transform: rotate(180deg);
                    }
                }

                ul.children {
                    display: block;
                }
            }
        }

        a:not(.button) {
            text-decoration: none;
            color: black;
            font-weight: bold;

            &:visited {
                color: black;
            }

            &:not(.child) {
                &:hover,&.active {
                    background-color: var(--taurusNetworkPrimaryDark);

                    > li {
                        background-color: var(--taurusNetworkPrimaryDark);
                    }

                    color: white;
                    svg {
                        fill: white;
                    }
                }
            }

            &[href='#'] {
                text-decoration: line-through;
            }
        }

        a.button {
            width: 80%;
            margin-left: auto;
            margin-right: auto;
        }

        > ul {
            margin-top: 30px;
            padding-inline-start: 0;

            a > li {
                list-style-type: none;
                display: flex;
                flex-wrap: wrap;
                align-items: center;
                gap: 20px;
                padding: 10px;
                padding-left: 30px;

                > svg {
                    width: 20px;
                    margin-top: -5px;
                }
            }

            ul.children {
                display: none;
                margin-bottom: 10px;

                &.visible {
                    display: block;
                }
                
                li {
                    list-style-type: none;
                    margin-left: 30px;
                    font-weight: normal;
                    padding: 5px;
                    font-size: 15px;
                }

                a:hover, a.active {
                    > li {
                        font-weight: bold;
                    }
                }
            }
        }

        > div.section-break {
            margin: 30px;
            border-top: var(--taurusNetworkDarkBlue) 1px solid;
        }

        > a.site-selector {
            display: flex;
            gap: 10px;
            align-items: center;
            padding: 30px;
            padding-top: 10px;
            padding-bottom: 10px;
            margin-bottom: 0;

            div.badge {
                background-color: var(--sitePrimaryColour, transparent);
                height: 50px;
                width: 50px;
                aspect-ratio: 1/1;
                border-radius: var(--borderRadius);
                
                background-image: var(--siteBrandLogo);
                background-size: 70%;
                background-repeat: no-repeat;
                background-position: center;
            }

            div.content {
                flex-grow: 1;
                span {
                    display: block;
                    text-wrap: nowrap;
                    text-overflow: ellipsis;
                    overflow: hidden;
                    width: 160px;

                    &.title {
                        font-weight: normal;
                    }
                }
            }

            div.selector {
                flex-shrink: 0;
                width: 10px;
            }

            span.badge {
                width: fit-content !important;
                font-size: small;
                background-color: var(--warningColour);
            }
        }

        div.tn-branding {
            text-align: center;
            margin-top: 40px;
            font-size: 14px;

            svg {
                height: 15px;
                display: inline;
            }

            img {
                width: 50px;
                display: block;
                margin-left: auto;
                margin-right: auto;
            }
        }

        &[data-is-condensed="yes"] {
            > ul {
                li {
                    padding-top: 8px;
                    padding-bottom: 8px;

                    font-size: 14px;
                }
            }

            ul.children {
                li {
                    font-size: 14px;
                }
            }
        }
    }

    > main.page {
        padding: 50px;
        padding-top: calc(var(--headerHeight) + 50px);

        @media screen and (max-width: 800px) {
            padding: 20px;
            padding-top: calc(var(--headerHeight) + 20px);
        }

        @media screen and (max-width: 600px) {
            padding: 10px;
            padding-top: calc(var(--headerHeight) + 10px);
        }
        
        div.header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
        }
    }
}

body {
    @media screen and (max-width: 900px) {
        header { 
            div.identity {
                display: none;
            }

            div.brand > .text {
                display: none;
            }

            div.user {
                width: 200px !important;
            }
        }

        main.page {
            margin-left: unset !important;
        }

        &.open-nav nav.navigation > div.backdrop {
            position: fixed;
            top: 0;
            right: 0;
            bottom :0;
            left: var(--navWidth);
            background-color: rgba(0, 0, 0, 0.25);
            z-index: 49;
        }
    }

    &.open-nav {
        nav.navigation {
            display: block;
        }

        main.page {
            margin-left: var(--navWidth);
        }
    }
}



div.cards {
    --gap: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);

    &.half {
        > .card {
            width: calc(50% - (var(--gap) / 2));

            @media screen and (max-width: 768px) {
                width: 100%;
            }
        }
    }

    &.third {
        > .card {
            width: calc(33% - (var(--gap) / 3) - 8px);

            @media screen and (max-width: 768px) {
                width: 100%;
            }
        }
    }

    &.full {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;

        > .card {
            width: 100%;
        }
    }

    &.centered {
        height: 75vh;
        align-items: center;
        justify-content: center;
    }

    &.standard {
        .card {
            .badge {
                width: 80px;
                height: 80px;
                flex-shrink: 0;
                border-radius: var(--borderRadius);
                background-color: var(--sitePrimaryColour);
                background-image: var(--siteBrandLogo);
                background-size: 70%;
                background-repeat: no-repeat;
                background-position: center;

                &.add {
                    background-color: unset;
                    display: flex;
                    align-items: center;
                    justify-content: center;

                    svg {
                        width: 30px;
                    }
                }
            }

            display: flex;
            flex-direction: column;
            flex-wrap: nowrap;
            align-items: center;
            justify-content: space-between;
        }
    }

    &.no-stretch {
        align-items: flex-start;
    }
}

form.block-builder {
    display: flex;
    gap: 10px;

    div.options {
        width: 400px;
    }

    iframe.preview {
        flex-grow: 1;
        min-width: 0;
        height: fit-content;

        border: solid 1px var(--taurusNetworkDarkBlue);
    }

    @media screen and (max-width: 800px) {
        flex-wrap: wrap;
        div.options,iframe.preview {
            width: 100%;
        }
    }
}

div.badges {
    display: flex;
    gap: 10px;

    &.center {
        justify-content: center;
    }
}

span.badge {
    background-color: var(--taurusNetworkPrimaryDark);
    color: white;
    font-weight: bold;
    padding: 2px;
    border-radius: 6px;
    padding-left: 6px;
    padding-right: 6px;

    &.large {
        padding: 12px;
    }

    &.secondary {
        background-color: var(--taurusNetworkGrey);
    }

    &.small {
        font-weight: normal;
        padding-left: 4px;
        padding-right: 4px;
    }

    &.success {
        background-color: var(--successColour);
    }

    &.negative {
        background-color: var(--dangerColour);
    }

    &.warning {
        background-color: var(--warningColour);
    }

    &.experiment {
        background-color: var(--experimentColour);
    }
}

div.paginator {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 18px;

    a {
        background-color: var(--taurusNetworkPrimary);
        color: white;
        text-align: center;
        padding: 5px;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;

        text-decoration: none !important;
        &:visited {
            color: white !important;
        }

        svg {
            height: 20px;
            fill: white;
        }

        &.active {
            background-color: var(--taurusNetworkDarkBlue);
        }

        &.disabled {
            background-color: var(--taurusNetworkDarkBlue);
            opacity: 0.6;
        }
    }

    form {
        display: flex;
        align-items: center;
        gap: 5px;
    }
}

div.header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

div.empty {
    margin: 50px;

    svg {
        width: 100px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 20px;
    }

    text-align: center;

    div.button-row {
        justify-content: center;
    }
}

[data-draggable-wrapper] {
    > [draggable="true"] {
        cursor: move;

        &.drop-above {
            border-top: solid 50px transparent;
        }

        &.drop-below {
            border-bottom: solid 50px transparent;
        }
    }
}

div.transactions {
    width: 100%;
    
    div.header {
        display: flex;
        justify-content: space-between;
    }

    div.transaction {
        width: 100%;

        div.stamps {
            margin-top: 18px;
            display: flex;

            gap: 20px;

            >div {
                flex-grow: 1;
            }

            text-align: center;

            svg {
                height: 40px;
                margin-left: auto;
                margin-right: auto;
            }

            p.details {
                font-size: 0.8rem;
            }
        }
    }
}

div.healthcheck-status-badge {
    display: flex;
    flex-wrap: nowrap;
    gap: 25px;
    align-items: center;

    &.center {
        justify-content: center;
    }

    &.good {
        svg {
            fill: var(--successColour);
        }
    }

    &.bad {
        svg {
            fill: var(--dangerColour)
        }
    }

    &.not-checked {
        svg {
            fill: var(--warningColour);
        }
    }

    > div.icon {
        width: 50px;
    }

    > div.text {
        > .label {
            font-weight: bold;
            font-size: 18px;
        }
    }
}