/* AI Connect — Liquid Glass design system
   Implements palette.md: indigo -> violet -> teal brand gradient, .ac-glass
   recipe, gradient primary button. Light theme primary with subtle glass. */

:root {
  --ac-indigo: #5B5BF0;
  --ac-violet: #6D4BF2;
  --ac-teal: #22D3C5;
  --ac-cyan: #2BB6D9;
  --ac-spark: #7FE9F0;

  --ac-ink-900: #10103A;
  --ac-ink-700: #2A2C6B;
  --ac-ink-500: #3B3E86;
  --ac-ink-400: #7C7FA6;

  --ac-surface: #FFFFFF;
  --ac-surface-tint: #F4F5FF;
  --ac-glass-tint: #CFF6FF;

  --ac-brand-gradient: linear-gradient(135deg, #5B5BF0 0%, #6D4BF2 42%, #2BB6D9 72%, #22D3C5 100%);
  --ac-wordmark-gradient: linear-gradient(90deg, #5B5BF0 0%, #22B6CF 100%);
}

/* App background: soft indigo/teal-tinted light surface */
body.ac-body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ac-ink-900);
  min-height: 100vh;
  background:
    radial-gradient(900px 600px at 12% -8%, rgba(91, 91, 240, 0.16), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(34, 211, 197, 0.16), transparent 55%),
    linear-gradient(180deg, #F4F5FF 0%, #FFFFFF 45%, #F1FBFE 100%);
  background-attachment: fixed;
}

/* ── Brand gradient utilities ───────────────────────────────────────── */
.ac-gradient {
  background: var(--ac-brand-gradient);
}
.ac-gradient-text {
  background: var(--ac-wordmark-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Liquid Glass surfaces (from palette.md §3) ─────────────────────── */
.ac-glass {
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  box-shadow:
    0 10px 28px rgba(27, 28, 90, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -20px 40px rgba(16, 16, 58, 0.04);
}

/* Strong-glass variant used for the gradient hero header */
.ac-glass--dark {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.ac-glass-hover {
  transition: transform .18s ease, box-shadow .18s ease;
}
.ac-glass-hover:hover {
  transform: translateY(-3px);
  box-shadow:
    0 18px 40px rgba(27, 28, 90, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* ── Gradient primary button ────────────────────────────────────────── */
.ac-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--ac-brand-gradient);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(91, 91, 240, 0.3);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.ac-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(91, 91, 240, 0.4); }
.ac-btn:active { transform: translateY(0); }
.ac-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.ac-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ac-ink-700);
  font-weight: 600;
  border: 1px solid rgba(91, 91, 240, 0.25);
  border-radius: 14px;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.ac-btn-ghost:hover { background: #fff; border-color: rgba(91, 91, 240, 0.5); }
.ac-btn-danger {
  background: #fff5f5; color: #c81e1e; border: 1px solid #f5c2c2;
  border-radius: 14px; padding: 0.6rem 1.1rem; font-weight: 600; cursor: pointer;
}
.ac-btn-danger:hover { background: #fde8e8; }

/* ── Form controls ──────────────────────────────────────────────────── */
.ac-input, .ac-select, .ac-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(16, 16, 58, 0.12);
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  color: var(--ac-ink-900);
  font-size: 0.9rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ac-input:focus, .ac-select:focus, .ac-textarea:focus {
  outline: none;
  border-color: var(--ac-indigo);
  box-shadow: 0 0 0 3px rgba(91, 91, 240, 0.18);
}
.ac-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ac-ink-500);
  margin-bottom: 0.35rem;
}
.ac-textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.5; }

/* ── Badges / chips ─────────────────────────────────────────────────── */
.ac-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px;
}
.ac-badge-active { background: rgba(34, 211, 197, 0.16); color: #0a7d72; }
.ac-badge-inactive { background: rgba(16, 16, 58, 0.08); color: var(--ac-ink-400); }
.ac-badge-cat { background: rgba(91, 91, 240, 0.12); color: var(--ac-violet); }

/* ── Tabs ───────────────────────────────────────────────────────────── */
.ac-tab {
  padding: 0.6rem 1.1rem; font-weight: 600; font-size: 0.9rem; color: var(--ac-ink-400);
  border: none; background: transparent; cursor: pointer; border-radius: 12px;
  transition: color .15s ease, background .15s ease;
}
.ac-tab:hover { color: var(--ac-ink-700); }
.ac-tab.active {
  color: #fff;
  background: var(--ac-brand-gradient);
  box-shadow: 0 6px 16px rgba(91, 91, 240, 0.28);
}

/* ── Code / result blocks ───────────────────────────────────────────── */
.ac-pre {
  background: #0B0C24; color: #E8FBFF; border-radius: 14px; padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem;
  white-space: pre-wrap; word-break: break-word; overflow-x: auto; max-height: 360px;
}

.ac-link { color: var(--ac-indigo); font-weight: 600; }
.ac-link:hover { color: var(--ac-violet); text-decoration: underline; }
