:root {
  --bg-dark: #000000;
  --bg-card: rgba(12, 12, 14, 0.85);
  --accent-primary: #8b5cf6;
  --accent-secondary: #06b6d4;
  --accent-glow: rgba(139, 92, 246, 0.4);
  --text-main: #ffffff;
  --text-dim: #94a3b8;
  --text-placeholder: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.1);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-xl: 40px;
  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-sm: 12px;
  --spacing-container: 80px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* --- Premium Background --- */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
    radial-gradient(at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 85%);
  z-index: -1;
  animation: bg-pulse 12s infinite alternate ease-in-out;
}

@keyframes bg-pulse {
  0% {
    opacity: 0.7;
  }

  100% {
    opacity: 1;
  }
}

.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.bg-decoration::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to bottom, transparent, rgba(139, 92, 246, 0.04), transparent);
  animation: scan-line 10s linear infinite;
}

@keyframes scan-line {
  0% {
    top: -100%;
  }

  100% {
    top: 200%;
  }
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: float 25s infinite alternate ease-in-out;
}

.shape-1 {
  width: 600px;
  height: 600px;
  background: var(--accent-primary);
  top: -200px;
  left: -150px;
}

.shape-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-secondary);
  bottom: -100px;
  right: -100px;
  animation-delay: -5s;
}

.shape-3 {
  width: 350px;
  height: 350px;
  background: #ec4899;
  top: 35%;
  left: 65%;
  animation-delay: -10s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }

  100% {
    transform: translate(120px, 60px) rotate(25deg);
  }
}

/* --- Core Container --- */
#app {
  width: 100%;
  max-width: 1200px;
  padding: var(--spacing-container) 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Consolidated into Glass Elements below */

/* --- Typography --- */
h1 {
  font-size: clamp(2.5rem, 8vw, 4.2rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 24px;
  background: linear-gradient(180deg, #ffffff 10%, rgba(255, 255, 255, 0.5) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.05em;
  text-align: center;
}

.subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 750px;
  margin-bottom: 56px;
  text-align: left;
  /* Shift default to left for onboarding/quiz */
}

.text-center {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* --- Landing Features --- */
.landing-features {
  margin-top: 64px;
  display: flex;
  justify-content: center;
  gap: 48px;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-item i {
  color: var(--accent-secondary);
  width: 18px;
  height: 18px;
}

/* --- Glass Elements --- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 64px;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
  text-align: left;

  width: 100%;
  /* Default to fill container */
  display: flex;
  flex-direction: column;
}

/* Stable card size for Onboarding & Quiz ONLY (Not for Result Page) */
#view-container>.glass-card,
#view-container>.fade-in>.glass-card {
  max-width: 800px;
  min-height: 520px;
  margin-left: auto;
  margin-right: auto;
}

.glass-card h2 {
  text-align: left !important;
  width: 100%;
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  color: var(--accent-secondary);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 24px;
}

/* --- Result Page --- */
.result-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.result-actions-fixed {
  margin-top: 40px;
  width: 100%;
  padding: 0 40px 40px;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
}

.result-actions-fixed .action-buttons-group {
  width: 100%;
  max-width: 600px;
  /* Reduced max-width for 2 buttons */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.result-sidebar {
  flex: 0 0 420px;
  width: 420px;
  display: flex;
  flex-direction: column;
}

.result-card {
  padding: 48px 40px;
  text-align: center;
  background: #08080a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 60px 120px -30px rgba(139, 92, 246, 0.2);
  margin-bottom: 24px;
  width: 100% !important;
  /* Force adapt to sidebar width */
  min-height: auto !important;
  /* Reset stable height for result */
}

.result-main-content {
  flex: 1;
}

.analysis-card {
  padding: 56px;
  background: rgba(15, 15, 18, 0.6);
  width: 100% !important;
  min-height: auto !important;
}

.analysis-headline {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 40px;
  letter-spacing: -0.02em;
  text-align: left;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-secondary);
  margin-bottom: 20px;
}

.analysis-text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #e2e8f0;
  text-align: left;
}

.learning-path-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.step-item {
  display: flex;
  gap: 24px;
}

.step-num {
  flex: 0 0 44px;
  height: 44px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--accent-primary);
  font-size: 0.9rem;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
  text-align: left;
}

.step-desc {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.6;
  text-align: left;
}

.pr-number {
  font-size: 6rem;
  font-weight: 950;
  line-height: 1;
  color: #fff;
  background: linear-gradient(180deg, #fff 10%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 24px 0;
  position: relative;
  z-index: 1;
}

/* Fix for broken text-fill-color in screenshots */
.is-exporting .pr-number {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: #fff;
  color: #fff;
  text-shadow: 0 0 20px var(--accent-glow);
}

.radar-wrapper {
  margin: 20px 0;
  display: flex;
  justify-content: center;
}

/* --- Buttons --- */
.btn {
  padding: 18px 32px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: none;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
}

.btn-primary:hover {
  transform: translateY(-4px) scale(1.03);
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 20px 40px -10px var(--accent-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px dashed rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
}

.btn-ghost:hover {
  color: #fff;
}

.action-buttons-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.action-buttons-group .btn {
  white-space: nowrap !important;
  flex: 1;
  /* Ensure buttons grow evenly but stay on one line */
}

/* --- Forms & Quiz --- */
.form-group {
  margin-bottom: 28px;
  width: 100%;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-primary);
  text-transform: uppercase;
  margin-bottom: 12px;
}

input,
select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 18px 24px;
  color: #fff;
  font-size: 1rem;
}

