﻿@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    div {
        overflow: hidden;
    }

    body {
        font-family: Montserrat, sans-serif;
    }

    .monospace {
        font-family: "Roboto Mono", monospace;
    }

    .navbar a {
        @apply text-label;
        @apply hover:text-label-hover;
    }

    .navbar a.active {
        @apply text-label-hover;
    }

    @font-face {
        font-family: "icomoon";
        src: url("/resources/fonts/icons.ttf");
    }

    .icon {
        font-family: "icomoon", sans-serif;
    }

    .pixelated {
        -ms-interpolation-mode: nearest-neighbor;
        image-rendering: pixelated;
    }
}

@layer components {
    .icon-button {
        clip-path: polygon(0 0, 100% 0, 100% 75%, 75% 100%, 0 100%);
    }

    .clipping {
        position: relative;
    }

    .clipping::before, .clipping::before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        @apply bg-forkBlue-dark;
    }

    .clipping > div, .clipping > div {
        z-index: 1;
        position: relative;
    }

    .console-out-container::before {
        clip-path: polygon(0 0, calc(100% - 136px) 0, calc(100% - 90px) 48px, 100% 48px, 100% 100%, 0 100%);
    }

    .console-in-container::before {
        clip-path: polygon(0 25px, 50px 25px, 75px 0, 100% 0, 100% 100%, 0 100%);
    }

    .performance-background::before {
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 40px), calc(100% - 40px) 100%, 0 100%);
    }

    .ip-container::before {
        clip-path: polygon(0 25px, 60px 25px, 85px 0, 100% 0, 100% 100%, 0 100%);
    }

    .performance-container {
        min-height: 112px;
    }

    .clip-bottom-right {
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
    }

    .clip-top-left {
        clip-path: polygon(0 8px, 20px 8px, 30px 0, 100% 0, 100% 100%, 0 100%);
    }

    .performance-circle::before {
        @apply w-20;
        @apply h-20;
        @apply rounded-full;
        @apply bg-opacity-20 !important;
    }

    .console-text > div {
        overflow-wrap: break-word;
    }

    .console-text > div::selection {
        background: theme('colors.text.selection');
        @apply text-text-selected;
    }

    .console-text > div::-moz-selection {
        background: theme('colors.text.selection');
        @apply text-text-selected;
    }


    /* Scrollbar on Firefox */
    * {
        scrollbar-color: theme('colors.scrollbar.thumb.DEFAULT') theme('colors.scrollbar.background');
        scrollbar-width: thin;
    }

    /* Scrollbar on Chrome, Edge, and Safari */
    *::-webkit-scrollbar {
        width: 8px;
    }

    *::-webkit-scrollbar-track {
        background: theme('colors.scrollbar.background');
    }

    *::-webkit-scrollbar-thumb {
        background-color: theme('colors.scrollbar.thumb.DEFAULT');
        border-radius: 0;
        border: 0;
    }

    *::-webkit-scrollbar-thumb:hover {
        background-color: theme('colors.scrollbar.thumb.hover');
    }

    *::-webkit-scrollbar-thumb:active {
        background-color: theme('colors.scrollbar.thumb.active');
    }

    .scroll-left {
        direction: rtl;
    }

    .scroll-left > div {
        direction: ltr;
    }

    .scroll-hidden {
        scrollbar-width: none;
    }

    .scroll-hidden::-webkit-scrollbar {
        width: 0;
    }

    /* --- Inputs --- */
    /* Checkbox */
    label:hover input[type='checkbox'] + span {
        @apply bg-forkBlue-hover
    }

    input[type='checkbox']:checked + span {
        @apply bg-forkBlue-highlighted !important
    }

    /* Select */
    .select-wrapper {
        position: relative;
    }

    .select-wrapper select {
        clip-path: polygon(0 0, 100% 0, 100% 100%, calc(100% - 12px) 100%, calc(100% - 12px) calc(100% - 6px), calc(100% - 12px) 0, calc(100% - 18px) 0, calc(100% - 18px) calc(100% - 0px), calc(100% - 24px) 100%, 0 100%);
        cursor: pointer;
        padding-left: 1rem;
        padding-right: 2rem;
        outline: none;
    }

    .select-wrapper::after {
        position: absolute;
        content: ' ';
        top: 0;
        right: 0;
        bottom: 0;
        width: 12px;
        clip-path: polygon(calc(50% - 3px) calc(50% - 3px), calc(50% + 3px) calc(50% - 3px), 50% calc(50% + 3px));
        pointer-events: none;
        @apply bg-text-dark;
    }

    .select-wrapper select option {
        cursor: pointer;
    }
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4y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