@mixin drag {
  -webkit-app-region: drag;
}

@mixin noDrag {
  -webkit-app-region: no-drag;
}

@mixin font-inter {
  font-family: 'Inter', sans-serif;
}

@mixin font11-500 {
  font-style: normal;
  font-weight: 500;
  font-size: 0.785rem;
  line-height: 18px;
  letter-spacing: 0.03em;
}

@mixin font12-400 {
  font-style: normal;
  font-weight: 400;
  font-size: 0.8835rem;
  line-height: 18px;
  letter-spacing: -0.01em;
}

@mixin font12-500 {
  font-style: normal;
  font-weight: 500;
  font-size: 0.8835rem;
  line-height: 18px;
  letter-spacing: -0.01em;
}

@mixin font12-600 {
  font-style: normal;
  font-weight: 600;
  font-size: 0.8835rem;
  line-height: 18px;
  letter-spacing: -0.01em;
}

@mixin font14-500 {
  font-style: normal;
  font-weight: 500;
  font-size: 1rem;
  line-height: 22px;
}

@mixin font14-600 {
  font-style: normal;
  font-weight: 600;
  font-size: 1rem;
  line-height: 22px;
}

@mixin font-title {
  font-style: normal;
  font-weight: 700;
  font-size: 1.625rem;
  line-height: 155.2%;
}

@mixin font-h1 {
  font-style: normal;
  font-weight: 700;
  font-size: 1.571rem;
  line-height: 155.2%;
}

@mixin font-h2 {
  font-style: normal;
  font-weight: 700;
  font-size: 1.429rem;
  line-height: 155.2%;
}

@mixin font-h3 {
  font-style: normal;
  font-weight: 700;
  font-size: 1.286rem;
  line-height: 155.2%;
}

@mixin font-body {
  font-style: normal;
  font-weight: 400;
  font-size: 1.143rem;
  line-height: 155.2%;
}


@mixin font10-700 {
  font-style: normal;
  font-weight: 700;
  font-size: 9.7px;
  line-height: 16px;
  letter-spacing: 0.03em;
}

@mixin font-body {
  font-style: normal;
  font-weight: 400;
  font-size: 1.143rem;
  line-height: 155.2%;
}

@mixin ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@mixin animateOpacity {
  transition: opacity 0.15s cubic-bezier(0.83, 0, 0.17, 1);
  will-change: opacity;
}

@mixin animateBackgroundColor {
  transition: background 0.15s cubic-bezier(0.83, 0, 0.17, 1),
  color 0.15s cubic-bezier(0.83, 0, 0.17, 1),
  fill 0.15s cubic-bezier(0.83, 0, 0.17, 1),
  box-shadow 0.15s cubic-bezier(0.83, 0, 0.17, 1);
  will-change: background, color, fill, box-shadow;
}

@mixin inputMetaStyles {
  caret-color: #00f0ff;

  &::selection {
    background: rgba($turquoise, 0.3);
  }
}

@mixin scrollbarLight($offsetTop: 0px, $offsetBottom: 0px, $size: 6px, $borderRadius: 3px) {
  &::-webkit-scrollbar-track {
    background-color: transparent;
    margin-top: $offsetTop;
    margin-bottom: $offsetBottom;
  }

  &::-webkit-scrollbar {
    display: block;
    width: $size;
    height: $size;
    background-color: transparent;
    cursor: default;
  }

  &::-webkit-scrollbar-thumb {
    @include animateBackgroundColor;
    border-radius: $borderRadius;
    background: $blueGrey700;
    min-height: 50px;

    &:hover {
      background: $blueGrey600;
    }
  }
}

@mixin scrollbar($offsetTop: 0px, $offsetBottom: 0px, $size: 6px, $borderRadius: 3px) {
  &::-webkit-scrollbar-track {
    background-color: transparent;
    margin-top: $offsetTop;
    margin-bottom: $offsetBottom;
  }

  &::-webkit-scrollbar {
    display: block;
    width: $size;
    height: $size;
    background-color: transparent;
    cursor: default;
  }

  &::-webkit-scrollbar-thumb {
    @include animateBackgroundColor;
    border-radius: $borderRadius;
    background: $blueGrey800;
    min-height: 50px;

    &:hover {
      background: $blueGrey700;
    }
  }
}