input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.option-item {
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 12px;
  padding: 22px 32px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  transition: 0.3s;
}

.option-item:hover {
  transform: translateX(10px);
  border-color: var(--accent-primary);
}

.option-item.active {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--accent-primary);
}

.option-marker {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  /* Maintain perfect circle on mobile */
  border: 2px solid var(--glass-border);
  border-radius: 50%;
  transition: 0.3s;
}

.option-item.active .option-marker {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

#question-text {
  margin-bottom: 48px !important;
  text-align: left;
  line-height: 1.4;
}

.progress-container {
  margin-bottom: 40px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.6s ease;
}

.nav-buttons {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  #app {
    padding: 40px 24px;
  }

  .glass-card {
    padding: 48px 24px;
  }
}

@media (max-width: 1000px) {
  .result-layout {
    flex-direction: column;
    align-items: center;
  }

  .result-sidebar {
    flex: 0 0 auto;
    width: 100%;
    max-width: 600px;
    margin-bottom: 40px;
  }

  .analysis-card {
    padding: 40px 32px;
  }
}

@media (max-width: 600px) {
  #app {
    padding: 16px 20px;
    /* Force lateral white space on mobile */
    width: 100%;
    align-items: stretch;
    /* Cards fill available width with margins */
  }

  .glass-card {
    padding: 24px 20px;
    /* Tighter padding for mobile dashboard feel */
    border-radius: var(--radius-md);
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 20px 0;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    background: rgba(15, 15, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Fix for the "segmented" look in user screenshot */
  .result-sidebar,
  .result-main-content {
    padding: 0;
    width: 100% !important;
  }

  .result-layout {
    gap: 16px;
    flex-direction: column;
    width: 100%;
    padding: 0;
  }

  .result-card {
    padding: 24px 20px 40px !important;
    /* Reduced top padding from 40px */
    margin-bottom: 0px;
    background: linear-gradient(180deg, rgba(20, 20, 25, 1) 0%, rgba(10, 10, 12, 1) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
  }

  .badge {
    margin-bottom: 16px;
    padding: 4px 12px;
    font-size: 0.65rem;
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
  }

  .pr-label {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
  }

  .pr-number {
    font-size: 5rem;
    margin: 8px 0;
    /* Reduced from 12px */
    letter-spacing: -0.02em;
  }

  .radar-wrapper {
    margin: 0px 0;
    /* Reduced from 20px */
  }

  .card-footer-tip {
    font-size: 0.75rem;
    margin-top: 4px;
    /* Reduced from 12px */
  }

  .analysis-card {
    padding: 40px 24px !important;
  }

  .analysis-headline {
    font-size: 1.6rem;
    line-height: 1.3;
    margin-bottom: 32px;
    text-align: center;
    /* Center headline on mobile result */
  }

  .analysis-text {
    font-size: 1rem;
    line-height: 1.8;
  }

  .section-label {
    font-size: 0.7rem;
    justify-content: center;
    /* Center labels on mobile result */
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
  }

  .step-item {
    gap: 20px;
    align-items: flex-start;
  }

  .step-num {
    flex: 0 0 36px;
    height: 36px;
    font-size: 0.8rem;
  }

  .step-title {
    font-size: 1.05rem;
  }

  .step-desc {
    font-size: 0.9rem;
  }

  .result-actions-fixed {
    padding: 24px 20px 48px;
    margin-top: 0;
  }

  .result-actions-fixed .action-buttons-group {
    grid-template-columns: 1fr;
    /* Stack buttons vertically on mobile */
    gap: 16px;
  }

  .option-item {
    padding: 16px 20px;
    font-size: 0.95rem;
  }

  .promo-banner {
    padding: 24px;
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .promo-banner p {
    text-align: center;
  }
}

.promo-banner {
  margin-top: 56px;
  padding: 32px 40px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.15));
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
}

.promo-banner p {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  flex: 1;
}

.btn-sm {
  padding: 14px 28px;
  font-size: 0.95rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Export Mode Overrides (for html2canvas stability) --- */
.is-exporting #screenshot-area {
  background-color: #000;
  padding: 60px;
  border-radius: 40px;
}

.is-exporting .glass-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: #0d0d0f !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
}

.is-exporting .promo-banner {
  background: rgba(139, 92, 246, 0.1) !important;
}

.is-exporting .radar-wrapper canvas {
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.3));
}