/* AI Assistant Pro – Shortcode Search v1.3 */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700&display=swap');

/* Scoped reset — prevents any theme CSS from leaking in */
.aiap-sc-wrap,
.aiap-sc-wrap *,
.aiap-sc-wrap *::before,
.aiap-sc-wrap *::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

.aiap-sc-wrap {
  --a:  #6366f1;    /* accent */
  --bg: #f8fafc;    /* page background */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 0 56px;
  background: var(--bg);
  border-radius: 20px;
}

/* ── Hero section ──────────────────────────────────────── */
.aiap-sc-hero {
  text-align: center;
  padding: 52px 24px 36px;
}

.aiap-sc-icon-box {
  width: 62px; height: 62px;
  background: var(--a);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  color: #fff;
  /* fallback shadow without color-mix */
  box-shadow: 0 8px 28px rgba(99,102,241,.35);
}
.aiap-sc-icon-box svg { width: 30px; height: 30px; stroke: #fff; fill: none; display: block; }

.aiap-sc-heading {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
  letter-spacing: -.025em;
  color: #0f172a;
  margin: 0 0 12px;
  line-height: 1.2;
}

.aiap-sc-desc {
  font-size: 15px;
  color: #64748b;
  margin: 0 auto;
  line-height: 1.65;
  max-width: 440px;
}

/* ── Search Bar ────────────────────────────────────────── */
/*
  Structure:
    .aiap-sc-bar-wrap   (padding container)
      .aiap-sc-bar      (the pill — position:relative)
        .aiap-sc-mag    (magnifier icon, absolute left)
        .aiap-sc-input  (text field, flex:1, no border/bg)
        .aiap-sc-go     (circular send button)
*/
.aiap-sc-bar-wrap {
  padding: 0 20px;
  margin-bottom: 18px;
}

.aiap-sc-bar {
  position: relative;
  display: flex;
  align-items: center;
  /* pill shape */
  border-radius: 100px;
  /* border on the wrapper, NOT on the input */
  border: 2px solid #e2e8f0;
  background: #ffffff;
  /* left padding leaves room for the magnifier icon */
  padding: 7px 7px 7px 48px;
  box-shadow: 0 2px 16px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  transition: border-color .2s, box-shadow .2s;
}
.aiap-sc-bar:focus-within {
  border-color: var(--a);
  box-shadow: 0 4px 20px rgba(0,0,0,.08), 0 0 0 4px rgba(99,102,241,.12);
}

/* Magnifier — absolutely positioned so it never shifts the layout */
.aiap-sc-mag {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  color: #94a3b8;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.aiap-sc-mag svg { width: 20px; height: 20px; stroke: currentColor; fill: none; display: block; }

/* Text input — NO border, NO background of its own */
.aiap-sc-input {
  flex: 1;
  min-width: 0;
  /* kill browser defaults completely */
  -webkit-appearance: none;
  appearance: none;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  /* typography */
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 15.5px;
  color: #0f172a;
  padding: 7px 8px 7px 0;
  line-height: 1.4;
  display: block;
}
.aiap-sc-input::placeholder { color: #94a3b8; }

/* Send button — circle sitting inside the pill, no gap */
.aiap-sc-go {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50% !important;
  background: var(--a);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99,102,241,.4);
  transition: background .15s, transform .12s;
  /* prevent the button itself from adding internal padding */
  padding: 0;
}
.aiap-sc-go:hover  { background: #4f46e5; transform: scale(1.06); }
.aiap-sc-go:active { transform: scale(.94); }
.aiap-sc-go svg    { width: 18px; height: 18px; fill: #ffffff; display: block; flex-shrink: 0; }

/* Loading spinner replaces icon */
.aiap-sc-go.is-loading { pointer-events: none; }
.aiap-sc-go.is-loading svg { display: none; }
.aiap-sc-go.is-loading::after {
  content: '';
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: aiap-spin .65s linear infinite;
  display: block;
}
@keyframes aiap-spin { to { transform: rotate(360deg); } }

/* ── Suggestion Chips ──────────────────────────────────── */
.aiap-sc-sugs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0 20px 6px;
}

.aiap-sc-sug {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, transform .12s, box-shadow .15s;
  white-space: nowrap;
  line-height: 1.4;
}
.aiap-sc-sug svg { width: 14px; height: 14px; stroke: #94a3b8; fill: none; transition: stroke .15s; flex-shrink: 0; }
.aiap-sc-sug:hover {
  border-color: var(--a);
  color: var(--a);
  background: rgba(99,102,241,.06);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.aiap-sc-sug:hover svg { stroke: var(--a); }

/* ── Results wrapper ───────────────────────────────────── */
.aiap-sc-results {
  padding: 28px 20px 0;
  animation: aiap-fadein .25s ease;
}
@keyframes aiap-fadein { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

/* ── Skeleton loader ───────────────────────────────────── */
.aiap-sc-skeleton { display: flex; flex-direction: column; gap: 10px; }

.aiap-sc-sk-lbl,
.aiap-sc-sk-line,
.aiap-sc-sk-card {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: aiap-shimmer 1.3s infinite;
  border-radius: 8px;
}
.aiap-sc-sk-lbl  { height: 18px; width: 80px; }
.aiap-sc-sk-line { height: 14px; width: 100%; }
.aiap-sc-sk-card { height: 80px; border-radius: 14px; }
@keyframes aiap-shimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }

/* ── Summary card ──────────────────────────────────────── */
.aiap-sc-summary {
  background: rgba(99,102,241,.07);
  border: 1.5px solid rgba(99,102,241,.22);
  border-radius: 18px;
  padding: 18px 22px;
  margin-bottom: 24px;
}
/* accent override so user's custom color works */
.aiap-sc-wrap[style*="--a:"] .aiap-sc-summary {
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.1);
}

.aiap-sc-sum-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--a);
  margin-bottom: 10px;
}
.aiap-sc-sum-label svg { width: 14px; height: 14px; stroke: var(--a); fill: none; flex-shrink: 0; }

.aiap-sc-sum-text {
  font-size: 15px;
  line-height: 1.72;
  color: #1e293b;
}
.aiap-sc-sum-text p { margin: 0 0 9px; }
.aiap-sc-sum-text p:last-child { margin: 0; }
.aiap-sc-sum-text strong { font-weight: 600; }

/* ── Related links ─────────────────────────────────────── */
.aiap-sc-links-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: #94a3b8; margin-bottom: 10px;
}

.aiap-sc-links-grid { display: flex; flex-direction: column; gap: 9px; }

.aiap-sc-link-card {
  display: flex !important;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  text-decoration: none !important;
  color: #0f172a !important;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  cursor: pointer;
}
.aiap-sc-link-card:hover {
  border-color: var(--a);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  transform: translateY(-1px);
  text-decoration: none !important;
}

.aiap-sc-lnum {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(99,102,241,.1);
  color: var(--a);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}

.aiap-sc-lbody { flex: 1; min-width: 0; }

.aiap-sc-ltitle {
  font-size: 14px; font-weight: 600; color: #0f172a;
  margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
.aiap-sc-link-card:hover .aiap-sc-ltitle { color: var(--a); }

.aiap-sc-lexcerpt {
  font-size: 12.5px; color: #64748b; line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.aiap-sc-lurl {
  font-size: 11px; color: #94a3b8; margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}

.aiap-sc-larrow {
  flex-shrink: 0; color: #cbd5e1; margin-top: 4px;
  transition: color .15s, transform .15s;
}
.aiap-sc-larrow svg { width: 16px; height: 16px; stroke: currentColor; fill: none; display: block; }
.aiap-sc-link-card:hover .aiap-sc-larrow { color: var(--a); transform: translateX(2px); }

/* ── Error ─────────────────────────────────────────────── */
.aiap-sc-error {
  background: #fef2f2; border: 1.5px solid #fecaca;
  border-radius: 12px; padding: 13px 16px;
  color: #991b1b; font-size: 14px; line-height: 1.5;
}

/* ── New search button ─────────────────────────────────── */
.aiap-sc-newbtn-wrap { padding: 20px 20px 0; text-align: center; }
.aiap-sc-reset {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1.5px solid #e2e8f0;
  border-radius: 100px; padding: 9px 20px;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
  color: #64748b; cursor: pointer; transition: all .15s;
}
.aiap-sc-reset svg { width: 14px; height: 14px; stroke: currentColor; fill: none; flex-shrink: 0; }
.aiap-sc-reset:hover { border-color: var(--a); color: var(--a); background: rgba(99,102,241,.06); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 580px) {
  .aiap-sc-hero { padding: 32px 16px 22px; }
  .aiap-sc-bar-wrap, .aiap-sc-sugs, .aiap-sc-results, .aiap-sc-newbtn-wrap { padding-left: 14px; padding-right: 14px; }
  .aiap-sc-input { font-size: 15px; }
}
