/**
 * Made2Stick Learning - AI FAQ Assistant Styles (Clean Light UI matching Site Design System)
 */

.ai-faq-widget-root {
  width: 100%;
}

.ai-faq-wrapper {
  background: #ffffff;
  border: 1px solid var(--border-card, #eef2f6);
  border-radius: var(--radius-xl, 24px);
  padding: 44px 38px;
  box-shadow: var(--shadow-sm, 0 2px 4px rgba(15, 23, 42, 0.06));
  position: relative;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
}

.ai-faq-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 28px auto;
}

.ai-faq-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--brand-red, #e11d48);
  background: var(--brand-gradient-soft, linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%));
  border: 1px solid #fecdd3;
  padding: 4px 14px;
  border-radius: 9999px;
  margin-bottom: 12px;
}

.ai-faq-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-dark, #0f172a);
  margin: 0 0 10px 0;
  letter-spacing: -0.025em;
  font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
}

.ai-faq-subtitle {
  font-size: 15.5px;
  color: var(--text-muted, #64748b);
  margin: 0;
  line-height: 1.6;
}

/* Question Chips Grid */
.ai-faq-chips-container {
  margin-bottom: 24px;
}

.ai-faq-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.ai-faq-chip-btn {
  background: var(--bg-light, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  color: var(--text-dark, #0f172a);
  padding: 14px 18px;
  border-radius: var(--radius-md, 14px);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ai-faq-chip-btn .ai-faq-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  color: var(--brand-red, #e11d48);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.ai-faq-chip-btn:hover {
  background: #fff1f2;
  border-color: #fecdd3;
  color: var(--brand-red, #e11d48);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.08);
}

.ai-faq-chip-btn.active {
  background: #fff1f2;
  border-color: var(--brand-red, #e11d48);
  color: var(--brand-red-dark, #be123c);
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.15);
}

.ai-faq-chip-btn.active .ai-faq-chip-icon {
  background: var(--brand-red, #e11d48);
  color: #ffffff;
  border-color: var(--brand-red, #e11d48);
}

/* Input Form */
.ai-faq-input-form {
  margin-top: 18px;
  margin-bottom: 20px;
}

.ai-faq-input-group {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-md, 14px);
  padding: 6px 6px 6px 16px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.ai-faq-input-group:focus-within {
  border-color: var(--brand-red, #e11d48);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

.ai-faq-input-icon {
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
}

.ai-faq-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary, #0f172a);
  font-size: 14.5px;
  padding: 8px 4px;
  font-family: inherit;
}

.ai-faq-input::placeholder {
  color: #94a3b8;
}

.ai-faq-submit-btn {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm, 10px);
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.ai-faq-submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38);
}

.ai-faq-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.ai-faq-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: ai-faq-spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes ai-faq-spin {
  to { transform: rotate(360deg); }
}

/* Response Display Card */
.ai-faq-response-card {
  background: var(--bg-light, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-left: 4px solid var(--brand-red, #e11d48);
  border-radius: var(--radius-md, 14px);
  padding: 26px;
  margin-top: 20px;
  animation: ai-faq-fadeIn 0.25s ease-out;
}

@keyframes ai-faq-fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-faq-response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.ai-faq-response-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-dark, #0f172a);
}

.ai-faq-pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--brand-red, #e11d48);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(225, 29, 72, 0.6);
  display: inline-block;
}

.ai-faq-close-btn {
  background: #e2e8f0;
  border: none;
  color: #64748b;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
}

.ai-faq-close-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.ai-faq-response-body {
  font-size: 15px;
  line-height: 1.7;
  color: #334155;
}

.ai-faq-response-body strong {
  color: #0f172a;
}

.ai-faq-response-body a {
  color: var(--brand-primary, #2563eb);
  text-decoration: underline;
}

.ai-faq-loading-skeleton {
  color: #64748b;
  font-style: italic;
}

@media (max-width: 640px) {
  .ai-faq-wrapper {
    padding: 24px 18px;
  }
  .ai-faq-title {
    font-size: 22px;
  }
  .ai-faq-chips-grid {
    grid-template-columns: 1fr;
  }
  .ai-faq-input-group {
    flex-direction: column;
    padding: 10px;
  }
  .ai-faq-submit-btn {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
  }
}
