/**
 * CORE SPEC - Spec Analyzer Dedicated Styles
 * File: assets/css/spec_analyzer.css
 * Version: 1.0.0
 */

/* Container & Base Styles */
.cs-analyzer-container {
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 0 64px;
  box-sizing: border-box;
}

/* Glass Card */
.cs-analyzer-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 640px) {
  .cs-analyzer-card {
    padding: 32px;
  }
}

/* Step Bar / Indicator */
.cs-step-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.cs-step-badge {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: #00f0ff;
  letter-spacing: 0.1em;
}

.cs-step-track {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cs-step-dot {
  width: 28px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.cs-step-dot.active {
  background: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.cs-step-dot.completed {
  background: #b026ff;
}

/* Form Styles */
.cs-form-step {
  display: none;
}

.cs-form-step.active {
  display: block;
  animation: csFadeIn 0.3s ease-out;
}

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

.cs-step-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

@media (min-width: 640px) {
  .cs-step-title {
    font-size: 1.75rem;
  }
}

.cs-step-desc {
  font-size: 0.875rem;
  color: #9ca3af;
  margin: 0 0 24px 0;
  line-height: 1.6;
}

/* Choice Grid (Step 1 Use Cases) */
.cs-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .cs-choice-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
  }
}

.cs-choice-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  user-select: none;
  position: relative;
}

.cs-choice-label:hover {
  background: rgba(0, 240, 255, 0.06);
  border-color: rgba(0, 240, 255, 0.4);
  transform: translateY(-2px);
}

.cs-choice-label input[type="radio"],
.cs-choice-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cs-choice-label:has(input:checked) {
  background: rgba(0, 240, 255, 0.12);
  border-color: #00f0ff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25), inset 0 0 12px rgba(0, 240, 255, 0.1);
}

.cs-choice-label:has(input:focus-visible) {
  outline: 2px solid #00f0ff;
  outline-offset: 3px;
}

.cs-choice-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.cs-choice-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.cs-choice-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(176, 38, 255, 0.2);
  color: #c084fc;
  margin-top: 6px;
}

/* Secondary Use Case Sub-Box */
.cs-secondary-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.cs-secondary-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #d1d5db;
  margin-bottom: 6px;
}

.cs-secondary-note {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 16px;
}

/* Scenario Select Cards (Step 2) */
.cs-scenario-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.cs-scenario-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #00f0ff;
  margin-bottom: 14px;
}

.cs-scenario-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cs-option-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
}

.cs-option-label:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
}

.cs-option-label input[type="radio"] {
  margin-top: 4px;
  accent-color: #00f0ff;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.cs-option-label:has(input:checked) {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.6);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

.cs-option-label:has(input:focus-visible) {
  outline: 2px solid #00f0ff;
  outline-offset: 2px;
}

.cs-option-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.cs-option-desc {
  font-size: 0.75rem;
  color: #9ca3af;
  line-height: 1.5;
}

/* Radio Group / Select List in Step 3 & 4 */
fieldset.cs-field-group,
.cs-field-group {
  margin: 0 0 32px 0;
  padding: 0;
  border: 0;
}

.cs-field-legend {
  font-size: 0.95rem;
  font-weight: 800;
  color: #e5e7eb;
  margin-bottom: 14px;
  display: block;
}

.cs-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cs-pill-label {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #d1d5db;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.cs-pill-label:hover {
  border-color: rgba(0, 240, 255, 0.5);
  color: #fff;
}

.cs-pill-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cs-pill-label:has(input:checked) {
  background: #00f0ff;
  border-color: #00f0ff;
  color: #0b0f19;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
}

.cs-pill-label:has(input:focus-visible) {
  outline: 2px solid #00f0ff;
  outline-offset: 3px;
}

/* Action Button Bar */
.cs-btn-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cs-btn-back {
  padding: 12px 20px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #9ca3af;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.cs-btn-back:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.cs-btn-next {
  padding: 12px 28px;
  background: linear-gradient(90deg, #00f0ff 0%, #b026ff 100%);
  border: none;
  border-radius: 10px;
  color: #000;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
  min-height: 44px;
}

.cs-btn-next:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.5);
}

