/* Table header styling - subtle blue tint */
.md-typeset table:not([class]) th {
  background-color: #e3f2fd;
  color: #1565c0;
  font-weight: 600;
  border-bottom: 2px solid #bbdefb;
}

/* Dark mode */
[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background-color: #1e3a5f;
  color: #90caf9;
  border-bottom: 2px solid #2d4a6f;
}

/* Subtle border around table */
.md-typeset table:not([class]) {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) {
  border-color: #404040;
}

/* Alternating row colors */
.md-typeset table:not([class]) tbody tr:nth-child(even) {
  background-color: #fafafa;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tbody tr:nth-child(even) {
  background-color: #262626;
}

/* ===================================
   HOMEPAGE STYLES
   =================================== */

.subtitle {
  font-size: 1.25rem;
  text-align: center;
  opacity: 0.8;
  margin-bottom: 2rem;
}

.hero-stats {
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.center {
  text-align: center;
}

.small {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Homepage h1 styling */
.md-content h1:first-of-type {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* Center standalone buttons */
.md-content > p:has(.md-button) {
  text-align: center;
}

/* Heart icon color */
.twemoji.heart, .heart {
  color: #e53935;
}

/* Make admonition buttons full-width on homepage */
.md-typeset .admonition .md-button {
  margin-top: 1rem;
}


/* Style buttons inside admonitions */
.md-typeset .admonition a.md-button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 0.2rem;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 125ms, background-color 125ms, border-color 125ms;
}

/* Default button style (outline) */
.md-typeset .admonition a.md-button:not(.md-button--primary) {
  color: var(--md-primary-fg-color);
  border: 0.1rem solid currentcolor;
  background-color: transparent;
}

.md-typeset .admonition a.md-button:not(.md-button--primary):hover {
  color: var(--md-accent-fg-color);
  border-color: currentcolor;
}

/* Primary button style (filled) */
.md-typeset .admonition a.md-button--primary {
  color: var(--md-primary-bg-color);
  background-color: var(--md-primary-fg-color);
  border: none;
}

.md-typeset .admonition a.md-button--primary:hover {
  background-color: var(--md-accent-fg-color);
}

/* Center footer content */
.md-footer-meta__inner {
  display: flex;
  justify-content: center;
}

.md-copyright {
  text-align: center;
}

/* ===================================
   LIVE CODE EDITOR STYLES
   =================================== */

/* Container */
.live-code-container {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
  background: #fff;
}

[data-md-color-scheme="slate"] .live-code-container {
  border-color: #404040;
  background: #282a36;
}

/* CodeMirror editor wrapper */
.live-code-editor-wrapper {
  border-bottom: 1px solid #e0e0e0;
  position: relative;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper {
  border-bottom-color: #404040;
}

/* Clear button */
.live-code-clear {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 10;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.05);
  color: #999;
  font-size: 12px;
  line-height: 20px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.15s ease;
}

.live-code-clear:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
  color: #666;
}

[data-md-color-scheme="slate"] .live-code-clear {
  background: rgba(255, 255, 255, 0.1);
  color: #888;
}

[data-md-color-scheme="slate"] .live-code-clear:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ccc;
}

/* CodeMirror overrides */
.live-code-editor-wrapper .CodeMirror {
  height: auto;
  font-family: var(--md-code-font-family, "JetBrains Mono", monospace);
  font-size: 12px !important;
  line-height: 1.4;
  padding: 0;
}

.live-code-editor-wrapper .CodeMirror pre.CodeMirror-line,
.live-code-editor-wrapper .CodeMirror pre.CodeMirror-line-like {
  font-size: 12px !important;
}

.live-code-editor-wrapper .CodeMirror-scroll {
  min-height: 80px;
  max-height: 350px;
}

.live-code-editor-wrapper .CodeMirror-lines {
  padding: 0.5rem 0;
}

.live-code-editor-wrapper .CodeMirror-linenumber {
  padding: 0 6px 0 4px;
  min-width: 16px;
  font-size: 11px;
}

.live-code-editor-wrapper .CodeMirror-gutters {
  border-right: 1px solid #e0e0e0;
  background: #f5f5f5;
}

/* Dark mode CodeMirror styles */
[data-md-color-scheme="slate"] .live-code-editor-wrapper .CodeMirror {
  background: #282a36;
  color: #f8f8f2;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .CodeMirror-gutters {
  background: #282a36;
  border-right-color: #44475a;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .CodeMirror-linenumber {
  color: #6272a4;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .CodeMirror-cursor {
  border-left-color: #f8f8f2;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .CodeMirror-selected {
  background: #44475a !important;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .CodeMirror-activeline-background {
  background: #44475a;
}

/* Dracula syntax colors for dark mode */
[data-md-color-scheme="slate"] .live-code-editor-wrapper .cm-keyword {
  color: #ff79c6;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .cm-def {
  color: #50fa7b;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .cm-variable {
  color: #f8f8f2;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .cm-variable-2 {
  color: #f8f8f2;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .cm-property {
  color: #66d9ef;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .cm-operator {
  color: #ff79c6;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .cm-string {
  color: #f1fa8c;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .cm-string-2 {
  color: #f1fa8c;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .cm-number {
  color: #bd93f9;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .cm-comment {
  color: #6272a4;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .cm-atom {
  color: #bd93f9;
}

[data-md-color-scheme="slate"] .live-code-editor-wrapper .cm-builtin {
  color: #8be9fd;
}

/* Button row */
.live-code-buttons {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}

[data-md-color-scheme="slate"] .live-code-buttons {
  background: #2d2d2d;
  border-bottom-color: #404040;
}

/* Buttons */
.live-code-run,
.live-code-reset {
  padding: 4px 10px;
  border: none;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.live-code-run {
  background: #2196f3;
  color: white;
}

.live-code-run:hover {
  background: #1976d2;
}

.live-code-reset {
  background: transparent;
  color: #666;
  border: 1px solid #ccc;
}

.live-code-reset:hover {
  background: #eee;
  border-color: #999;
}

[data-md-color-scheme="slate"] .live-code-reset {
  color: #aaa;
  border-color: #555;
}

[data-md-color-scheme="slate"] .live-code-reset:hover {
  background: #3d3d3d;
  border-color: #666;
}

/* Keyboard hint */
.live-code-hint {
  margin-left: auto;
  font-size: 10px;
  color: #999;
  align-self: center;
}

[data-md-color-scheme="slate"] .live-code-hint {
  color: #666;
}

/* Output area */
.live-code-output {
  padding: 8px 10px;
  background: #fafafa;
}

[data-md-color-scheme="slate"] .live-code-output {
  background: #1a1a1a;
}

.live-code-output-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #888;
  margin-bottom: 4px;
}

.live-code-result {
  margin: 0;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  font-family: var(--md-code-font-family, "JetBrains Mono", monospace);
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  color: #2e7d32;
}

[data-md-color-scheme="slate"] .live-code-result {
  background: #252526;
  border-color: #404040;
  color: #4ec9b0;
}

.live-code-result.live-code-error {
  color: #d32f2f;
  background: #ffebee;
  border-color: #ef9a9a;
}

[data-md-color-scheme="slate"] .live-code-result.live-code-error {
  color: #f48771;
  background: #3e2723;
  border-color: #5d4037;
}

/* Make admonition with live code more visible */
.md-typeset .admonition.tip:has(.live-code-container) {
  border-left-width: 4px;
}
