/* Assessment Theme - Interactive SRE Maturity Assessment */

/* Layout */
.assessment-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.assessment-header {
  text-align: center;
  padding: 30px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.assessment-header h1 {
  font-size: 2rem;
  margin: 0 0 10px 0;
  color: var(--text-primary);
}

.assessment-header .subtitle {
  color: var(--text-secondary);
  margin: 0;
}

.assessment-main {
  flex: 1;
}

.assessment-footer {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.assessment-footer a {
  color: var(--accent-cyan);
}

/* Sections */
section {
  margin-bottom: 40px;
}

section h2 {
  font-size: 1.25rem;
  margin: 0 0 15px 0;
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-cyan);
  padding-bottom: 8px;
  display: inline-block;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-top: 20px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent-cyan);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

/* Forms */
.start-form {
  max-width: 500px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: var(--accent-cyan);
  color: var(--bg-primary);
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--accent-primary-light);
}

.btn-secondary {
  padding: 12px 24px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

.btn-outline {
  padding: 12px 24px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}

.step-number {
  width: 36px;
  height: 36px;
  background: var(--accent-cyan);
  color: var(--bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-bottom: 12px;
}

.step-card h3 {
  margin: 0 0 8px 0;
  font-size: 1rem;
}

.step-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Domain Chips */
.domains-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.domain-chip {
  padding: 8px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.domain-chip[data-category="foundations"] { border-left: 3px solid var(--accent-cyan); }
.domain-chip[data-category="observability"] { border-left: 3px solid var(--accent-amber); }
.domain-chip[data-category="incidents"] { border-left: 3px solid var(--accent-rose); }
.domain-chip[data-category="resilience"] { border-left: 3px solid var(--accent-primary); }
.domain-chip[data-category="release"] { border-left: 3px solid var(--accent-emerald); }
.domain-chip[data-category="culture"] { border-left: 3px solid #a78bfa; }
.domain-chip[data-category="infrastructure"] { border-left: 3px solid #f472b6; }

/* Resume Section */
.resume-section {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-amber);
  border-radius: 8px;
  padding: 20px;
}

.resume-info {
  margin: 15px 0;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 0.875rem;
}

.resume-actions {
  display: flex;
  gap: 12px;
}

/* Questionnaire Styles */
.questionnaire-container {
  max-width: 800px;
  margin: 0 auto;
}

.progress-bar {
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  padding: 15px 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

.progress-track {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  transition: width 0.3s;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Domain Section */
.domain-section {
  margin: 30px 0;
  padding: 25px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.domain-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.domain-title {
  margin: 0;
  font-size: 1.25rem;
}

.domain-meta {
  text-align: right;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.domain-owner {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  font-size: 0.75rem;
  margin-top: 5px;
}

/* Question */
.question {
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border-color);
}

.question:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.question-text {
  font-weight: 500;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.question-number {
  color: var(--accent-cyan);
  margin-right: 8px;
}

/* Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.option:hover {
  border-color: var(--border-color);
}

.option.selected {
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
}

.option input {
  display: none;
}

.option-value {
  width: 28px;
  height: 28px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.875rem;
  margin-right: 12px;
  flex-shrink: 0;
}

.option.selected .option-value {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: var(--bg-primary);
}

.option-label {
  flex: 1;
  font-size: 0.9rem;
}

/* Navigation */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-prev {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-next {
  background: var(--accent-cyan);
  border: none;
  color: var(--bg-primary);
  font-weight: 600;
}

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

/* Domain Score Summary */
.domain-score {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-top: 20px;
}

.domain-score-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent-cyan);
}

.domain-score-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Results Page */
.results-container {
  max-width: 900px;
}

.results-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

.score-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
}

.total-score {
  font-size: 4rem;
  font-weight: bold;
  color: var(--accent-cyan);
  line-height: 1;
}

.score-max {
  font-size: 1.5rem;
  color: var(--text-secondary);
}

.maturity-level {
  margin-top: 15px;
  padding: 10px 20px;
  background: var(--bg-tertiary);
  border-radius: 20px;
  display: inline-block;
  font-weight: 600;
}

.level-1 { color: var(--accent-rose); }
.level-2 { color: var(--accent-amber); }
.level-3 { color: var(--accent-cyan); }
.level-4 { color: var(--accent-primary); }
.level-5 { color: var(--accent-emerald); }

/* Radar Chart Container */
.radar-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Domain Results Table */
.domain-results {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.domain-results th,
.domain-results td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.domain-results th {
  background: var(--bg-secondary);
  font-weight: 600;
}

.domain-results .score-bar {
  width: 100px;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.domain-results .score-fill {
  height: 100%;
  border-radius: 4px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
}

.action-buttons .btn-primary,
.action-buttons .btn-secondary,
.action-buttons .btn-outline {
  width: auto;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .results-summary { grid-template-columns: 1fr; }
}

/* Print-only elements (hidden on screen) */
.print-only {
  display: none !important;
}

/* Level Legend (shown in print) */
.level-legend {
  margin-top: 0.2in;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 9pt;
}

.level-legend .legend-item {
  margin-left: 12px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 500;
}

/* Print Footer */
.print-footer {
  position: fixed;
  bottom: 0.3in;
  left: 0.5in;
  right: 0.5in;
  display: flex;
  justify-content: space-between;
  font-size: 8pt;
  border-top: 1px solid;
  padding-top: 8px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  /* Show print-only elements */
  .print-only {
    display: block !important;
  }

  .level-legend.print-only {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
  }

  /* Hide interactive elements */
  .action-buttons,
  .assessment-footer,
  .btn-primary,
  .btn-secondary,
  .btn-outline,
  #download-results {
    display: none !important;
  }

  /* Page setup with page numbers */
  @page {
    size: letter;
    margin: 0.5in 0.5in 0.8in 0.5in;
    @bottom-center {
      content: "Page " counter(page) " of " counter(pages);
      font-size: 9pt;
    }
  }

  /* Reset page layout */
  body {
    font-size: 11pt;
    line-height: 1.4;
    counter-reset: page;
  }

  .assessment-container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .results-container {
    max-width: 100%;
  }

  /* Page 1: Title + Score + Radar Chart */
  .assessment-header {
    text-align: center;
    padding: 0.2in 0;
    margin-bottom: 0.2in;
    border-bottom: 2px solid;
  }

  .assessment-header h1 {
    font-size: 18pt;
    margin-bottom: 8px;
  }

  .assessment-header .subtitle {
    font-size: 11pt;
  }

  .results-summary {
    page-break-after: always;
    margin-bottom: 0;
    gap: 0.3in;
  }

  .score-card {
    padding: 0.3in;
    border-radius: 8px;
    border-width: 2px;
    border-style: solid;
  }

  .total-score {
    font-size: 48pt;
  }

  .radar-container {
    padding: 0.2in;
    border-radius: 8px;
    border-width: 1px;
    border-style: solid;
  }

  #radar-chart {
    max-width: 320px !important;
    max-height: 320px !important;
  }

  /* Page 2: Domain Breakdown */
  .domain-breakdown-section {
    padding-top: 0.3in;
    page-break-after: always;
  }

  .domain-breakdown-section h2 {
    font-size: 14pt;
    margin-bottom: 0.15in;
  }

  .domain-results {
    font-size: 9pt;
    border-radius: 6px;
    overflow: hidden;
    border-width: 1px;
    border-style: solid;
  }

  .domain-results th {
    font-weight: 600;
  }

  .domain-results th,
  .domain-results td {
    padding: 8px 10px;
  }

  .domain-results tr:last-child td {
    border-bottom: none;
  }

  /* Page 3: Strengths/Weaknesses + Recommendations */
  .insights-section {
    padding-top: 0.3in;
    page-break-before: avoid;
  }

  .insights-section h2 {
    font-size: 12pt;
    margin-bottom: 0.12in;
  }

  .insights-section li {
    margin-bottom: 6px;
    font-size: 9pt;
    border-width: 1px;
    border-style: solid;
  }

  .insights-section + section {
    margin-top: 0.25in;
  }

  .insights-section + section h2 {
    font-size: 12pt;
  }

  .insights-section + section li {
    font-size: 9pt;
    border-width: 1px;
    border-style: solid;
  }

  /* Ensure sections don't break awkwardly */
  section {
    page-break-inside: avoid;
  }

  /* Hide rubric links in print */
  .domain-results a {
    display: none;
  }

  /* ========== LIGHT THEME ========== */
  body.print-light,
  body.print-light .assessment-container {
    background: white !important;
    color: #1a1a1a !important;
  }

  body.print-light .assessment-header {
    border-bottom-color: #0891b2;
  }

  body.print-light .assessment-header h1 {
    color: #1a1a1a !important;
  }

  body.print-light .assessment-header .subtitle {
    color: #666 !important;
  }

  body.print-light .score-card {
    background: #fff !important;
    border-color: #0891b2;
  }

  body.print-light .total-score {
    color: #0891b2 !important;
  }

  body.print-light .score-max {
    color: #666 !important;
  }

  body.print-light .maturity-level {
    background: transparent !important;
    border: none !important;
    color: #0891b2 !important;
    padding: 0 !important;
    font-size: 14pt;
  }

  body.print-light .radar-container {
    background: #fff !important;
    border-color: #ddd;
  }

  body.print-light .domain-breakdown-section h2,
  body.print-light .insights-section h2,
  body.print-light .insights-section + section h2 {
    color: #1a1a1a !important;
    border-bottom-color: #0891b2 !important;
  }

  body.print-light .domain-results {
    border-color: #ddd;
  }

  body.print-light .domain-results th {
    background: #f8fafc !important;
    color: #1a1a1a !important;
    border-bottom: 2px solid #ddd;
  }

  body.print-light .domain-results td {
    border-bottom-color: #eee;
  }

  body.print-light .domain-results .score-bar {
    background: #e5e7eb !important;
  }

  body.print-light .insights-section li,
  body.print-light .insights-section + section li {
    background: #f8fafc !important;
    border-color: #e5e7eb !important;
  }

  body.print-light .level-legend {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
  }

  body.print-light .print-footer {
    color: #666;
    border-top-color: #ddd;
  }

  /* Light theme level colors */
  body.print-light .level-1 { color: #e11d48 !important; }
  body.print-light .level-2 { color: #d97706 !important; }
  body.print-light .level-3 { color: #0891b2 !important; }
  body.print-light .level-4 { color: #0d9488 !important; }
  body.print-light .level-5 { color: #059669 !important; }

  body.print-light .legend-item.level-1 { background: #fee2e2; color: #e11d48; }
  body.print-light .legend-item.level-2 { background: #fef3c7; color: #d97706; }
  body.print-light .legend-item.level-3 { background: #cffafe; color: #0891b2; }
  body.print-light .legend-item.level-4 { background: #ccfbf1; color: #0d9488; }
  body.print-light .legend-item.level-5 { background: #d1fae5; color: #059669; }

  /* ========== DARK THEME ========== */
  body.print-dark,
  body.print-dark .assessment-container {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.print-dark .assessment-header {
    border-bottom-color: #22d3ee;
  }

  body.print-dark .assessment-header h1 {
    color: #f1f5f9 !important;
  }

  body.print-dark .assessment-header .subtitle {
    color: #94a3b8 !important;
  }

  body.print-dark .score-card {
    background: #1e293b !important;
    border-color: #22d3ee;
  }

  body.print-dark .total-score {
    color: #22d3ee !important;
  }

  body.print-dark .score-max {
    color: #94a3b8 !important;
  }

  body.print-dark .maturity-level {
    background: transparent !important;
    border: none !important;
    color: #22d3ee !important;
    padding: 0 !important;
    font-size: 14pt;
  }

  body.print-dark .radar-container {
    background: #1e293b !important;
    border-color: #334155;
  }

  body.print-dark .domain-breakdown-section h2,
  body.print-dark .insights-section h2,
  body.print-dark .insights-section + section h2 {
    color: #f1f5f9 !important;
    border-bottom-color: #22d3ee !important;
  }

  body.print-dark .domain-results {
    border-color: #334155;
  }

  body.print-dark .domain-results th {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border-bottom: 2px solid #334155;
  }

  body.print-dark .domain-results td {
    border-bottom-color: #334155;
    color: #e2e8f0 !important;
  }

  body.print-dark .domain-results .score-bar {
    background: #334155 !important;
  }

  body.print-dark .insights-section li,
  body.print-dark .insights-section + section li {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
  }

  body.print-dark .level-legend {
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
  }

  body.print-dark .print-footer {
    color: #94a3b8;
    border-top-color: #334155;
  }

  /* Dark theme level colors */
  body.print-dark .level-1 { color: #fb7185 !important; }
  body.print-dark .level-2 { color: #fbbf24 !important; }
  body.print-dark .level-3 { color: #22d3ee !important; }
  body.print-dark .level-4 { color: #2dd4bf !important; }
  body.print-dark .level-5 { color: #34d399 !important; }

  body.print-dark .legend-item.level-1 { background: #881337; color: #fb7185; }
  body.print-dark .legend-item.level-2 { background: #78350f; color: #fbbf24; }
  body.print-dark .legend-item.level-3 { background: #164e63; color: #22d3ee; }
  body.print-dark .legend-item.level-4 { background: #134e4a; color: #2dd4bf; }
  body.print-dark .legend-item.level-5 { background: #064e3b; color: #34d399; }
}
