@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
}

:root {
  /* Warmer dark theme from screenshot - lightened slightly */
  --bg-primary: #120b0b; /* Slightly lighter brownish black */
  --bg-surface: #1a1111; /* Lighter warm charcoal */
  --bg-elevated: #241818;
  --bg-input: #0a0505;

  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #a0a0a0;

  /* Red-Orange accent from screenshot */
  --accent-primary: #f04438; 
  --accent-hover: #ff5a4d;
  --accent-soft: rgba(240, 68, 56, 0.15);

  /* Warm glow for radial gradients */
  --glow-color: rgba(240, 68, 56, 0.12);

  /* Other functional colors */
  --tag-orange: #ff8a00;
  --tag-orange-soft: rgba(255, 138, 0, 0.15);
  --info: #22a3b3;
  --info-soft: rgba(34, 163, 179, 0.12);
  --info-border: rgba(34, 163, 179, 0.25);
  --success: #4ade80;
  --warning: #ff8a00;
  --danger: #f04438;

  --border: #332222;
  --border-light: #4a3535;
  --border-accent: rgba(240, 68, 56, 0.4);

  --shadow: rgba(0, 0, 0, 0.85);
  --shadow-glow: rgba(240, 68, 56, 0.25);
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at 50% -20%, #3d1a1a 0%, var(--bg-primary) 85%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.app-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-header {
  margin-bottom: 48px;
}

.new-feature-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  padding: 10px 16px;
  background: var(--accent-soft);
  color: var(--accent-primary);
  border: 1px solid var(--border-accent);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.new-feature-btn:hover {
  background: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 4px 12px var(--shadow-glow);
}

.main-content {
  padding: 64px 80px;
  background: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.content-card {
  background: var(--bg-surface);
  border-radius: 24px;
  box-shadow: 0 20px 50px var(--shadow);
  padding: 48px;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 900px;
  position: relative;
  overflow: hidden;
}

.content-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(ellipse at top right, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 20px;
}

.brand {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-secondary);
  margin-top: 6px;
  font-size: 15px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step {
  background: transparent;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.step.active {
  background: var(--accent-soft);
  color: var(--text-primary);
  border-color: var(--border-accent);
  box-shadow: 0 4px 20px var(--shadow-glow);
}

.step.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.step.active .step-number {
  background: var(--accent-primary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.content h1 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--text-primary);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
}

.hint {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 15px;
}

.message {
  background: var(--info-soft);
  color: var(--info);
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--info-border);
  font-size: 14px;
  font-weight: 500;
}

.form {
  display: grid;
  gap: 12px;
}

label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

textarea,
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 200px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.textarea-scroll {
  min-height: calc(1.6em * 5 + 28px);
  max-height: calc(1.6em * 10 + 28px);
  overflow-y: auto;
}

.textarea-review {
  min-height: calc(1.6em * 27 + 28px);
  max-height: calc(1.6em * 42 + 28px);
  overflow-y: auto;
  white-space: pre-wrap;
}

textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea::placeholder,
input::placeholder {
  color: var(--text-muted);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

button {
  background: var(--accent-primary);
  color: var(--text-primary);
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-glow);
}

button:focus {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

button:active {
  transform: translateY(0);
}

/* Secondary/outline button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Tag/pill style buttons (like the orange tags in screenshot) */
.tag {
  display: inline-flex;
  align-items: center;
  background: var(--tag-orange-soft);
  color: var(--tag-orange);
  border: 1px solid rgba(255, 138, 0, 0.3);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Links */
a {
  color: var(--info);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Step completed state */
.step.completed {
  background: var(--bg-elevated);
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.3);
}

.step.completed .step-number {
  background: rgba(74, 222, 128, 0.2);
}

/* PRD Source preview */
.prd-source {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 28px;
}

.source-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
  font-weight: 600;
}

.source-preview {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.source-preview-scroll {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: calc(1.6em * 5);
  max-height: calc(1.6em * 10);
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Form sections for PRD */
.form-section {
  margin-bottom: 24px;
}

.form-section label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
}

.form-section textarea {
  min-height: 120px;
}

.doc-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.market-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Input field styling */
.input-field {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.input-field-compact {
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.4;
  height: calc(1.4em * 1 + 12px);
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Selection styling */
::selection {
  background: var(--accent-primary);
  color: var(--text-primary);
}

/* Follow-up questions section */
.followup-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-top: 24px;
  margin-bottom: 8px;
}

.followup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--tag-orange);
  margin-bottom: 8px;
}

.followup-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tag-orange);
}

