﻿@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
@import "darkModeReset.css";
@import "darkModeOneShots.css";

:root {
    --blue-90: hsla(190, 67%, 56%, 1);
    --clr-safe: #0ab08a;
    --clr-danger: #EA1336;
    --clr-warning: #ff9800;
    --clr-neutral: #979391;
    --clr-unavailable: #FFFFFF;
    --border: 1px solid hsla(0, 0%, 100%, 0.1);
    font-family: "Lato", sans-serif;
    font-size: 0.875rem;
}

body {
    color: white;
}

.modal {
    background: linear-gradient(35.9deg, #020B15 42.41%, #112A4A 77.95%, #133B63 86.86%, #112A4A 97.58%);

    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    padding: 16px 32px;
    overflow-y: scroll;

    > .close {
        position: absolute;
        top: 16px;
        right: 16px;
    }

    > header {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 32px;

        &:has(:only-child) {
            justify-self: center;
        }
    }
}

hr {
    color: hsla(213, 23%, 23%, 1);
    background-color: hsla(213, 23%, 23%, 1);
    border: none;
    height: 1px;
    margin-top: 32px;
    margin-bottom: 16px;
}

abbr {
    text-decoration: none;
}

.card,
.cards > * {
    background: hsla(213, 41%, 9%, 1);
    border-radius: 8px;
    border: var(--border);
    margin-bottom: 16px;
    padding: 16px;

    .card,
    .cards > * {
        background: hsla(213, 30%, 12%, 1);
        border: none;
    }

    &:has(+ hr) {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        margin-bottom: 2px;
    }

    & + hr {
        display: none;
    }

    hr + & {
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }

    header:has(+ &) {
        display: flex;
        gap: 16px;
        border-bottom: 1px solid hsla(213, 23%, 23%, 1);
        padding-bottom: 12px;
        margin-top: 48px;
        margin-bottom: 24px;
        width: 100%;
        align-items: center;

        > *:last-child:is(div, span, p) {
            margin-left: auto;
        }
    }
}

.clipboard-field {
    display: grid;
    grid-template-columns: minmax(auto, min-content) max-content;
    gap: 16px;
    > *:first-child {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

button.icon, .button.icon {
    display: flex;
    justify-content: center;
    align-items: center;
    -moz-transition: all 0.5s linear;
    -webkit-transition: all 0.5s linear;
    transition: all 0.5s linear;
    padding: 0;
    border: none;
    background: none;

    &:active {
        transform: scale(0.5);
    }

    &:focus, &:hover, &:active {
        border: none;
        box-shadow: none;
        background: none;
        outline: none;
    }
}

.filepath {
    display: flex;
    min-width: 0;

    > .stem {
        flex-basis: 0;
        flex-grow: 1;
        max-width: max-content;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    > .extension {
        flex-basis: content;
    }
}

.layout-sidebar {
    display: grid;
    grid-template-columns: max-content auto;
    gap: 48px;

    > :first-child {
        min-width: 304px;
    }

    > :last-child {
        margin-top: 20px;
        margin-right: 24px;

        > header > h2 {
            margin-bottom: 8px;
        }
    }
}

.layout-double-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;

    & + div.clipboard-field {
        margin-top: 8px;
    }
}

.tab,
.tabs > * {
    background: var(--tab-background-clr);
    border-radius: 8px;
    border: var(--border);
    cursor: pointer;
    transition: all 0.1s;
    --tab-background-clr: hsla(213, 30%, 12%, 1);
    --selected-clr: hsla(213, 23%, 23%, 1);

    &:hover {
        background: hsla(212, 22%, 15%, 1);
    }

    &:not(:last-child) {
        margin-bottom: 16px;
    }

    > header {
        padding: 16px;
        font-weight: 700;
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;

        > * {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        span {
            font-size: 12px;
            font-weight: 700;
        }

        img {
            height: 28px;
        }

        i {
            background-color: white;
        }
    }

    &.selected {
        background: var(--selected-clr);
    }

    &.selected > header::after {
        --width: 14px;
        --height: 16px;
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        width: var(--width);
        height: var(--height);
        transform: translate(100%, -50%);
        border-left: var(--width) solid var(--selected-clr);
        border-top: calc(var(--height) / 2) solid transparent;
        border-bottom: calc(var(--height) / 2) solid transparent;
    }

    &.disabled {
        background: var(--tab-background-clr);
        cursor: auto;
        
        > header {
            >* {
                gap: 6px;
            }

            img {
                height: 18px;
            }
        }
    }


    > div {
        padding: 16px;
    }

    > header:not(:only-child) {
        border-bottom: var(--border);
    }

    .info-block,
    .info-blocks > * {
        img {
            width: 48px;
            height: 48px;
        }
    }

}

.info-block,
.info-blocks > * {
    display: grid;
    grid-template-columns: max-content max-content;
    align-items: center;
    column-gap: 16px;
    padding: 16px 0;

    &:not(:last-child) {
        margin-bottom: 8px;
    }

    > *:first-child {
        grid-row: span 2;
    }

    > p:first-of-type + p  {
        color: #9FA5B1;
        font-size: 12px;

        > img {
            margin-left: 0;
            margin-right: 8px;
            vertical-align: bottom;
        }
    }
}

dl {
    display: grid;
    grid-template-columns: subgrid;
    row-gap: 8px;
    column-gap: 24px;

    > dd:not(:last-child) {
        padding-bottom: 8px;
    }

    > .card {
        display: grid;
        grid-template-columns: subgrid;
        grid-column: span 2;
        margin: 0;
        padding-top: 10px;
        padding-bottom: 10px;

        > dt {
            padding-left: 24px;
        }
    }
}

.layout-dictionary {
    display: grid;
    grid-template-columns: max-content auto;
    row-gap: 16px;
    column-gap: 24px;
    margin-top: 16px;

    > dl {
        grid-column: span 2;
    }
}

.buttons {
    display: flex;
    gap: 8px;
}

button,
.button {
    cursor: pointer;
    background: var(--blue-90);
    border-radius: 4px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-weight: 500 !important;
    font-size: 14px !important;
    transition: 0.1s all;
    border: 1px solid transparent;
    outline: none;

    &:hover {
        box-shadow: 0 0 4px 0 var(--blue-90);
        border: 1px solid #B0E5EF;
    }

    &:focus {
        border: 1px solid black;
        box-shadow: 0 0 0 2px var(--blue-90), /* solid shadow acting as another border */
            0 0px 4px 2px var(--blue-90); /* soft shadow 'glow' */
    }

    &:disabled {
        background: #2E3A49;
        color: #9FA5B1;
        box-shadow: none;
        border: none;
        cursor: default;
    }

    &.secondary {
        background: transparent;
        color: #FFFFFF;
        border: 1px solid var(--blue-90);

        &:hover {
            background-color: hsla(190, 67%, 56%, 0.1);
        }

        &:focus {
            outline: 1px solid black;
            box-shadow: 0 0 0 3px var(--blue-90), /* solid shadow acting as a third border */
                0 0 4px 3px var(--blue-90); /* soft shadow 'glow' */
        }

        &:disabled {
            outline: none;
            box-shadow: none;
            background: transparent;
            border: 1px solid #2E3A49;
            color: #9FA5B1;

            i {
                color: #9FA5B1;
            }
        }

        > i {
            color: var(--blue-90);
        }
    }

    &.tertiary {
        background: transparent;
        color: var(--blue-90);
        text-decoration: underline;
        text-underline-offset: 4px;

        &:hover {
            border: 1px solid var(--blue-90);
            box-shadow: 0 0 4px 0 var(--blue-90);
        }

        &:focus {
            border: 1px solid transparent;
            box-shadow: 0 0 0 2px var(--blue-90),
                0 0px 4px 2px var(--blue-90);
        }

        &:disabled {
            border: none;
            text-decoration: none;
            color: #9FA5B1;
            box-shadow: none;
            cursor: default;
        }
    }

    > i {
        display: inline-block;
        background-color: currentColor;
    }
}

.highlight {
    display: flex;
    align-items: center;

    > *:first-child {
        padding: 32px;
        min-width: 296px;
        text-align: center;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto 1fr;
        grid-template-areas: 
            "."
            "img"
            "caption";
        justify-items: center;
        gap: 8px;
        position: relative;

        &::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-image: url(/assets/spider-inner.png);
            width: 152px;
            aspect-ratio: 495 / 443;
            background-size: contain;
            background-repeat: no-repeat;
            opacity: 0.2;
            z-index: 50;
        }

        &::after{
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            mask-image: url(/assets/spider-outer.svg);
            width: 237px;
            height: 200px;
            opacity: 0.2;
            z-index: 20;
            background-color: hsla(0, 0%, 61%, 1);

        }

        > img {
            width: 64px;
            height: 64px;
            grid-area: img;
        }

        > * {
            z-index: 100;
        }

        > *:last-child {
            grid-area: caption;
        }
    }

    > *:last-child {
        flex-grow: 1;
        padding: 36px 48px 36px 64px;
        min-height: 128px;
        align-content: center;
        border-left: 1px solid hsla(213, 23%, 23%, 1);

        > p:not(:last-child) {
            margin-bottom: 8px;
        }
    }
}

a {
    text-decoration: underline;
    text-underline-offset: 4px;
    color: hsla(190, 67%, 56%, 1);
}

h1 {
    font-size: 34px;
}

h2 {
    font-weight: 700;
    font-size: 30px;
}

h3 {
    font-weight: 700;
    font-size: 24px;
}

h5 {
    font-weight: 700;
    font-size: 16px;
}

h6 {
    font-weight: 700;
    font-size: 14px;
}

:is(p, a) > :is(i, img) {
    display: inline-block;
    vertical-align: middle;
    margin: 0 4px;
}

header > :is(p, a) > i {
    background-color: currentColor;
}

.text-safe {
    color: var(--clr-safe);
}

.text-danger {
    color: var(--clr-danger);
}

.text-warning {
    color: var(--clr-warning);
}

.text-neutral {
    color: var(--clr-neutral);
}

.text-unavailable {
    color: var(--clr-unavailable);
}

i {
    display: block;
    aspect-ratio: 1 / 1;
    height: 1em; /*Deliberate em usage so icons fit to current font*/
    mask-repeat: no-repeat;
    mask-position: center;

    &.download {
        -webkit-mask-image: url(/assets/download.svg);
        mask-image: url(/assets/download.svg);
    }

    &.back {
        -webkit-mask-image: url(/assets/back.svg);
        mask-image: url(/assets/back.svg);
    }

    &.forward {
        -webkit-mask-image: url(/assets/forward.svg);
        mask-image: url(/assets/forward.svg);
    }

    &.external {
        -webkit-mask-image: url(/assets/external.svg);
        mask-image: url(/assets/external.svg);
        background: var(--blue-90);
    }

    &.clipboard {
        -webkit-mask-image: url(/assets/clipboard.svg);
        mask-image: url(/assets/clipboard.svg);
        background: var(--blue-90);
    }

    &.accordion-arrow {
        -webkit-mask-image: url(/assets/accordion-arrow.svg);
        mask-image: url(/assets/accordion-arrow.svg);
    }

    &.circled-tick {
        background-image: url(/assets/circled-tick.svg);
        height: 20px;
    }

    &.circled-alert {
        background-image: url(/assets/circled-alert.svg);
        height: 20px;
    }

    &.high-risk {
        background-image: url(/assets/high-risk.svg);
        height: 20px;
    }

    &.medium-risk {
        background-image: url(/assets/medium-risk.svg);
        height: 20px;
    }

    &.low-risk {
        background-image: url(/assets/low-risk.svg);
        height: 20px;
    }
}


.accordion {
    display: grid;
    grid-template-rows: max-content 0fr;
    transition: grid-template-rows 0.5s;
    padding-left: 12px;

    &.open {
        grid-template-rows: max-content 1fr;

        > header > :first-child::before {
            transform: scale(-1);
        }

    }

    &:not(:first-of-type) {
        border-top: 1px solid #ffffff10;
        padding-top: 16px;
    }

    &:not(:last-of-type) {
        padding-bottom: 16px;
    }

    > :last-child {
        overflow: hidden;
    }

    > header {
        cursor: pointer;
        display: flex;
        justify-content: space-between;

        > * {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        > *:first-child::before {
            content: '';
            width: 16px;
            height: 16px;
            transform: scale(1);
            -webkit-mask: url(/assets/accordion-arrow.svg) no-repeat center;
            mask: url(/assets/accordion-arrow.svg) no-repeat center;
            mask-size: contain;
            background-color: var(--blue-90);
            transition: 0.3s ease;
            margin-right: 8px;
        }
    }

    > div > div {
        padding-top: 8px;
        margin: 0 0 8px 32px;

        > .accordion:first-of-type {
            padding-top: 32px;
        }

        > p {
            &:first-of-type {
                color: #9FA5B1;
                font-size: 12px;
            }

            + h6 {
                margin-top: 8px;

                + ul {
                    padding-left: 20px;
                }
            }
        }
    }
}

.pointer {
    cursor: pointer;
    padding: 2px;
    border: 1px solid transparent;
    transition: 0.1s all;

    &:hover {
        border: 1px solid var(--blue-90);
        box-shadow: 0 0 4px 0 var(--blue-90);
    }

    &:focus {
        border: 1px solid transparent;
        box-shadow: 0 0 0 2px var(--blue-90),
            0 0px 4px 2px var(--blue-90);
    }
}