/* DataKitchen brand colors — derived from logo greens
   Logo dark green: ~#0f9a4a  →  toned down to #1c8148 for white text contrast (~4.9:1)
   Logo lime green: ~#8dc63f  →  used as accent inspiration
   Light mode: muted logo green for header + accents
   Dark mode:  pale green for links/accents, logo green header for readability */
:root {
  --md-primary-fg-color: #1c8148;
  --md-primary-fg-color--light: #4cbc7a;
  --md-primary-fg-color--dark: #156838;
  --md-accent-fg-color: #1c8148;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #4cbc7a;
  --md-primary-fg-color--light: #1c8148;
  --md-primary-fg-color--dark: #4cbc7a;
  --md-accent-fg-color: #4cbc7a;
  --md-default-fg-color--light: hsla(var(--md-hue), 15%, 90%, 0.72);
}

/* Dark mode: header/tabs use the logo-derived green for white text contrast */
[data-md-color-scheme="slate"] .md-header,
[data-md-color-scheme="slate"] .md-tabs {
  background-color: #1c8148;
}

/* Improve non-active tab text contrast for WCAG AA (Material default is 0.7) */
.md-tabs__link {
  color: hsla(0, 0%, 100%, 1);
}

/* Improve footer text contrast for WCAG AA */
.md-copyright,
.md-footer-meta {
  color: hsla(0, 0%, 100%, 0.85);
}

/* Tighten gap between header logo and site title */
.md-header .md-header__title {
  margin-left: 0;
}

/* Enterprise admonition */
:root {
  --md-admonition-icon--enterprise: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"/></svg>');
}

.md-typeset .admonition.enterprise,
.md-typeset details.enterprise {
  border-color: #7c4dff;
}

.md-typeset .enterprise > .admonition-title,
.md-typeset .enterprise > summary {
  background-color: rgba(124, 77, 255, 0.1);
}

.md-typeset .enterprise > .admonition-title::before,
.md-typeset .enterprise > summary::before {
  -webkit-mask-image: var(--md-admonition-icon--enterprise);
  mask-image: var(--md-admonition-icon--enterprise);
  background-color: #7c4dff;
}

/* Global: border-radius for search, buttons, code, images, tables, callouts */
.md-search .md-search__form,
.md-typeset .md-button,
.md-typeset code,
.md-typeset img,
.md-typeset table:not([class]) {
  border-radius: 0.2rem;
}

.md-typeset .admonition {
  border-radius: 0.4rem;
}

/* Global: reduce bottom margin on main content */
.md-content__inner {
  margin-bottom: 2rem;
}

/* Global: increase whitespace between content and sidebars */
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary .md-sidebar__inner {
    padding-right: 1.5rem;
  }

  .md-sidebar--secondary .md-sidebar__inner {
    padding-left: 1.5rem;
  }
}

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