.followup-hint {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.followup-field {
  margin-bottom: 20px;
}

.followup-field:last-child {
  margin-bottom: 0;
}

.followup-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.followup-field .field-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.followup-field textarea {
  min-height: 80px;
  background: var(--bg-input);
  border-color: var(--border);
}

.followup-field textarea:focus {
  border-color: var(--tag-orange);
  box-shadow: 0 0 0 3px var(--tag-orange-soft);
}

/* Compact textarea when follow-up is shown */
.textarea-compact {
  min-height: 120px !important;
}

/* Info message style */
.message-info {
  background: var(--tag-orange-soft);
  color: var(--tag-orange);
  border-color: rgba(255, 138, 0, 0.3);
}

/* Small textarea variant */
.textarea-small {
  min-height: 100px !important;
}

/* Optional label styling */
.optional-label {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12px;
}

/* ===== Analysis Page Styles ===== */

/* Analysis sections */
.analysis-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.analysis-section.problem-summary {
  background: var(--bg-input);
  border-color: var(--border-light);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-primary);
}

.section-icon.docs-icon {
  background: var(--info-soft);
  color: var(--info);
}

.section-icon.market-icon {
  background: var(--tag-orange-soft);
  color: var(--tag-orange);
}

.section-icon.solutions-icon {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
}

.section-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 4px 10px;
  border-radius: 6px;
}

.section-toggle {
  margin-left: 10px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.section-toggle:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.collapsible-content.is-collapsed {
  display: none;
}

.section-status {
  margin-left: auto;
  margin-right: 12px;
  font-size: 12px;
  color: var(--info);
  background: var(--info-soft);
  border: 1px solid var(--info-border);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.section-status.inline {
  margin-left: 10px;
  margin-right: 0;
}

.section-content {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.section-content p {
  margin: 0 0 12px 0;
}

.problem-summary-text {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  min-height: calc(1.6em * 8);
  max-height: calc(1.6em * 12);
  overflow-y: auto;
  white-space: pre-wrap;
}

.section-content ul {
  margin: 0;
  padding-left: 20px;
}

.section-content li {
  margin-bottom: 6px;
}

.section-hint {
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Context badge in problem summary */
.context-badge {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 12px;
}

.context-badge.context-badge-scroll {
  max-height: calc(1.6em * 6);
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Analysis results */
.analysis-result {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.analysis-result p {
  margin: 0 0 10px 0;
}

.analysis-result ul {
  margin: 8px 0;
}

.doc-note {
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
}

/* Competitor grid */
.competitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.competitor-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.competitor-card.highlighted {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.competitor-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.competitor-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 8px;
}

.competitor-approach {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.competitor-strengths {
  font-size: 12px;
  color: var(--success);
  background: rgba(74, 222, 128, 0.1);
  padding: 6px 10px;
  border-radius: 6px;
}

/* Solutions list */
.solutions-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.solution-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.solution-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.solution-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.solution-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
}

.effort-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
}

.effort-badge.effort-low {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
}

.effort-badge.effort-medium {
  background: var(--tag-orange-soft);
  color: var(--tag-orange);
}

.effort-badge.effort-high {
  background: var(--accent-soft);
  color: var(--accent-primary);
}

.solution-description {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* PRD context section in analysis */
.analysis-section.prd-context {
  border-color: var(--info-border);
  background: var(--info-soft);
}

.analysis-section.prd-context .section-icon {
  background: var(--info);
  color: var(--text-primary);
}

.analysis-section.prd-context .form-section {
  margin-bottom: 16px;
}

.analysis-section.prd-context .form-section:last-child {
  margin-bottom: 0;
}

.analysis-section.prd-context textarea {
  background: var(--bg-surface);
}

/* Epics list layout */
.epic-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.epic-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.epic-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin-bottom: 12px;
}

.epic-select input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent-primary);
}

/* Field hint styling */
.field-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 8px 0;
  line-height: 1.4;
}

/* ===== Kapa Documentation Styles ===== */

.kapa-answer {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.kapa-answer p {
  margin: 0;
}

.doc-error {
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: var(--accent-primary);
  font-size: 13px;
}

.doc-error em {
  font-style: normal;
}

/* Documentation result links */
.analysis-result a {
  color: var(--info);
  text-decoration: none;
  font-weight: 500;
}

.analysis-result a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.analysis-result small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
}
