/* Site-wide theme tokens (you'd normally manage these with a design system) */
:root{
  --accent: #0e7cc8;           /* primary brand color */
  --text: #1b1b1b;
  --bg: #ffffff;
  --muted: #6b6b6b;
  --radius: 14px;
  --shadow-md: 0 10px 24px rgba(0,0,0,0.12);
  --shadow-lg: 0 16px 42px rgba(0,0,0,0.16);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.site-header {
  padding: 32px 28px 10px;
  background: linear-gradient(135deg, rgba(0,0,0,0.02) 0%, transparent 100%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.header-content {
  max-width: 880px;
  margin: 0 auto;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: contain;
}

.logo-section h1 {
  margin: 0 0 4px 0;
  font-size: 28px;
}

.logo-section p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.content {
  padding: 0 28px 80px;
  max-width: 880px;
  margin: 0 auto;
}

/* Card uses same radii and shadows we'll use on the chat window */
.card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin: 16px 0;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(4px);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card h2 {
  margin: 8px 0 12px;
  font-size: 20px;
}

.card h3 {
  margin: 12px 0 8px;
  font-size: 16px;
}

/* Theme selector styling */
.theme-selector-card {
  border: 2px solid rgba(0,0,0,0.08);
}

.theme-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* Theme info card */
.theme-info-card {
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 8%, var(--bg)) 0%, var(--bg) 100%);
  border: 2px solid color-mix(in oklab, var(--accent) 20%, transparent);
}

.theme-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.5);
  border-radius: 8px;
  font-size: 13px;
}

.detail-label {
  font-weight: 600;
  color: var(--muted);
}

.accent-display {
  font-family: monospace;
  font-size: 12px;
}

/* Code block styling */
:root {
  --code-bg: #f5f5f5;
  --code-border: #e0e0e0;
}

.code-block {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 12px;
}

.code-block code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  color: var(--text);
  line-height: 1.4;
}

/* Features section */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.feature-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.feature-card h3 {
  margin: 0 0 8px 0;
}

.feature-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Documentation styles */
.doc-section {
  margin: 16px 0;
}

.doc-section h3 {
  margin: 12px 0 8px;
  font-size: 16px;
  color: var(--accent);
}

.prop-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.prop-list li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 13px;
}

.prop-list li:last-child {
  border-bottom: none;
}

.prop-list code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  color: #d73a49;
}

/* Buttons themed with --accent */
.btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  margin-right: 8px;
  margin-bottom: 8px;
  font: 600 14px/1 var(--font);
  cursor: pointer;
  transition: transform .05s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.btn:active { transform: translateY(1px); }

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px color-mix(in oklab, var(--accent) 28%, transparent);
}

.btn.primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 10px 28px color-mix(in oklab, var(--accent) 32%, transparent);
}

.btn.primary.active {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent),
              0 8px 20px color-mix(in oklab, var(--accent) 28%, transparent);
}

.btn.subtle {
  background: rgba(255,255,255,0.8);
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 40%, #ffffff);
}

.btn.subtle:hover { background: color-mix(in oklab, var(--accent) 8%, #fff); }

/* -----------------------------------------------------------
   CHAT WIDGET theming hook:
   Shadow DOM can't see our selectors, but it DOES inherit CSS
   custom properties from its host element. The host is #mini-chat-host.
   We mirror site tokens to the widget variables here.
----------------------------------------------------------- */
#mini-chat-host{
  /* Map your site tokens to the widget's variables */
  --mc-accent: var(--accent);     /* pill & window frame color */
  --mc-text-color: #ffffff;       /* text color in the pill */
  --mc-font-family: var(--font);
  --mc-font-size: 18px;
  --mc-font-weight: 600;

  --mc-window-width: 100ch;       /* "100 character width" */
  --mc-window-height: 520px;
  --mc-window-radius: var(--radius);

  --mc-msg-user: #e9f2ff;
  --mc-msg-bot:  #f3f3f3;

  /* Icon & ring sizing (defaults align with your spec) */
  /* +10px diameter => ~5px extra radius */
  --mc-icon-img-size: 82px;   /* tweak badge */
  --mc-ring-extra: 12px;      /* 6px border */
  --mc-label-height: 44px;    /* tweak pill height */

  /* Smooth transitions for theme changes */
  transition: --mc-accent 0.3s ease, --mc-msg-user 0.3s ease, --mc-msg-bot 0.3s ease;
}

/* Dark theme support (Tech Dark theme) */
@media (prefers-color-scheme: dark) {
  :root {
    --text: #e2e8f0;
  }

  body {
    background: #1a1a1a;
  }

  .card {
    background: rgba(30, 30, 30, 0.8);
    border-color: rgba(255,255,255,0.1);
  }

  .code-block {
    background: #2a2a2a;
    border-color: #404040;
  }

  .code-block code {
    color: #e2e8f0;
  }

  .detail-item {
    background: rgba(255,255,255,0.08);
  }
}
