@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600&display=swap');

/* ==========================================
   CSS Custom Variables & Theme System
   ========================================== */
:root {
  /* Brand Colors */
  --ci-orange: #f9a350;
  --ci-orange-rgb: 249, 163, 80;
  --ci-orange-dark: #e58d35;
  --ci-orange-light: #fbe0c5;
  
  /* RIASEC Specific Colors */
  --color-r: #C0392B; /* Realistic */
  --color-i: #1A5276; /* Investigative */
  --color-a: #6C3483; /* Artistic */
  --color-s: #117A65; /* Social */
  --color-e: #B7770D; /* Enterprising */
  --color-c: #1B4F72; /* Conventional */

  /* Likert Colors */
  --likert-neg-2: #c0392b; /* ไม่ใช่เลย */
  --likert-neg-1: #e74c3c; /* ไม่ค่อยตรง */
  --likert-neutral: #95a5a6; /* ปานกลาง */
  --likert-pos-1: #2ecc71; /* ค่อนข้างตรง */
  --likert-pos-2: #117a65; /* ใช่เลย */

  /* Light Theme Defaults */
  --bg-app: radial-gradient(circle at 0% 0%, hsl(30, 40%, 96%), hsl(30, 20%, 93%));
  --bg-card: rgba(255, 255, 255, 0.85);
  --border-card: rgba(249, 163, 80, 0.15);
  --text-main: #2c3e50;
  --text-muted: #7f8c8d;
  --bg-input-unselected: rgba(236, 240, 241, 0.6);
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 20px rgba(249, 163, 80, 0.08);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 15px rgba(249, 163, 80, 0.3);
  
  /* Transition curve */
  --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --bg-app: radial-gradient(circle at 0% 0%, #1e1b18, #12100e);
  --bg-card: rgba(30, 30, 30, 0.75);
  --border-card: rgba(249, 163, 80, 0.25);
  --text-main: #f5f6fa;
  --text-muted: #a0a0a0;
  --bg-input-unselected: rgba(50, 50, 50, 0.5);
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* ==========================================
   Base Elements & Layout Reset
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Sarabun', sans-serif;
  color: var(--text-main);
  background: var(--bg-app);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  transition: background 0.5s var(--ease-smooth), color 0.3s var(--ease-smooth);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
}

/* ==========================================
   Header & App Branding
   ========================================== */
header {
  width: 100%;
  max-width: 800px;
  padding: 2.5rem 1.5rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.logo-container {
  margin-bottom: 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.logo {
  max-height: 80px;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.4s var(--ease-elastic);
}

.logo:hover {
  transform: scale(1.05);
}

.title-container {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.title-main {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.title-sub {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ci-orange);
  letter-spacing: 1px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  position: absolute;
  top: 2rem;
  right: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
  font-size: 1.2rem;
  transition: all 0.3s var(--ease-smooth);
}

.theme-toggle-btn:hover {
  transform: rotate(30deg) scale(1.1);
  box-shadow: var(--shadow-glow);
  border-color: var(--ci-orange);
}

/* ==========================================
   Main Shell Wrapper
   ========================================== */
main {
  width: 100%;
  max-width: 800px;
  padding: 1rem 1.5rem 3rem 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

main.welcome-active {
  justify-content: center;
  margin: auto 0;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

/* ==========================================
   Progress Indicators
   ========================================== */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: var(--bg-input-unselected);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ci-orange), #ff7e40);
  border-radius: 10px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(249, 163, 80, 0.3);
}

/* ==========================================
   Wizard Pages & Questions Layout
   ========================================== */
.wizard-page {
  display: none;
  flex-direction: column;
  gap: 2.2rem;
  animation: slideIn 0.5s var(--ease-smooth) forwards;
}

.wizard-page.active {
  display: flex;
}

@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  transition: all 0.3s var(--ease-smooth);
  border-left: 4px solid transparent;
}

.question-container.unanswered {
  border-left-color: var(--likert-neg-2);
  background: rgba(192, 57, 43, 0.05);
  animation: pulseHighlight 1s infinite alternate;
}

@keyframes pulseHighlight {
  0% { box-shadow: 0 0 4px rgba(192, 57, 43, 0.1); }
  100% { box-shadow: 0 0 16px rgba(192, 57, 43, 0.2); }
}

.question-header {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.question-number {
  font-family: 'Prompt', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ci-orange);
  background: var(--bg-input-unselected);
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.question-text {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-main);
}

/* ==========================================
   5-Point Likert Scale Styling
   ========================================== */
.likert-scale-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.likert-scale-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 600px;
  position: relative;
  padding: 1rem 0;
}

/* Horizontal Connector Line */
.likert-scale-row::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 30px;
  right: 30px;
  height: 2px;
  background: var(--bg-input-unselected);
  transform: translateY(-50%);
  z-index: 1;
}

.likert-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  cursor: pointer;
}

