/* ============================================================
   Plus-One Calculator — Styles
   Two modes: Individual (decision-tree wizard) & Batch (table)
   ============================================================ */

/* ---- Tab Bar ---- */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tab-btn:hover:not(.active) {
  color: var(--color-text);
}

/* ---- Tab Content Panels ---- */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ---- Progress Dots ---- */
.progress-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 28px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  transition: all var(--transition-fast);
}

.dot.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-light);
}

.dot.completed {
  border-color: #059669;
  background: #059669;
}

/* ---- Question Cards (Wizard) ---- */
.question-card {
  display: none;
  animation: fadeSlideIn 0.3s ease;
}

.question-card.active {
  display: block;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 8px;
  line-height: 1.4;
}

.question-card p {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ---- Answer Options ---- */
.answer-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.answer-btn {
  padding: 12px 24px;
  border: 2px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 120px;
  text-align: center;
}

.answer-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
  transform: translateY(-1px);
}

.answer-btn:active {
  transform: translateY(0);
}

.answer-btn.selected {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* ---- Result Card ---- */
.result-card {
  text-align: center;
  padding: 32px 24px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  margin-top: 8px;
  animation: fadeSlideIn 0.35s ease;
}

.result-card.yes {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.result-card.maybe {
  border-color: #fde68a;
  background: #fffbeb;
}

.result-card.no {
  border-color: #fecaca;
  background: #fef2f2;
}

.result-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 12px;
}

.result-card.yes .result-icon {
  color: #059669;
}

.result-card.maybe .result-icon {
  color: #d97706;
}

.result-card.no .result-icon {
  color: #dc2626;
}

.result-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--color-text);
}

.result-card p {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  margin: 0 0 16px;
  line-height: 1.5;
}

.result-score {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.result-card.yes .result-score {
  color: #059669;
}

.result-card.maybe .result-score {
  color: #d97706;
}

.result-card.no .result-score {
  color: #dc2626;
}

/* ---- Batch Mode: Input Row ---- */
.batch-input-row {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-bottom: 20px;
}

.batch-input-row .input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.batch-input-row .input-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.batch-input-row .input-group input {
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.batch-input-row .input-group input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.batch-input-row .add-btn {
  padding: 10px 20px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}

.batch-input-row .add-btn:hover {
  background: var(--color-primary-hover, #4338ca);
  transform: translateY(-1px);
}

.batch-input-row .add-btn:active {
  transform: translateY(0);
}

/* ---- Batch Table ---- */
.batch-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.batch-table th {
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  text-align: left;
  border-bottom: 2px solid var(--color-border);
  background: var(--color-bg);
  white-space: nowrap;
}

.batch-table td {
  padding: 10px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}

.batch-table tr:last-child td {
  border-bottom: none;
}

.batch-table tr:hover {
  background: var(--color-bg);
}

.batch-table td:first-child {
  font-weight: 600;
}

.batch-table select {
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.batch-table select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* ---- Decision Badges ---- */
.decision-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.decision-badge.yes {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.decision-badge.maybe {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.decision-badge.no {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* ---- Remove Button (batch rows) ---- */
.btn-remove-batch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 150ms ease;
}

.btn-remove-batch:hover {
  background: #fef2f2;
  color: #ef4444;
}

/* ---- Summary Stats Bar ---- */
.summary-stats-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 80px;
  text-align: center;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

/* ---- Toast Notification ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: #1e293b;
  color: #fff;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9999;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ---- Wizard Navigation Buttons ---- */
.wizard-nav {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: space-between;
}

.wizard-nav .btn-back {
  padding: 10px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.wizard-nav .btn-back:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.wizard-nav .btn-reset {
  padding: 10px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.wizard-nav .btn-reset:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* ---- Action Bar (export/import/clear) ---- */
.action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ---- Empty State ---- */
.empty-state {
  padding: 40px 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.empty-state svg {
  margin-bottom: 8px;
  opacity: 0.4;
}

/* ============================================================
   Responsive — 768px
   ============================================================ */
@media (max-width: 768px) {
  .tab-bar {
    gap: 2px;
  }

  .tab-btn {
    padding: 9px 12px;
    font-size: 0.82rem;
  }

  .answer-options {
    flex-direction: column;
  }

  .answer-btn {
    width: 100%;
    min-width: unset;
  }

  .batch-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .batch-input-row .add-btn {
    width: 100%;
  }

  .summary-stats-bar {
    gap: 10px;
    padding: 12px 14px;
  }

  .stat-value {
    font-size: 1.15rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .result-card {
    padding: 24px 16px;
  }

  .result-icon {
    font-size: 2.4rem;
  }

  .result-score {
    font-size: 1.3rem;
  }

  .action-bar {
    flex-direction: column;
  }

  .action-bar .btn {
    width: 100%;
    text-align: center;
  }

  .wizard-nav {
    flex-direction: column;
  }

  .wizard-nav .btn-back,
  .wizard-nav .btn-reset {
    width: 100%;
    text-align: center;
  }
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
  /* Hide interactive / non-essential elements */
  .tab-bar,
  .wizard-nav,
  .batch-input-row,
  .btn-remove-batch,
  .action-row,
  .toast,
  .no-print,
  .ad-zone,
  .site-header,
  .site-footer,
  .founder-blurb,
  .recent-tools-section {
    display: none !important;
  }

  /* Show all tab content for printing */
  .tab-content {
    display: block !important;
    page-break-inside: avoid;
  }

  /* Show all question cards for reference */
  .question-card {
    display: block !important;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ccc;
  }

  .question-card:last-child {
    border-bottom: none;
  }

  .tool-workspace {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  body {
    background: #fff !important;
  }

  .result-card {
    border-width: 2px !important;
    break-inside: avoid;
  }

  .batch-table-wrapper {
    overflow: visible;
    border: none;
  }

  .batch-table {
    font-size: 0.8rem;
  }

  .batch-table th,
  .batch-table td {
    padding: 6px 8px;
  }

  .decision-badge {
    border-width: 1px !important;
  }

  .summary-stats-bar {
    border: 1px solid #ccc;
    background: #f9f9f9 !important;
  }
}