@mixin editorStyling {
    @include font-body;
    color: var(--editor-text-color);

    .date-decoration {
        color: var(--accent-color);
    }

    .nonsuggestion {
    }

    .label {
        color: var(--accent-color);
    }

    &.ProseMirror-hideselection * {
        caret-color: transparent;
    }

    [data-type="taskItemContent"] {
        overflow: visible;
        position: relative;

        &::before {
            content: ' ';
            position: absolute;
            left: -26px;
            top: 50%;
            transform: translateY(-50%);
            width: 16px;
            height: 16px;
            border-radius: 50%;
        }
    }

    ul, li {
        overflow: visible;
    }

    [data-type="taskItemContent"][completed="false"] {
        &::before {
            background: red;
        }
    }

    [data-type="taskItemContent"][completed="true"] {
        &::before {
            background: yellow;
        }
    }

    p {
        line-height: 26px;
    }

    .text-highlight {
        color: var(--editor-text-color);
        padding: 3px;
        border-radius: 6px;
        -webkit-box-decoration-break: clone;
        -o-box-decoration-break: clone;
        box-decoration-break: clone;
    }

    .katex-display {
        padding: 10px 0px;
        margin: 0;
    }

    mark {
        color: var(--editor-text-color);
        background-color: var(--editor-mark-bg-color);
    }

    * {
        @include inputMetaStyles;
    }

    ul[data-type='taskList'] {
        list-style: none;
        padding: 0;

        li.task-item {
            display: flex;
            align-items: flex-start;
            margin-left: 0;
        }

        li:has:not(.task-item) {
            display: list-item;
        }

        p[data-type="taskItemContent"] {
            display: inline;
            min-width: 10px;

            &:before {
                margin-right: 8px;
                width: 16px;
                height: 16px;
                border-radius: 4px;
                border: 1px solid var(--editor-checkbox-color);
                display: block;
                position: relative;
                outline: none;
                appearance: none;
            }

            // [completed="true"]
            //&:before {
            //    position: absolute;
            //    left: -1px;
            //    top: -1px;
            //    display: block;
            //    content: '';
            //    background: url('/components/system/ACheck/check.svg');
            //    background-repeat: no-repeat;
            //    background-position: center;
            //    width: 16px;
            //    height: 16px;
            //}
        }


        /* Style the artificial checkbox */
        > label span {
            margin-right: 8px;
            width: 16px;
            height: 16px;
            border-radius: 4px;
            border: 1px solid var(--editor-checkbox-color);
            display: block;
            position: relative;
            outline: none;
            appearance: none;
        }

        /* Style its checked state...with a ticked icon */
        &[data-checked="true"] span {
            background: var(--editor-checkbox-color);
        }

        &[data-checked="true"] {
            color: var(--editor-checkbox-color);
        }

        [type='checkbox']:checked + span:before {
            position: absolute;
            left: -1px;
            top: -1px;
            display: block;
            content: '';
            background: url('/components/system/ACheck/check.svg');
            background-repeat: no-repeat;
            background-position: center;
            width: 16px;
            height: 16px;
        }
    }

    a {
        color: var(--accent-color);
        cursor: pointer;

        &:hover {
            text-decoration: underline;
        }
    }

    p > code {
        background: var(--editor-code-bg-color);
        padding: 3px 4px;
        border-radius: 3px;
        box-shadow: var(--editor-code-box-shadow);
        box-decoration-break: clone;
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        'Liberation Mono', 'Courier New', monospace;
        font-size: 13.6px;
        line-height: 20px;
    }

    pre {
        background: var(--editor-code-bg-color);
        padding: 10px 15px;
        border-radius: 6px;
        box-shadow: var(--editor-code-box-shadow);
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        'Liberation Mono', 'Courier New', monospace;
        font-size: 13.6px;
        line-height: 20px;

        > code {
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
            'Liberation Mono', 'Courier New', monospace;
        }

        .hljs-comment,
        .hljs-quote {
            color: var(--code-highlight-comment-color);
        }

        .hljs-variable,
        .hljs-template-variable,
        .hljs-attribute,
        .hljs-tag,
        .hljs-name,
        .hljs-regexp,
        .hljs-link,
        .hljs-name,
        .hljs-selector-id,
        .hljs-selector-class {
            color: var(--code-highlight-variable-color);
        }

        .hljs-number,
        .hljs-meta,
        .hljs-built_in,
        .hljs-builtin-name,
        .hljs-literal,
        .hljs-type,
        .hljs-params {
            color: var(--code-highlight-type-color);
        }

        .hljs-string,
        .hljs-symbol,
        .hljs-bullet {
            color: var(--code-highlight-string-color);
        }

        .hljs-title,
        .hljs-section {
            color: var(--code-highlight-title-color);
        }

        .hljs-keyword,
        .hljs-selector-tag {
            color: var(--code-highlight-keyword-color);
        }

        .hljs-emphasis {
            font-style: italic;
        }

        .hljs-strong {
            font-weight: 700;
        }
    }

    h1 {
        @include font-h1;
        margin-top: 8px;
    }

    h2 {
        @include font-h2;
        margin-top: 8px;
    }

    h3,
    h4,
    h5,
    h6 {
        @include font-h3;
        margin-top: 5px;
    }

    blockquote {
        padding-left: 15px;
        border-left: 3px solid var(--editor-blockquote-border-color);
    }

    hr {
        margin: 10px 0;
        border-color: var(--editor-hr-color);
    }

    span[id]:not(.inline-document-link) {
        text-decoration: underline;
        text-decoration-color: var(--accent-color);
        text-decoration-thickness: 2px;
    }

    .ProseMirror-gapcursor {
        width: 100%;

        &::after {
            border-top-color: var(--accent-color);
            width: 100%;
        }
    }

    img.ProseMirror-separator {
        display: inline !important;
        padding: 0;
    }

    .editor-image {
        width: 100%;
    }

    .skeleton-loader:empty {
        max-width: 510px;
        width: 100%;
        padding-top: 56%;
        display: block;
        background: linear-gradient(
                90deg,
                rgba(52, 60, 75, 0) 0%,
                rgba(107, 120, 143, 0.2) 52.08%,
                rgba(0, 0, 0, 0) 100%
        ),
        #272d38;
        background-repeat: repeat-y;
        background-size: 510px 100%;
        background-position: calc(-100% - 510px) 0;
        animation: shine 1s infinite;
        border-radius: 4px;
    }

    table {
        table-layout: fixed;
        margin: 0;
        overflow: auto;
        position: relative;
        border: 1px solid var(--editor-table-border-color);
        cursor: text;

        th {
            border: 1px solid var(--editor-table-border-color);
            background: var(--editor-table-header-bg-color);
            text-align: left;
            padding: 3px 5px;
            vertical-align: top;
            font-weight: 500;

            p {
                padding: 0;
            }

            > * {
                margin-bottom: 0;
            }
        }

        td {
            min-width: 6em;
            border: 1px solid var(--editor-table-border-color);
            padding: 3px 5px;
            vertical-align: top;
            position: relative;

            > * {
                margin-bottom: 0;
            }

            p {
                padding: 0;
            }
        }

        .selectedCell:after {
            z-index: 2;
            position: absolute;
            content: '';
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            background: var(--editor-table-selection-color);
            pointer-events: none;
        }

        .column-resize-handle {
            position: absolute;
            right: -1px;
            top: 0;
            bottom: -1px;
            width: 2px;
            background-color: var(--accent-color);
            pointer-events: none;
        }
    }

    .tableWrapper {
        @include scrollbar;
        max-width: 100%;
        overflow-x: auto;
        cursor: default;
    }

    &.resize-cursor table {
        cursor: col-resize !important;
    }

    ul {
        list-style-type: '–  ';

        ::marker {
            color: var(--editor-list-marker-color);
            font-weight: 500;
        }
    }

    > ul > li.list-item--task {
        margin-left: 0;
    }

    > ol > li.list-item--task {
        margin-left: 0;
    }

    li {
        margin-left: 22px;

        &.list-item--task {
            list-style-type: none;
        }
    }

    ol {
        ::marker {
            color: var(--editor-list-marker-color);
            font-weight: 500;
        }

        list-style: decimal;

        &.list-item--task {
            list-style-type: none;
        }
    }

    .search-result {
        background: var(--editor-search-result-bg-color);
        color: var(--editor-search-result-text-color);
        border-radius: 3px;
        -webkit-box-decoration-break: clone;
        -o-box-decoration-break: clone;
        box-decoration-break: clone;
    }

    .search-result-selected {
        background: var(--editor-search-result-bg-color__active);
        color: var(--editor-search-result-text-color__active);
        border-radius: 3px;
        -webkit-box-decoration-break: clone;
        -o-box-decoration-break: clone;
        box-decoration-break: clone;
    }


}

@mixin drag {
  -webkit-app-region: drag;
}

@mixin noDrag {
  -webkit-app-region: no-drag;
}

@mixin frostedGlass {
  -webkit-backdrop-filter: blur(12px); /* Safari 9+ */
  backdrop-filter: blur(12px); /* Chrome and Opera */
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.06),
  0px 12px 50px rgba(0, 0, 0, 0.05),
  inset 0px 0px 0px 1px rgba(241, 241, 241, 0.02);
}

@mixin frostedGlassBackgroundLight {
  @include frostedGlass;
  border: 0.5px solid rgba(0, 0, 0, 0.02);
  background: rgba($white, 0.83);
}

@mixin frostedGlassBackground {
  @include frostedGlass;
  border: 1px solid #3e4856;
  background: rgba($blueGrey800, 0.83);
}