.cs-btn-next:focus-visible,
.cs-btn-back:focus-visible {
  outline: 2px solid #00f0ff;
  outline-offset: 3px;
}

/* Results Section */
.cs-result-section {
  display: none;
  animation: csFadeIn 0.4s ease-out;
}

.cs-result-section.active {
  display: block;
}

.cs-result-header-box {
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 28px;
}

.cs-input-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.cs-summary-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #d1d5db;
}

.cs-btn-reedit,
.cs-btn-reset-all {
  font-size: 0.75rem;
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 8px;
  font-weight: 700;
}

.cs-btn-reedit {
  margin-left: auto;
  color: #00f0ff;
}

.cs-btn-reset-all {
  color: #9ca3af;
  margin-left: 8px;
}

.cs-btn-reset-all:hover {
  color: #f87171;
}

.cs-result-conclusion {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.6;
  margin: 0;
}

@media (min-width: 640px) {
  .cs-result-conclusion {
    font-size: 1.35rem;
  }
}

/* Vertical Stacking Plans Layout (Accessible, Mobile-First) */
.cs-plans-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 36px;
}

/* Main Highlighted Recommended Plan Card */
.cs-plan-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 24px;
  position: relative;
}

.cs-plan-card.recommended {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08) 0%, rgba(176, 38, 255, 0.05) 100%);
  border: 2px solid rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.cs-plan-card.conditional {
  border-left: 4px solid #facc15;
}

.cs-plan-card.expansion {
  border-left: 4px solid #b026ff;
}

.cs-plan-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.cs-plan-card.recommended .cs-plan-badge {
  background: rgba(0, 240, 255, 0.2);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.cs-plan-card.conditional .cs-plan-badge {
  background: rgba(250, 204, 21, 0.15);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.cs-plan-card.expansion .cs-plan-badge {
  background: rgba(176, 38, 255, 0.2);
  color: #e879f9;
  border: 1px solid rgba(176, 38, 255, 0.4);
}

.cs-plan-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
  margin: 0 0 6px 0;
}

.cs-plan-condition {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Spec Item Grid inside Plan */
.cs-spec-items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

@media (min-width: 640px) {
  .cs-spec-items-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cs-spec-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px;
}

.cs-spec-item-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #9ca3af;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cs-spec-item-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

.cs-spec-item-note {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-top: 4px;
  line-height: 1.4;
}

/* Candidate Matching Box */
.cs-candidate-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 28px;
}

.cs-candidate-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-candidate-item {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  margin-bottom: 10px;
  gap: 6px;
}

@media (min-width: 640px) {
  .cs-candidate-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cs-candidate-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: #00f0ff;
}

.cs-candidate-price {
  font-size: 0.8rem;
  color: #d1d5db;
}

.cs-candidate-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: #22d3ee;
  text-decoration: underline;
}

/* Notice & Warning Boxes */
.cs-warning-box {
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  color: #fef08a;
  font-size: 0.82rem;
  line-height: 1.6;
}

.cs-disclaimer-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  margin: 28px 0;
  color: #9ca3af;
  font-size: 0.75rem;
  line-height: 1.6;
}

/* Copy Result Button & Feedback */
.cs-copy-container {
  margin: 20px 0 32px 0;
  text-align: center;
}

.cs-btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.cs-btn-copy:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #00f0ff;
}

.cs-copy-feedback {
  display: block;
  font-size: 0.75rem;
  color: #34d399;
  margin-top: 6px;
  min-height: 18px;
}

/* Dominant CTA Button */
.cs-dominant-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 36px 0;
  text-align: center;
}

.cs-primary-cta-btn {
  display: block;
  padding: 16px 32px;
  background: linear-gradient(90deg, #00f0ff 0%, #b026ff 100%);
  color: #000 !important;
  font-size: 1.05rem;
  font-weight: 900;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.cs-primary-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(0, 240, 255, 0.6);
}

.cs-secondary-cta-link {
  display: inline-block;
  color: #9ca3af;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  padding: 8px 12px;
}

.cs-secondary-cta-link:hover {
  color: #00f0ff;
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .cs-form-step.active,
  .cs-result-section.active {
    animation: none;
  }
  .cs-btn-next,
  .cs-primary-cta-btn,
  .cs-choice-label {
    transition: none;
  }
}
