/* Ceylon AI Documentation - FastAPI/PydanticAI Style */

/* Root variables */
:root {
  --ceylon-primary: #5e35b1;
  --ceylon-primary-light: #7e57c2;
  --ceylon-primary-dark: #4527a0;
  --ceylon-accent: #7c4dff;
  --ceylon-success: #00c853;
  --ceylon-warning: #ffc107;
  --ceylon-danger: #f44336;
  --ceylon-code-bg: #f8f9fa;
  --ceylon-border: #e0e0e0;
}

/* Dark mode variables */
[data-md-color-scheme="slate"] {
  --ceylon-code-bg: #263238;
  --ceylon-border: #37474f;
}

/* Header styling */
.md-header {
  background: linear-gradient(135deg, var(--ceylon-primary) 0%, var(--ceylon-primary-dark) 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Hero section on homepage */
.md-typeset h1:first-of-type {
  font-size: 3em;
  font-weight: 700;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  background: linear-gradient(135deg, var(--ceylon-primary) 0%, var(--ceylon-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Card grid styling */
.md-typeset .grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.md-typeset .grid.cards > * {
  padding: 1.5rem;
  border: 1px solid var(--ceylon-border);
  border-radius: 8px;
  transition: all 0.3s ease;
  background: var(--md-default-bg-color);
}

.md-typeset .grid.cards > *:hover {
  box-shadow: 0 4px 12px rgba(94, 53, 177, 0.2);
  border-color: var(--ceylon-primary);
  transform: translateY(-2px);
}

/* Code blocks */
.md-typeset pre {
  border-radius: 8px;
  background-color: var(--ceylon-code-bg) !important;
  border: 1px solid var(--ceylon-border);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  padding: 1em !important;
  overflow-x: auto;
  line-height: 1.6;
}

.md-typeset code {
  background-color: var(--ceylon-code-bg);
  border-radius: 4px;
  padding: 0.2em 0.4em;
  font-size: 0.9em;
  font-family: 'Roboto Mono', 'Courier New', monospace;
}

.md-typeset pre > code {
  background: transparent !important;
  padding: 0 !important;
  display: block;
  font-size: 0.85em;
  line-height: 1.6;
}

/* Improve code block visibility */
.highlight {
  background-color: var(--ceylon-code-bg) !important;
  border-radius: 8px;
}

.highlight pre {
  margin: 0;
  padding: 1em;
}

/* Syntax highlighting colors - Light mode */
[data-md-color-scheme="default"] {
  --md-code-fg-color: #24292e;
  --md-code-bg-color: #f6f8fa;
  --md-code-hl-color: rgba(255, 235, 59, 0.5);
  --md-code-hl-number-color: #005cc5;
  --md-code-hl-special-color: #e36209;
  --md-code-hl-function-color: #6f42c1;
  --md-code-hl-constant-color: #005cc5;
  --md-code-hl-keyword-color: #d73a49;
  --md-code-hl-string-color: #032f62;
}

/* Syntax highlighting colors - Dark mode */
[data-md-color-scheme="slate"] {
  --md-code-fg-color: #e1e4e8;
  --md-code-bg-color: #263238;
  --md-code-hl-color: rgba(255, 235, 59, 0.3);
  --md-code-hl-number-color: #79b8ff;
  --md-code-hl-special-color: #ffab70;
  --md-code-hl-function-color: #b392f0;
  --md-code-hl-constant-color: #79b8ff;
  --md-code-hl-keyword-color: #f97583;
  --md-code-hl-string-color: #9ecbff;
}

/* Code copy button */
.md-clipboard {
  color: var(--ceylon-primary);
  opacity: 0;
  transition: opacity 0.2s;
}

.md-clipboard:hover {
  color: var(--ceylon-accent);
}

/* Show copy button on code block hover */
.highlight:hover .md-clipboard,
pre:hover .md-clipboard {
  opacity: 1;
}

/* Hide the "Copy to clipboard" text, show only icon */
.md-clipboard__inner {
  font-size: 0;
}

.md-clipboard__inner::before {
  font-size: 1.2rem;
}

/* Alternative: completely hide button text */
.md-clipboard .md-clipboard__message {
  display: none;
}

/* Admonitions */
.md-typeset .admonition {
  border-radius: 8px;
  border-left: 4px solid;
  padding: 1rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.md-typeset .admonition.note {
  border-left-color: #2196f3;
}

.md-typeset .admonition.tip {
  border-left-color: var(--ceylon-success);
}

.md-typeset .admonition.warning {
  border-left-color: var(--ceylon-warning);
}

.md-typeset .admonition.danger {
  border-left-color: var(--ceylon-danger);
}

/* Tables */
.md-typeset table:not([class]) {
  border-radius: 8px;
  border: 1px solid var(--ceylon-border);
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.md-typeset table:not([class]) th {
  background: linear-gradient(135deg, var(--ceylon-primary) 0%, var(--ceylon-primary-light) 100%);
  color: white;
  font-weight: 600;
  padding: 0.8rem;
}

.md-typeset table:not([class]) td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--ceylon-border);
}

.md-typeset table:not([class]) tr:hover {
  background-color: rgba(94, 53, 177, 0.05);
}

/* Links */
.md-typeset a {
  color: var(--ceylon-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.md-typeset a:hover {
  color: var(--ceylon-accent);
  border-bottom-color: var(--ceylon-accent);
}

/* Badges */
.md-typeset .badge {
  display: inline-block;
  padding: 0.25em 0.6em;
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  border-radius: 4px;
  margin: 0 0.2em;
  position: relative;
  top: -2px;
}

.badge-primary {
  background-color: var(--ceylon-primary);
  color: white;
}

.badge-success {
  background-color: var(--ceylon-success);
  color: white;
}

.badge-warning {
  background-color: var(--ceylon-warning);
  color: #000;
}

.badge-danger {
  background-color: var(--ceylon-danger);
  color: white;
}

/* Navigation */
.md-nav__link--active {
  color: var(--ceylon-primary);
  font-weight: 600;
}

.md-nav__link:hover {
  color: var(--ceylon-accent);
}

/* Search */
.md-search__input {
  border-radius: 8px;
}

.md-search__input:focus {
  border-color: var(--ceylon-primary);
  box-shadow: 0 0 0 0.2rem rgba(94, 53, 177, 0.25);
}

/* Tabs */
.md-typeset .tabbed-labels > label {
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.md-typeset .tabbed-labels > label:hover {
  color: var(--ceylon-primary);
}

.md-typeset .tabbed-labels > label[for*="__tabbed"]:checked {
  border-bottom-color: var(--ceylon-primary);
  color: var(--ceylon-primary);
}

/* Task lists */
.md-typeset .task-list-indicator::before {
  background-color: var(--ceylon-primary);
}

/* Buttons */
.md-button {
  background-color: var(--ceylon-primary);
  color: white;
  border-radius: 6px;
  padding: 0.6em 1.2em;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.md-button:hover {
  background-color: var(--ceylon-accent);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}

.md-button--primary {
  background: linear-gradient(135deg, var(--ceylon-primary) 0%, var(--ceylon-accent) 100%);
}

/* Footer */
.md-footer {
  background: linear-gradient(135deg, var(--ceylon-primary-dark) 0%, var(--ceylon-primary) 100%);
}

/* Icons */
.md-typeset .lg {
  font-size: 3em;
}

.md-typeset .middle {
  vertical-align: middle;
}

/* Difficulty indicators in tables */
.md-typeset td:has-text("⭐") {
  color: var(--ceylon-warning);
}

/* Custom classes for API docs */
.api-signature {
  background: var(--ceylon-code-bg);
  border-left: 4px solid var(--ceylon-primary);
  padding: 1rem;
  border-radius: 4px;
  font-family: monospace;
  margin: 1rem 0;
}

.api-param {
  margin: 0.5rem 0;
  padding-left: 1rem;
}

.api-param-name {
  font-weight: 600;
  color: var(--ceylon-primary);
}

.api-param-type {
  font-style: italic;
  color: var(--ceylon-accent);
}

.api-returns {
  background: rgba(0, 200, 83, 0.1);
  border-left: 4px solid var(--ceylon-success);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  margin: 1rem 0;
}

.api-example {
  margin: 1.5rem 0;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .md-typeset h1:first-of-type {
    font-size: 2em;
  }

  .md-typeset .grid.cards {
    grid-template-columns: 1fr;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Code highlighting enhancements */
.md-typeset .highlight .hll {
  background-color: rgba(94, 53, 177, 0.1);
}

/* Mermaid diagrams */
.mermaid {
  background: transparent;
  text-align: center;
  padding: 1rem;
}

/* Version badge */
.md-version {
  background-color: var(--ceylon-accent);
  border-radius: 4px;
  color: white;
  font-weight: 600;
}

/* Keyboard shortcuts */
.md-typeset kbd {
  background: var(--ceylon-code-bg);
  border: 1px solid var(--ceylon-border);
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--ceylon-border);
  color: var(--md-typeset-color);
  display: inline-block;
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1;
  padding: 0.3em 0.5em;
  vertical-align: middle;
}

/* Announcement bar */
.md-banner {
  background: linear-gradient(135deg, var(--ceylon-accent) 0%, var(--ceylon-primary) 100%);
  color: white;
}

/* TOC highlighting */
.md-nav--secondary .md-nav__link--active {
  border-left: 2px solid var(--ceylon-primary);
  font-weight: 600;
}

/* Expand/Collapse button for long code blocks */
.expand-code-btn {
  display: block;
  margin: 0.5rem auto;
  padding: 0.3rem 0.8rem;
  background-color: var(--ceylon-primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.expand-code-btn:hover {
  background-color: var(--ceylon-accent);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}

.expand-code-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
