@tailwind base;

/* Firefox */
* {
  scrollbar-width: thin !important;
  scrollbar-color: transparent !important;
}

/* Chrome, Edge, and Safari */
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}

*::-webkit-scrollbar-track {
  background: transparent !important;
}

*::-webkit-scrollbar-thumb {
  background-color: transparent !important;
  border-radius: 0 !important;
  border: none !important;
}

@tailwind components;
@tailwind utilities;

/* lexical editor */
.code-editor code[class*="language-"],
.code-editor pre[class*="language-"] {
  color: #d6deeb;
  font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.5;
  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}
.code-editor code[class*="language-"] ::-moz-selection,
.code-editor code[class*="language-"]::-moz-selection,
.code-editor pre[class*="language-"] ::-moz-selection,
.code-editor pre[class*="language-"]::-moz-selection {
  text-shadow: none;
  background: rgba(29, 59, 83, 0.99);
}
.code-editor code[class*="language-"] ::selection,
.code-editor code[class*="language-"]::selection,
.code-editor pre[class*="language-"] ::selection,
.code-editor pre[class*="language-"]::selection {
  text-shadow: none;
  background: rgba(29, 59, 83, 0.99);
}
@media print {
  .code-editor code[class*="language-"],
  .code-editor pre[class*="language-"] {
    text-shadow: none;
  }
}
.code-editor pre[class*="language-"] {
  padding: 1em;
  margin: 0.5em 0;
  overflow: auto;
}
.code-editor :not(pre) > code[class*="language-"],
.code-editor pre[class*="language-"] {
  color: #fff;
  background: #011627;
}
.code-editor :not(pre) > code[class*="language-"] {
  padding: 0.1em;
  border-radius: 0.3em;
  white-space: normal;
}
.code-editor .token.cdata,
.code-editor .token.comment,
.code-editor .token.prolog {
  color: #637777;
}
.code-editor .token.punctuation {
  color: #c792ea;
}
.code-editor .namespace {
  color: #b2ccd6;
}
.code-editor .token.deleted {
  color: rgba(239, 83, 80, 0.56);
}
.code-editor .token.property,
.code-editor .token.symbol {
  color: #80cbc4;
}
.code-editor .token.keyword,
.code-editor .token.operator,
.code-editor .token.tag {
  color: #7fdbca;
}
.code-editor .token.boolean {
  color: #ff5874;
}
.code-editor .token.number {
  color: #f78c6c;
}
.code-editor .token.builtin,
.code-editor .token.char,
.code-editor .token.constant,
.code-editor .token.function {
  color: #82aaff;
}
.code-editor .token.doctype,
.code-editor .token.selector {
  color: #c792ea;
}
.code-editor .token.attr-name,
.code-editor .token.inserted {
  color: #addb67;
}
.code-editor .language-css .token.string,
.code-editor .style .token.string,
.code-editor .token.entity,
.code-editor .token.string,
.code-editor .token.url {
  color: #addb67;
}
.code-editor .token.atrule,
.code-editor .token.attr-value,
.code-editor .token.class-name {
  color: #ffcb8b;
}
.code-editor .token.important,
.code-editor .token.regex,
.code-editor .token.variable {
  color: #d6deeb;
}
.code-editor .token.bold,
.code-editor .token.important {
  font-weight: 700;
}

/* Rehype Pretty Code */
[data-rehype-pretty-code-fragment] {
  position: relative;
}

[data-rehype-pretty-code-fragment] pre {
  background-color: #1e293b;
  max-height: 32rem;
  margin: 0;
  padding: 1.25rem;
  border-radius: 0.5rem;
  border: 0;
  overflow: scroll;
}

.code-preview [data-rehype-pretty-code-fragment] pre {
  max-height: max-content;
  border: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

[data-rehype-pretty-code-fragment] .highlighted::after {
  content: " +";
  display: grid;
  align-items: center;
  width: calc(100% + 2.5rem);
  height: 100%;
  color: #4ade80;
  font-size: 0.875rem;
  position: absolute;
  top: 0;
  left: -1.25rem;
  z-index: 0;
  border-left: 0.2rem solid #4ade80;
  background-color: rgba(74, 222, 128, 0.1);
}

[data-rehype-pretty-code-fragment] .word {
  padding: 0.0875rem 0.125rem;
  border-radius: 0.25rem;
  background-color: rgba(74, 222, 128, 0.15);
}

[data-rehype-pretty-code-fragment] code {
  display: block;
  width: 100%;
  font-family: "Fira Code";
  font-size: 1rem;
  counter-reset: line;
}

table tbody tr td code {
  font-weight: 600;
}

[data-rehype-pretty-code-fragment] code .line {
  display: inline-block;
  width: 100%;
  position: relative;
}

[data-rehype-pretty-code-fragment] .line.highlighted span {
  position: relative;
  z-index: 2;
}

[data-rehype-pretty-code-fragment] code > .line::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 1rem;
  margin-right: 1.125rem;
  text-align: right;
  color: rgba(255, 255, 255, 0.25);
}

.DocSearch-Container {
  z-index: 9999 !important;
}

.DocSearch-Button {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  border-radius: 6px !important;
}

.lexical h1 {
  @apply block font-sans text-4xl font-semibold leading-[1.3] tracking-normal text-inherit antialiased;
}

.lexical h2 {
  @apply block font-sans text-3xl font-semibold leading-snug tracking-normal text-inherit antialiased;
}

.lexical p {
  @apply block font-sans text-base font-normal leading-relaxed text-inherit antialiased;
}

.lexical ul {
  @apply list-inside list-disc;
}

.lexical ol {
  @apply list-inside list-decimal;
}

.lexical li {
  @apply font-sans text-base font-normal leading-relaxed text-inherit antialiased;
}

.lexical blockquote {
  @apply block font-sans text-xl font-normal leading-relaxed text-inherit antialiased;
}

.lexical code {
  @apply rounded-md bg-gray-900/[0.1] px-1 py-0.5 text-sm font-normal text-gray-900;
}

.tiptap ul p,
.tiptap ol p {
  @apply inline;
}

.tiptap p.is-editor-empty:first-child::before {
  @apply pointer-events-none float-left h-0 text-sm;
}