/* Hidden Native Radio */
.likert-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Interactive Circles base */
.likert-circle {
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--border-color, var(--bg-input-unselected));
  transition: all 0.3s var(--ease-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.likert-circle::after {
  content: '';
  width: 0%;
  height: 0%;
  border-radius: 50%;
  background: var(--active-color);
  transition: all 0.3s var(--ease-elastic);
}

/* Size configurations based on feel strength */
.circle-1 { /* ไม่ใช่เลย */
  width: 44px;
  height: 44px;
  --border-color: var(--likert-neg-2);
  --active-color: var(--likert-neg-2);
}
.circle-2 { /* ไม่ค่อยตรง */
  width: 34px;
  height: 34px;
  --border-color: var(--likert-neg-1);
  --active-color: var(--likert-neg-1);
}
.circle-3 { /* ปานกลาง */
  width: 24px;
  height: 24px;
  --border-color: var(--likert-neutral);
  --active-color: var(--likert-neutral);
}
.circle-4 { /* ค่อนข้างตรง */
  width: 34px;
  height: 34px;
  --border-color: var(--likert-pos-1);
  --active-color: var(--likert-pos-1);
}
.circle-5 { /* ใช่เลย */
  width: 44px;
  height: 44px;
  --border-color: var(--likert-pos-2);
  --active-color: var(--likert-pos-2);
}

/* Active Selected states */
.likert-option input[type="radio"]:checked + .likert-circle {
  transform: scale(1.18);
  border-color: var(--active-color);
  box-shadow: 0 0 15px var(--active-color);
}

.likert-option input[type="radio"]:checked + .likert-circle::after {
  width: 60%;
  height: 60%;
}

/* Hover effects */
.likert-option:hover .likert-circle {
  transform: scale(1.1);
  box-shadow: 0 0 10px var(--border-color);
}

/* Desktop Labels */
.likert-label-desktop {
  font-family: 'Prompt', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.6rem;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.3s var(--ease-smooth);
}

.likert-option:hover .likert-label-desktop,
.likert-option input[type="radio"]:checked ~ .likert-label-desktop {
  color: var(--active-color);
}

/* Mobile-only selected label */
.likert-label-mobile-selected {
  display: none;
  font-family: 'Prompt', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  margin-top: 0.5rem;
  min-height: 1.5rem;
  transition: all 0.3s var(--ease-smooth);
}

/* ==========================================
   Navigation Panel Controls
   ========================================== */
.nav-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  gap: 1.5rem;
}

.btn {
  font-family: 'Prompt', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.8rem 2rem;
  border-radius: 14px;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.3s var(--ease-smooth);
}

.btn-secondary {
  background: var(--bg-input-unselected);
  color: var(--text-main);
  border: 1px solid var(--border-card);
}

.btn-secondary:hover {
  background: var(--text-muted);
  color: #fff;
}

.btn-primary {
  background: var(--ci-orange);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--ci-orange-dark);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

#btn-next {
  margin-left: auto;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================
   Custom Modern Notification Modal
   ========================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s var(--ease-smooth);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 2.2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: translateY(30px);
  transition: transform 0.4s var(--ease-elastic);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(192, 57, 43, 0.1);
  color: var(--color-r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.2rem;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.8rem;
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Incomplete Question Badges */
.unanswered-badges-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  max-height: 150px;
  overflow-y: auto;
  padding: 0.5rem;
  width: 100%;
  margin-bottom: 2rem;
  background: var(--bg-input-unselected);
  border-radius: 12px;
}

.question-badge-link {
  font-family: 'Prompt', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--color-r);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}

.question-badge-link:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(192, 57, 43, 0.3);
}

