/* codeGROOVE Documentation - Clean, Professional Design */

:root {
  /* Brand colors - used sparingly */
  --brand-yellow: #ffe838;
  --brand-yellow-subtle: #fef9c3;

  /* Neutral palette - primary for content */
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;

  /* Functional colors */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --border-color: var(--gray-200);
  --bg-subtle: var(--gray-50);

  /* Links - professional blue */
  --link-color: #2563eb;
  --link-hover: #1d4ed8;

  /* Override Material theme */
  --md-primary-fg-color: var(--gray-900);
  --md-primary-bg-color: var(--brand-yellow);
  --md-accent-fg-color: var(--link-color);
  --md-typeset-a-color: var(--link-color);
}

/* Clean body typography */
.md-typeset {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-primary);
}

/* Headings - clean hierarchy */
.md-typeset h1 {
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.md-typeset h2 {
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-bottom: none;
}

.md-typeset h3 {
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.md-typeset h4 {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Paragraphs */
.md-typeset p {
  margin-bottom: 1rem;
}

/* Links - clean and professional */
.md-typeset a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: none;
  font-weight: 500;
}

.md-typeset a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Header - subtle brand presence */
.md-header {
  background: var(--brand-yellow);
  box-shadow: none;
  border-bottom: 1px solid var(--gray-300);
}

.md-header__title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--gray-900);
}

.md-header__button {
  color: var(--gray-900);
}

/* Tabs - clean, minimal */
.md-tabs {
  background: white;
  border-bottom: 1px solid var(--border-color);
}

.md-tabs__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary) !important;
  opacity: 1;
}

.md-tabs__link:hover {
  color: var(--text-primary) !important;
}

.md-tabs__link--active {
  color: var(--text-primary) !important;
  font-weight: 600;
  border-bottom: 2px solid var(--gray-900);
}

/* Sidebar - clean navigation */
.md-sidebar {
  background: white;
}

.md-sidebar--primary {
  width: 13rem;
}

@media screen and (min-width: 76.25em) {
  .md-sidebar--primary {
    width: 14rem;
  }
}

/* Product/section titles - never truncate */
.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link,
.md-nav--primary > .md-nav__list > .md-nav__item > label {
  font-weight: 600;
  color: var(--text-primary);
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  padding-left: 0;
}

.md-nav__link {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  transition: all 0.15s ease;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.md-nav__link:hover {
  color: var(--text-primary);
  background: var(--gray-100);
}

.md-nav__link--active {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--gray-100);
}

/* Content area */
.md-content {
  background: white;
}

.md-content__inner {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  max-width: 48rem;
}

/* Inline code - subtle */
.md-typeset code {
  background: var(--gray-100);
  color: var(--gray-800);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  border: none;
  font-weight: 500;
}

/* Code blocks - clean */
.md-typeset pre {
  background: var(--gray-50);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: none;
}

.md-typeset pre code {
  background: transparent;
  padding: 0;
  font-weight: 400;
}

/* Tables - minimal and readable */
.md-typeset table:not([class]) {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: none;
  font-size: 0.875rem;
}

.md-typeset table:not([class]) th {
  background: var(--gray-50);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

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

.md-typeset table:not([class]) tr:last-child td {
  border-bottom: none;
}

.md-typeset table:not([class]) tr:hover {
  background: var(--gray-50);
}

/* Buttons - professional, not loud */
.md-typeset .md-button,
.md-typeset a.md-button {
  background: var(--gray-900);
  color: white !important;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.25rem;
  font-weight: 500;
  font-size: 0.875rem;
  box-shadow: none;
  transition: background 0.15s ease;
}

.md-typeset .md-button:hover,
.md-typeset a.md-button:hover {
  background: var(--gray-700);
  color: white !important;
  transform: none;
  box-shadow: none;
  text-decoration: none;
}

.md-typeset .md-button--primary,
.md-typeset a.md-button--primary {
  background: var(--gray-900);
  color: white !important;
}

/* Lists - clean spacing */
.md-typeset ul,
.md-typeset ol {
  margin-left: 0;
  padding-left: 1.25rem;
}

.md-typeset li {
  margin-bottom: 0.4rem;
}

.md-typeset li::marker {
  color: var(--gray-400);
}

/* Blockquotes - subtle */
.md-typeset blockquote {
  border-left: 3px solid var(--gray-300);
  background: transparent;
  padding: 0.5rem 1rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  border-radius: 0;
  box-shadow: none;
}

/* Horizontal rules - subtle dividers */
.md-typeset hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

/* Admonitions - clean */
.md-typeset .admonition {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: none;
  background: white;
  font-size: 0.875rem;
}

.md-typeset .admonition-title {
  background: var(--gray-50);
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
}

.md-typeset .admonition > p {
  padding: 0.75rem 1rem;
}

/* Search - clean */
.md-search__input {
  background: var(--gray-100);
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.875rem;
}

.md-search__input:focus {
  background: white;
  border-color: var(--gray-300);
  box-shadow: none;
}

/* Footer - minimal */
.md-footer {
  background: var(--gray-900);
  margin-top: 4rem;
}

.md-footer-meta {
  background: transparent;
}

/* Code tabs - clean */
.md-typeset .tabbed-set > label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
}

.md-typeset .tabbed-set > input:checked + label {
  color: var(--text-primary);
  border-color: var(--gray-900);
  background: transparent;
}

/* Copy button - subtle */
.md-clipboard {
  color: var(--gray-400);
}

.md-clipboard:hover {
  color: var(--gray-600);
  background: transparent;
}

/* Back to top - minimal */
.md-top {
  background: var(--gray-900);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-radius: 6px;
}

.md-top:hover {
  background: var(--gray-700);
  transform: none;
}

/* Product grid - clean cards */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.product-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  background: white;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  border-color: var(--gray-300);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.product-card h3 {
  margin-top: 0 !important;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  border-bottom: none !important;
}

.product-card p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.product-card p strong {
  color: var(--text-primary);
}

/* External links indicator */
.md-tabs__link[href^="http"]::after,
.md-nav__link[href^="http"]::after {
  content: " ↗";
  font-size: 0.75em;
  opacity: 0.5;
}

/* Focus states - accessible */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .md-typeset {
    font-size: 1rem;
  }

  .md-content__inner {
    padding-top: 1rem;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .md-header,
  .md-tabs,
  .md-sidebar,
  .md-footer {
    display: none;
  }

  .md-content {
    margin: 0;
    padding: 0;
  }
}
