/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0f0f13;
  --surface: #1a1a22;
  --surface-hover: #22222d;
  --border: #2a2a38;
  --text: #eaeaf0;
  --text-muted: #8888a0;
  --accent: #c9a46c;
  --accent-light: #e0c999;
  --accent-dark: #a07d4a;
  --danger: #e85454;
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===== Container ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  transition: max-width 0.3s ease;
}

/* ===== Header ===== */
.header {
  text-align: center;
  margin-bottom: 40px;
}

.title {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ===== Card ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

/* ===== Form Fields ===== */
.field {
  margin-bottom: 24px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 164, 108, 0.15);
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

/* ===== Toggle Group ===== */
.toggle-group {
  display: flex;
  gap: 12px;
}

.toggle-btn {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn:hover {
  background: var(--surface-hover);
}

.toggle-btn.active {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(201, 164, 108, 0.1);
}

/* ===== Submit Button ===== */
.submit-btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(201,164,108,0.25);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

/* ===== Background Blobs ===== */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--accent);
  top: -200px;
  right: -200px;
}

.blob-2 {
  width: 300px;
  height: 300px;
  background: var(--accent-dark);
  bottom: -150px;
  left: -150px;
}

/* ===== Logo ===== */
.logo {
  margin-bottom: 16px;
}

.logo-icon {
  font-size: 2.5rem;
  color: var(--accent);
  display: inline-block;
}

.label-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-muted);
}

/* ===== Spinner ===== */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ===== Multi-select Component ===== */
.multiselect {
  position: relative;
  width: 100%;
}

.multiselect-selected {
  min-height: 48px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.multiselect-selected:hover {
  border-color: var(--accent);
}

.multiselect-placeholder {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.multiselect-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(201, 164, 108, 0.15);
  border: 1px solid rgba(201, 164, 108, 0.3);
  border-radius: 6px;
  color: var(--accent-light);
  font-size: 0.85rem;
  font-weight: 500;
}

.multiselect-tag-remove {
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--accent);
  transition: color 0.2s;
  padding: 0 2px;
}

.multiselect-tag-remove:hover {
  color: var(--danger);
}

.multiselect-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-height: 300px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.multiselect-search {
  padding: 12px 16px;
  background: var(--bg);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}

.multiselect-search:focus {
  border-bottom-color: var(--accent);
}

.multiselect-search::placeholder {
  color: var(--text-muted);
}

.multiselect-options {
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
}

.multiselect-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
  font-size: 0.95rem;
}

.multiselect-option:hover {
  background: var(--surface-hover);
}

.multiselect-option.selected {
  background: rgba(201, 164, 108, 0.1);
  color: var(--accent-light);
}

.multiselect-option .check {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  color: var(--accent);
  font-weight: bold;
  font-size: 0.9rem;
}

.multiselect-option.selected .check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Scrollbar styling for multiselect options */
.multiselect-options::-webkit-scrollbar {
  width: 8px;
}

.multiselect-options::-webkit-scrollbar-track {
  background: var(--bg);
}

.multiselect-options::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.multiselect-options::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dark);
}

/* ===== Error Banner ===== */
.error-banner {
  margin-top: 24px;
  padding: 14px 20px;
  background: rgba(232, 84, 84, 0.1);
  border: 1px solid rgba(232, 84, 84, 0.3);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.9rem;
}

/* ===================================================== */
/* ============= NEW VERTICAL RESULTS UI ============== */
/* ===================================================== */

.results {
  margin-top: 40px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.results-title {
  font-family: "Playfair Display", serif;
  font-size: 1.4rem;
  font-weight: 600;
}

.results-badge {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.results-badge.gpt {
  background: rgba(16, 163, 127, 0.15);
  color: #10a37f;
}

.results-badge.claude {
  background: rgba(204, 150, 68, 0.15);
  color: var(--accent-light);
}

/* ===== Audience Stack ===== */

.audience-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.audience-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.25s ease;
}

.audience-card.open {
  border-color: var(--accent-dark);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.audience-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.audience-card-header:hover {
  background: var(--surface-hover);
}

.audience-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audience-chevron {
  transition: transform 0.25s ease;
  color: var(--text-muted);
}

.audience-card.open .audience-chevron {
  transform: rotate(180deg);
}

.audience-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.3s ease;
  padding: 0 22px;
}

.audience-card.open .audience-card-body {
  max-height: 2000px;
  padding: 0 22px 20px;
}

/* ===== Nested Trigger ===== */

.trigger-card {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  overflow: hidden;
  transition: all 0.25s ease;
}

.trigger-card.open {
  border-color: var(--accent);
}

.trigger-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
}

.trigger-header:hover {
  background: var(--surface-hover);
}

.trigger-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.trigger-name {
  font-size: 1rem;
  font-weight: 600;
}

.trigger-chevron {
  transition: transform 0.25s ease;
  color: var(--text-muted);
}

.trigger-card.open .trigger-chevron {
  transform: rotate(180deg);
}

.trigger-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 16px;
}

.trigger-card.open .trigger-body {
  max-height: 1000px;
  padding: 10px 16px 16px;
}

.trigger-section {
  margin-bottom: 16px;
}

.section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.section-list {
  list-style: none;
}

.section-list li {
  position: relative;
  padding: 6px 0 6px 18px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(42, 42, 56, 0.5);
}

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

.section-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