/* ==========================================
   Results Dashboard Styles
   ========================================== */
#results-section {
  display: none;
}

#results-section.active {
  display: block;
}

.results-intro {
  text-align: center;
  margin-bottom: 2.5rem;
}

.results-intro-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.4rem;
}

/* RIASEC Grid & Ranks */
.riasec-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.riasec-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-input-unselected);
  border-radius: 18px;
  padding: 1.5rem;
  transition: all 0.3s var(--ease-smooth);
  border-left: 6px solid var(--riasec-color);
  position: relative;
}

.riasec-card:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-sm);
}

/* Top Rank Special Styling */
.riasec-card.top-match {
  background: linear-gradient(135deg, var(--riasec-color), rgba(0, 0, 0, 0.7));
  color: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-left: none;
}

.riasec-card.top-match .riasec-type-name,
.riasec-card.top-match .riasec-type-desc {
  color: #f1f2f6;
}

.riasec-card.top-match .riasec-score-num {
  color: #fff;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.rank-badge {
  font-family: 'Prompt', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.riasec-card:not(.top-match) .rank-badge {
  background: var(--riasec-color);
  color: #fff;
  border: none;
}

.riasec-type-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.riasec-code-letter {
  font-family: 'Prompt', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--riasec-color);
}

.riasec-card.top-match .riasec-code-letter {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.riasec-type-name {
  font-family: 'Prompt', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.riasec-type-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.riasec-score-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.riasec-progress-track {
  flex-grow: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 5px;
  overflow: hidden;
}

.riasec-card.top-match .riasec-progress-track {
  background: rgba(255, 255, 255, 0.2);
}

.riasec-progress-bar {
  height: 100%;
  background: var(--riasec-color);
  border-radius: 5px;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.riasec-card.top-match .riasec-progress-bar {
  background: #fff;
}

.riasec-score-num {
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
  min-width: 48px;
  text-align: right;
}

/* Visualization Charts Layout */
.charts-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3.5rem;
  justify-items: center;
}

.chart-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-input-unselected);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.chart-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  text-align: center;
}

.radar-canvas-wrapper {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  position: relative;
}

/* Result Buttons Actions */
.results-actions {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 1rem;
}

/* ==========================================
   Responsive Adaptation (Desktop, Tablet, Mobile)
   ========================================== */