.product-card {
  position: relative;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.product-card:hover {
  border-color: var(--md-primary-fg-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-card h2 {
  margin-top: 0;
  font-size: 1.25em;
}

/* Stretch the link over the entire card */
.product-card > p:last-child a {
  text-decoration: none;
  color: var(--md-primary-fg-color);
}

.product-card > p:last-child a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0.5rem;
}

/* Product tour CTA */
.product-tour-cta {
  text-align: center;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

/* Install cards */
.install-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.install-card {
  position: relative;
  border: 1.5px solid var(--md-primary-fg-color);
  border-radius: 0.3rem;
  padding: 0.8rem 0.5rem;
  text-align: center;
  transition: box-shadow 0.2s, background-color 0.2s;
}

.install-card:hover {
  box-shadow: 0 4px 12px rgba(6, 160, 74, 0.15);
  background-color: rgba(6, 160, 74, 0.04);
}

.install-card p:first-child {
  margin: 0;
}

.install-card p:first-child a {
  text-decoration: none;
  color: var(--md-primary-fg-color);
  font-size: 0.7rem;
}

/* Stretch the link over the entire card */
.install-card p:first-child a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0.5rem;
}

.install-card p:last-child {
  font-size: 0.6rem;
  color: var(--md-default-fg-color--light);
  margin-top: 0.2rem;
  margin-bottom: 0;
}

/* Enterprise inline badge */
.md-typeset .badge-enterprise {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: rgba(124, 77, 255, 0.1);
  color: var(--md-default-fg-color);
  border: 1px solid #7c4dff;
  border-radius: 2rem;
  padding: 0.25rem 0.6rem 0.25rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
  margin-left: 0.5rem;
}

.md-typeset .badge-enterprise::before {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  -webkit-mask-image: var(--md-admonition-icon--enterprise);
  mask-image: var(--md-admonition-icon--enterprise);
  mask-size: contain;
  -webkit-mask-size: contain;
  background-color: #7c4dff;
  flex-shrink: 0;
}

/* Enterprise inline badge — compact variant for inline text */
.md-typeset .badge-enterprise-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background-color: rgba(124, 77, 255, 0.1);
  color: var(--md-default-fg-color);
  border-radius: 2rem;
  padding: 0.15rem 0.5rem 0.15rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}

.md-typeset .badge-enterprise-inline::before {
  content: "";
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  -webkit-mask-image: var(--md-admonition-icon--enterprise);
  mask-image: var(--md-admonition-icon--enterprise);
  mask-size: contain;
  -webkit-mask-size: contain;
  background-color: #7c4dff;
  flex-shrink: 0;
}

[data-md-color-scheme="slate"] .md-typeset .badge-enterprise,
[data-md-color-scheme="slate"] .md-typeset .badge-enterprise-inline {
  background-color: rgba(124, 77, 255, 0.15);
  border-color: rgba(124, 77, 255, 0.4);
}

/* Community badge — for community-supported agents */
.md-typeset .badge-community {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: rgba(232, 167, 2, 0.12);
  color: var(--md-default-fg-color);
  border: 1px solid #e8a702;
  border-radius: 2rem;
  padding: 0.25rem 0.6rem 0.25rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
  margin-left: 0.5rem;
}

.md-typeset .badge-community::before {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  -webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 17v2H2v-2s0-4 7-4 7 4 7 4m-3.5-9.5A3.5 3.5 0 1 0 9 11a3.5 3.5 0 0 0 3.5-3.5m3.44 5.5A5.32 5.32 0 0 1 18 17v2h4v-2s0-3.63-6.06-4M15 4a3.39 3.39 0 0 0-1.93.59 5 5 0 0 1 0 5.82A3.39 3.39 0 0 0 15 11a3.5 3.5 0 0 0 0-7z"/></svg>');
  mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 17v2H2v-2s0-4 7-4 7 4 7 4m-3.5-9.5A3.5 3.5 0 1 0 9 11a3.5 3.5 0 0 0 3.5-3.5m3.44 5.5A5.32 5.32 0 0 1 18 17v2h4v-2s0-3.63-6.06-4M15 4a3.39 3.39 0 0 0-1.93.59 5 5 0 0 1 0 5.82A3.39 3.39 0 0 0 15 11a3.5 3.5 0 0 0 0-7z"/></svg>');
  mask-size: contain;
  -webkit-mask-size: contain;
  background-color: #e8a702;
  flex-shrink: 0;
}

[data-md-color-scheme="slate"] .md-typeset .badge-community {
  background-color: rgba(232, 167, 2, 0.15);
  border-color: rgba(232, 167, 2, 0.4);
}

/* Permissions grid — align role columns across multiple tables */
.permissions-grid .md-typeset__table {
  width: 100%;
}
.permissions-grid table {
  table-layout: fixed;
  width: 100%;
}
.permissions-grid table th:first-child,
.permissions-grid table td:first-child {
  width: 50%;
}
.permissions-grid table th:not(:first-child),
.permissions-grid table td:not(:first-child) {
  width: 10%;
}

/* Status icon colors — used with attr_list on :material-*: icons */
.status-error { color: #d32f2f !important; }
.status-warning { color: #ff8f00 !important; }
.status-pending { color: #757575 !important; }
.status-running { color: #1976d2 !important; }
.status-success { color: #2e7d32 !important; }
.status-missed { color: #1565c0 !important; }
