/**
 * Shared CSS for GLYDE Chat Widget demo/test pages (Group A).
 * Used by: cdn-test.html, cdn-test-local.html, verstela-demo.html
 *
 * Each page may add file-specific overrides in an inline <style> block
 * (e.g. body gradient colour, local-dev badge, override input styles).
 */

/* ── Layout ─────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}
.container {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
h1 {
  margin: 0 0 10px 0;
  color: #1a1a2e;
}
.subtitle {
  color: #666;
  margin-bottom: 30px;
}
.version-badge {
  display: inline-block;
  background: #10b981;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  margin-left: 10px;
}

/* ── Info box (expandable "Most Advanced Voice AI") ────────── */
.info-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.info-box h3 {
  margin: 0 0 10px 0;
  color: #0369a1;
}
.info-box p {
  margin: 0;
  color: #0c4a6e;
}
.info-box-expandable {
  position: relative;
  max-height: 200px;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.info-box-expandable.expanded {
  max-height: 1200px;
}
.info-box-expandable .info-box-content {
  padding-bottom: 56px;
}
.info-box-expandable .info-box-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(transparent, #f0f9ff);
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1;
}
.info-box-expandable.expanded .info-box-fade {
  opacity: 0;
  pointer-events: none;
}
.info-box-expand-toggle {
  position: absolute;
  bottom: 12px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #0ea5e9;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
}
.info-box-expand-toggle:hover {
  background: #0284c7;
}
.info-box-expand-toggle .chevron {
  display: inline-block;
  transition: transform 0.25s ease;
}
.info-box-expandable.expanded .info-box-expand-toggle .chevron {
  transform: rotate(180deg);
}
.features-list {
  margin: 16px 0 0 0;
  padding-left: 20px;
  color: #0c4a6e;
}
.features-list li {
  margin-bottom: 8px;
}
.features-list ul {
  margin: 4px 0 0 0;
  padding-left: 20px;
  list-style-type: circle;
}

/* ── Scenario selection ────────────────────────────────────── */
.scenario-section {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.scenario-section h3 {
  margin: 0 0 15px 0;
  color: #92400e;
}
.scenario-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}
.scenario-card {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}
.scenario-card:hover {
  border-color: #f59e0b;
  background: #fffbeb;
}
.scenario-card.active {
  border-color: #f59e0b;
  background: #fef3c7;
}
.scenario-card h4 {
  margin: 0 0 8px 0;
  color: #1f2937;
  font-size: 14px;
}
.scenario-card p {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}
.scenario-card .context-type {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 8px;
  font-family: monospace;
}

/* ── Code blocks & integration examples ────────────────────── */
.code-block {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
  font-size: 13px;
}
.code-block code {
  background: transparent;
  color: inherit;
  padding: 0;
  white-space: pre;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, #c026d3 0%, #7c3aed 100%);
  color: white;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(192, 38, 211, 0.4);
}
.btn-secondary {
  background: #f1f5f9;
  color: #475569;
}
.btn-secondary:hover {
  background: #e2e8f0;
}
.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

/* ── Inline widget demo ────────────────────────────────────── */
.inline-demo {
  margin: 30px 0;
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}
.inline-demo h4 {
  margin: 0 0 15px 0;
  color: #374151;
}
#inline-widget-container {
  width: 100%;
  min-height: 0;
}

/* ── Current config display ────────────────────────────────── */
.current-config {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  font-family: monospace;
  font-size: 12px;
}
.current-config strong {
  color: #065f46;
}

/* ── Collapsible details ───────────────────────────────────── */
details {
  margin-top: 30px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  color: #374151;
  padding: 10px 0;
}
