/* =========================================================
   ENGINEERING CAREER EXPLORER - THEME DESIGN SYSTEM
   ========================================================= */
:root {
  --bg-page: #050505;
  --bg-card: rgba(18, 18, 23, 0.75);
  --bg-soft: rgba(255, 255, 255, 0.05);
  
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  
  --primary: #8b5cf6;
  --primary-hover: #a78bfa;
  --primary-soft: rgba(139, 92, 246, 0.2);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: rgba(255, 255, 255, 0.08);
  
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 0 40px rgba(139, 92, 246, 0.15);
  
  --container: 740px;
  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', Inter, ui-sans-serif, system-ui, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.15), transparent 25%);
  background-attachment: fixed;
}

.app-shell {
  width: min(100%, var(--container));
  margin-inline: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  border-inline: 1px solid var(--border);
}

/* Header Utilities */
.app-header {
  position: sticky;
  top: 0;
  background: rgba(5, 5, 5, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-back {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  transition: var(--transition);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.progress-container {
  padding: 12px 20px;
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, var(--primary));
  border-radius: var(--radius-pill);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--primary);
}

/* Screen Shells */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  padding: 16px;
}

.screen.active {
  display: flex;
}

/* Intro Screen UI */
.intro-card {
  text-align: center;
  margin-block: auto;
  padding: 24px 12px;
}

.intro-logo {
  color: var(--primary);
  margin-bottom: 16px;
}

.intro-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.intro-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 24px;
}

.intro-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.metric-pill {
  background: var(--bg-soft);
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

.input-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.text-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.text-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: rgba(255, 255, 255, 0.06);
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.checkbox-input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* Chat Platform Core */
.chat-scrollarea {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-bubble {
  max-width: 85%;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  animation: bubbleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  line-height: 1.6;
}

.bubble-system {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.bubble-user {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #ffffff;
  border: none;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.question-card-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-top: 8px;
  backdrop-filter: blur(10px);
}

.q-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 4px;
}

.q-prompt {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.q-instruction {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Input Answer Components */
.options-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  min-height: 52px;
  transition: var(--transition);
  user-select: none;
}

.answer-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.answer-card.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 20px var(--primary-soft);
}

.indicator-dot {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.answer-card.selected .indicator-dot {
  border-color: var(--primary);
  background: var(--primary);
}

.indicator-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.answer-card.selected .indicator-check {
  border-color: var(--primary);
  background: var(--primary);
}

.rank-badge {
  width: 24px;
  height: 24px;
  background: var(--bg-soft);
  color: var(--text-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.answer-card.selected .rank-badge {
  background: var(--primary);
  color: white;
}

/* Allocation UI Component */
.allocation-item {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.allocation-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.allocation-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-input {
  flex: 1;
  height: 6px;
  accent-color: var(--primary);
}

.btn-counter {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
}

.allocation-total-bar {
  position: sticky;
  top: 0;
  background: var(--primary-soft);
  padding: 10px;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

/* Matrix Element Viewport */
.matrix-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--bg-card);
}

.matrix-statement-text {
  font-weight: 600;
  margin-bottom: 10px;
}

.matrix-options-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.matrix-row-option {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
}

.matrix-row-option.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
  font-weight: 600;
}

/* Bottom Actions Control Panel */
.sticky-actions-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  z-index: 90;
}

.btn-primary {
  flex: 1;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  min-height: 54px;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
}

.btn-primary:disabled {
  background: var(--bg-soft);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  padding-inline: 16px;
  min-height: 54px;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Analysis Loading Animation View */
.loading-wrapper {
  margin: auto;
  text-align: center;
  padding: 24px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

.loading-text {
  font-weight: 600;
  color: var(--text-secondary);
  min-height: 24px;
}

/* Result Dashboard Architecture */
.result-navigation-tabs {
  position: sticky;
  top: 60px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 8px 16px;
  z-index: 80;
  scrollbar-width: none;
}

.result-navigation-tabs::-webkit-scrollbar {
  display: none;
}

.tab-pill {
  padding: 6px 14px;
  background: var(--bg-soft);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.tab-pill.active {
  background: var(--text-primary);
  color: white;
}

.result-scroll-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 40px;
}

.result-section {
  scroll-margin-top: 110px;
}

.result-hero {
  text-align: center;
  padding: 24px 16px;
  background: linear-gradient(to bottom, var(--primary-soft), transparent);
  border-radius: var(--radius-lg);
}

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-block: 8px;
}

.score-ring-container {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.badge-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.r-badge {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

/* Grid & Layout Utilities */
.section-headline {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  border-left: 4px solid var(--primary);
  padding-left: 8px;
}

.dna-card, .insight-grid, .explorer-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dna-row {
  margin-bottom: 8px;
}

.dna-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.dna-track {
  height: 12px;
  background: var(--bg-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.dna-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  width: 0%;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Constellation Map Layout */
.universe-svg-container {
  width: 100%;
  background: #0f172a;
  border-radius: var(--radius-lg);
  aspect-ratio: 1;
}

/* Quadrant Vector Framework */
.matrix-svg-container {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  aspect-ratio: 1.2;
}

/* Accordion Structure */
.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.accordion-header {
  padding: 14px;
  background: var(--bg-soft);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-content {
  padding: 14px;
  display: none;
  background: var(--bg-card);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

.accordion-item.open .accordion-content {
  display: block;
}

/* Task Plan Management */
.plan-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.task-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.task-item.done {
  opacity: 0.6;
  background: var(--bg-soft);
}

.task-item.done span {
  text-decoration: line-through;
}

/* Modal Components Architecture */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 20px;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast Engine */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastFade 2.5s ease forwards;
}

/* Keyframe Core Engines */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bubbleUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalPop { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes toastFade { 0% { opacity: 0; transform: translateY(8px); } 15% { opacity: 1; transform: translateY(0); } 85% { opacity: 1; } 100% { opacity: 0; } }

/* Accessibility Focus Architecture */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   PRINT ARCHITECTURE SHEET
   ========================================================= */
@media print {
  body { background: white !important; color: black !important; }
  .app-header, .progress-container, .sticky-actions-bar, .result-navigation-tabs, .no-print, .btn-secondary, .modal-overlay { display: none !important; }
  .app-shell { width: 100% !important; max-width: none !important; box-shadow: none !important; margin: 0 !important; border: none !important; }
  .result-section { break-inside: avoid !important; page-break-inside: avoid !important; margin-bottom: 20px !important; }
  .accordion-content { display: block !important; }
  .dna-fill { background: #3b82f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