@media (max-width: 768px) {
  main {
    padding: 1.5rem 2rem 3.5rem 2rem; /* Add more margin spacing around the card on tablet */
  }
  .glass-card {
    padding: 1.8rem;
    border-radius: 20px;
  }
  
  .title-main {
    font-size: 1.5rem;
  }
  
  .title-sub {
    font-size: 1.05rem;
  }
  
  .likert-scale-row::before {
    left: 20px;
    right: 20px;
  }
  
  /* Circle resizing on medium screens */
  .circle-1 { width: 38px; height: 38px; }
  .circle-2 { width: 30px; height: 30px; }
  .circle-3 { width: 20px; height: 20px; }
  .circle-4 { width: 30px; height: 30px; }
  .circle-5 { width: 38px; height: 38px; }

  /* RIASEC Result card adjustments on tablet & mobile to prevent ugly text wrapping */
  .card-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1rem;
    width: 100%;
  }

  .riasec-type-title {
    width: 100%;
    display: flex;
    flex-wrap: nowrap; /* Ensure Code Letter and Name stay on the same line! */
    align-items: center;
    gap: 0.6rem;
  }

  .rank-badge {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  body {
    background: var(--bg-app);
  }
  
  header {
    padding: 1.5rem 1rem 0.5rem 1rem;
  }
  
  .logo {
    max-height: 60px;
  }
  
  .theme-toggle-btn {
    top: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
  
  main {
    padding: 1rem 1.4rem 2.5rem 1.4rem; /* Increased margin spacing around the card on mobile */
  }
  
  .glass-card {
    padding: 1.2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
  }
  
  .question-container {
    padding: 1rem 0.75rem;
    gap: 0.8rem;
  }
  
  .question-text {
    font-size: 0.98rem;
  }
  
  .question-number {
    min-width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .likert-scale-row {
    padding: 0.8rem 0;
  }

  /* Shrink circles further to avoid collision */
  .circle-1 { width: 32px; height: 32px; border-width: 2px; }
  .circle-2 { width: 26px; height: 26px; border-width: 2px; }
  .circle-3 { width: 18px; height: 18px; border-width: 2px; }
  .circle-4 { width: 26px; height: 26px; border-width: 2px; }
  .circle-5 { width: 32px; height: 32px; border-width: 2px; }

  .likert-scale-row::before {
    left: 15px;
    right: 15px;
  }

  /* Hide verbose labels under circles, replace with Mobile responsive label */
  .likert-label-desktop {
    display: none;
  }
  
  .likert-label-mobile-selected {
    display: block;
  }
  
  .nav-panel {
    margin-top: 2rem;
    flex-direction: column-reverse;
    gap: 0.8rem;
  }
  
  .btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
  }
  
  .riasec-card {
    padding: 1.2rem;
  }
  
  .riasec-code-letter {
    font-size: 1.4rem; /* Stands out prominently */
  }
  
  .riasec-type-name {
    font-size: 0.9rem; /* Perfectly sized to stay on the same line */
  }
  
  .results-actions {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .chart-card {
    padding: 1rem;
  }
}

/* ==========================================
   A4 Print & Save Optimization
   ========================================== */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
  }
  
  .theme-toggle-btn,
  .progress-container,
  .nav-panel,
  .results-actions,
  #quiz-section {
    display: none !important;
  }
  
  main {
    padding: 0 !important;
    max-width: 100% !important;
  }
  
  .glass-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  
  .logo {
    max-height: 70px !important;
  }
  
  #results-section {
    display: block !important;
    page-break-before: avoid;
  }

  .riasec-card {
    background: #f8f9fa !important;
    border: 1px solid #ddd !important;
    border-left: 6px solid var(--riasec-color) !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    color: #000 !important;
  }
  
  .riasec-card.top-match {
    background: #f1f2f6 !important;
    border: 2px solid var(--riasec-color) !important;
    color: #000 !important;
    box-shadow: none !important;
  }
  
  .riasec-card.top-match .riasec-code-letter {
    color: var(--riasec-color) !important;
    text-shadow: none !important;
  }
  
  .riasec-card.top-match .riasec-type-name,
  .riasec-card.top-match .riasec-type-desc {
    color: #000 !important;
  }
  
  .riasec-progress-track {
    background: #e9ecef !important;
    border: 1px solid #ccc !important;
  }
  
  .riasec-progress-bar {
    background-color: var(--riasec-color) !important;
  }
  
  .riasec-card.top-match .riasec-progress-bar {
    background-color: var(--riasec-color) !important;
  }
  
  .charts-container {
    grid-template-columns: 1fr !important;
    page-break-before: always;
  }
  
  .chart-card {
    border: 1px solid #ddd !important;
    background: #fff !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
}

/* ==========================================
   0. Welcome Screen Styling & Adjustments
   ========================================== */
.welcome-container {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2rem;
  padding: 1.5rem 0;
  animation: fadeIn 0.6s var(--ease-smooth) forwards;
}

.welcome-container.active {
  display: flex;
}

.welcome-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.welcome-icon-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(249, 163, 80, 0.12);
  border: 2px solid rgba(249, 163, 80, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: var(--ci-orange);
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease-smooth);
}

.welcome-icon-avatar:hover {
  transform: scale(1.06);
  box-shadow: var(--shadow-glow);
  border-color: var(--ci-orange);
}

.welcome-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.welcome-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 500px;
}

/* Distinct Submit Button styling */
.btn-submit {
  background: linear-gradient(135deg, #117a65, #16a085) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(17, 122, 101, 0.3) !important;
  transition: all 0.3s var(--ease-smooth);
}

.btn-submit:hover {
  background: linear-gradient(135deg, #16a085, #1abc9c) !important;
  box-shadow: 0 6px 20px rgba(22, 160, 133, 0.45) !important;
  transform: translateY(-2px) !important;
}

/* Remove Visualizations background card layout and enforce perfect centering & scaling */
.charts-container {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 2rem;
}

.chart-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.radar-canvas-wrapper {
  width: 100%;
  max-width: 400px; /* Expands to match size=400 in JS */
  aspect-ratio: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.radar-canvas-wrapper canvas {
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  display: block;
  margin: 0 auto;
}


