/*
 * Copyright 2026 OpenTrace Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* ═══════════════════════════════════════════════
   OpenTrace Docs — Custom Theme
   Matches opentrace.ai brand identity
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Host+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ─── */
:root {
  --md-primary-fg-color: #F97316;
  --md-primary-fg-color--light: #F59E0B;
  --md-primary-fg-color--dark: #ea670d;
  --md-accent-fg-color: #F97316;
  --md-accent-fg-color--transparent: rgba(249, 115, 22, 0.1);
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: #08080d;
  --md-default-bg-color--light: #0e0e16;
  --md-default-fg-color: #f0f0f5;
  --md-default-fg-color--light: #a0a0b8;
  --md-default-fg-color--lighter: #6b6b80;
  --md-default-fg-color--lightest: rgba(255, 255, 255, 0.06);

  --md-primary-fg-color: #F97316;
  --md-primary-fg-color--light: #F59E0B;
  --md-primary-fg-color--dark: #ea670d;
  --md-primary-bg-color: #ffffff;
  --md-accent-fg-color: #F97316;
  --md-accent-fg-color--transparent: rgba(249, 115, 22, 0.1);

  --md-code-bg-color: #12121c;
  --md-code-fg-color: #f0f0f5;
  --md-code-hl-color: rgba(249, 115, 22, 0.15);

  --md-typeset-color: #f0f0f5;
  --md-typeset-a-color: #F97316;

  --md-footer-bg-color: #08080d;
  --md-footer-bg-color--dark: #06060a;
  --md-footer-fg-color: #a0a0b8;
  --md-footer-fg-color--light: #6b6b80;
  --md-footer-fg-color--lighter: rgba(255, 255, 255, 0.06);
}

/* ─── Typography ─── */
:root {
  --md-text-font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --md-code-font: "JetBrains Mono", "Fira Code", monospace;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  font-family: "Host Grotesk", var(--md-text-font);
  font-weight: 600;
  color: #f0f0f5;
}

.md-typeset h1 {
  font-weight: 700;
}

/* ─── Header ─── */
.md-header {
  background: rgba(8, 8, 13, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.md-header[data-md-state="shadow"] {
  box-shadow: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ─── Sidebar / Navigation ─── */
.md-sidebar {
  background: #08080d;
}

.md-nav__link {
  color: #a0a0b8;
  transition: color 0.2s ease;
}

.md-nav__link:hover {
  color: #f0f0f5;
}

.md-nav__link--active,
.md-nav__item--active > .md-nav__link {
  color: #F97316;
  font-weight: 500;
}

/* ─── Content links ─── */
.md-typeset a {
  color: #F97316;
  transition: color 0.2s ease;
}

.md-typeset a:hover {
  color: #F59E0B;
}

/* ─── Code blocks ─── */
.md-typeset code {
  background: #12121c;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #f0f0f5;
  border-radius: 6px;
}

.md-typeset pre {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.md-typeset pre > code {
  border: none;
  border-radius: 12px;
}

/* ─── Tables ─── */
.md-typeset table:not([class]) {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
}

.md-typeset table:not([class]) th {
  background: #12121c;
  color: #f0f0f5;
  font-family: "Host Grotesk", var(--md-text-font);
  font-weight: 600;
}

.md-typeset table:not([class]) td {
  border-top-color: rgba(255, 255, 255, 0.06);
}

/* ─── Admonitions ─── */
.md-typeset .admonition,
.md-typeset details {
  background: #12121c;
  border-color: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

/* ─── Search ─── */
.md-search__form {
  background: #12121c;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.md-search__input {
  color: #f0f0f5;
}

.md-search__input::placeholder {
  color: #6b6b80;
}

/* ─── Footer ─── */
.md-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ─── Tabs ─── */
.md-typeset .tabbed-labels > label {
  color: #a0a0b8;
}

.md-typeset .tabbed-labels > label:hover {
  color: #f0f0f5;
}

.md-typeset .tabbed-labels > .tabbed-alternate .tabbed-control--active,
.md-typeset [id] .tabbed-labels > label.tabbed--active {
  color: #F97316;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #08080d;
}

::-webkit-scrollbar-thumb {
  background: #1a1a2e;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2a2a3e;
}

/* ─── Content area ─── */
.md-content {
  background: #08080d;
}

.md-main {
  background: #08080d;
}

/* ─── Gradient text utility ─── */
.gradient-text {
  background: linear-gradient(135deg, #F97316, #F59E0B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
