/* ===== CSS Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #667eea;
  --primary-dark: #5a6fd6;
  --secondary: #764ba2;
  --accent: #ffd700;
  --success: #4ecdc4;
  --danger: #ff6b9d;
  --bg: #f0f2f8;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-light: #7f8c9b;
  --border: #e8ecf1;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== App Container ===== */
.app-container {
  max-width: 800px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ===== Page System ===== */
.page {
  display: none;
  min-height: 100vh;
  animation: fadeIn 0.4s ease-out;
}

.page.active {
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Welcome Page ===== */
#page-welcome {
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.welcome-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.floating-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  animation: floatShape 8s ease-in-out infinite;
}

.shape-1 {
  width: 120px;
  height: 120px;
  background: var(--primary);
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 80px;
  height: 80px;
  background: var(--secondary);
  top: 60%;
  right: 15%;
  animation-delay: 1.5s;
}

.shape-3 {
  width: 100px;
  height: 100px;
  background: var(--danger);
  bottom: 20%;
  left: 20%;
  animation-delay: 3s;
}

.shape-4 {
  width: 60px;
  height: 60px;
  background: var(--success);
  top: 30%;
  right: 25%;
  animation-delay: 4.5s;
}

.shape-5 {
  width: 90px;
  height: 90px;
  background: var(--accent);
  top: 15%;
  right: 10%;
  animation-delay: 2s;
}

.shape-6 {
  width: 70px;
  height: 70px;
  background: var(--primary);
  bottom: 30%;
  left: 60%;
  animation-delay: 5s;
}

@keyframes floatShape {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  25% { transform: translateY(-30px) rotate(90deg) scale(1.1); }
  50% { transform: translateY(10px) rotate(180deg) scale(0.95); }
  75% { transform: translateY(-20px) rotate(270deg) scale(1.05); }
}

.welcome-content {
  position: relative;
  z-index: 1;
  padding: 40px 24px;
}

.logo-area {
  margin-bottom: 24px;
}

.brain-icon {
  filter: drop-shadow(0 8px 24px rgba(102, 126, 234, 0.3));
  animation: brainPulse 3s ease-in-out infinite;
}

@keyframes brainPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.welcome-title {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.welcome-subtitle {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.welcome-desc {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 32px;
}

.test-info {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  transition: transform var(--transition);
}

.info-item:hover {
  transform: translateY(-2px);
}

.info-icon {
  font-size: 1.3rem;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 48px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-start:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.5);
}

.btn-start:active {
  transform: translateY(-1px);
}

.btn-start::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: rotate(45deg);
  animation: btnShine 3s infinite;
}

@keyframes btnShine {
  0% { left: -50%; }
  100% { left: 150%; }
}

.btn-arrow {
  font-size: 1.3rem;
  transition: transform var(--transition);
}

.btn-start:hover .btn-arrow {
  transform: translateX(4px);
}

.welcome-notice {
  margin-top: 24px;
  padding: 12px 20px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ===== Test Page ===== */
#page-test {
  background: var(--card-bg);
}

.test-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card-bg);
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-back-home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  padding: 0;
}

.btn-back-home:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(102, 126, 234, 0.06);
  transform: scale(1.05);
}

.btn-back-home:active {
  transform: scale(0.95);
}

.test-header-right {
  flex: 1;
  min-width: 0;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.5s ease-out;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 20px;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 3px;
  animation: progressGlow 1.5s ease-in-out infinite;
}

@keyframes progressGlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.test-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 4px;
}

.question-counter {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 600;
}

.section-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

.test-timer {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Question Card */
.test-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 20px;
}

.question-card {
  width: 100%;
  max-width: 640px;
  animation: cardEnter 0.4s ease-out;
}

.question-card.card-enter {
  animation: cardEnter 0.4s ease-out;
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.question-card.shake {
  animation: cardShake 0.4s ease-out;
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.question-number {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.question-text {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 28px;
  line-height: 1.5;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  background: var(--card-bg);
}

.option-card:hover {
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

.option-card.selected {
  border-color: var(--primary);
  background: rgba(102, 126, 234, 0.05);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
  transform: translateX(0);
}

.option-card.selected .option-marker {
  background: var(--primary);
  color: #fff;
}

.option-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-light);
  flex-shrink: 0;
  transition: all var(--transition);
}

.option-card:hover .option-marker {
  background: var(--primary);
  color: #fff;
}

.option-desc {
  flex: 1;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.5;
}

.option-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--transition);
}

.option-card.selected .option-check {
  opacity: 1;
  transform: scale(1);
}

/* Option A/B specific colors */
.option-a:hover { border-color: #4ecdc4; }
.option-a:hover .option-marker { background: #4ecdc4; color: #fff; }
.option-a.selected { border-color: #4ecdc4; background: rgba(78, 205, 196, 0.06); }
.option-a.selected .option-marker { background: #4ecdc4; color: #fff; }
.option-a.selected .option-check { background: #4ecdc4; }
.option-a .option-marker { background: rgba(78, 205, 196, 0.1); color: #4ecdc4; }

.option-b:hover { border-color: #ff6b9d; }
.option-b:hover .option-marker { background: #ff6b9d; color: #fff; }
.option-b.selected { border-color: #ff6b9d; background: rgba(255, 107, 157, 0.06); }
.option-b.selected .option-marker { background: #ff6b9d; color: #fff; }
.option-b.selected .option-check { background: #ff6b9d; }
.option-b .option-marker { background: rgba(255, 107, 157, 0.1); color: #ff6b9d; }

/* Test Footer */
.test-footer {
  position: sticky;
  bottom: 0;
  background: var(--card-bg);
  padding: 12px 20px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn-nav {
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: 25px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-nav:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-submit {
  padding: 12px 32px;
  border: none;
  border-radius: 25px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.nav-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow: hidden;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.dot.answered {
  background: var(--primary);
  opacity: 0.5;
}

.dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--primary);
}

/* ===== Result Page ===== */
#page-result {
  background: var(--bg);
}

.result-container {
  padding-bottom: 40px;
}

/* Result Hero */
.result-hero {
  position: relative;
  padding: 48px 24px 40px;
  text-align: center;
  color: #fff;
  overflow: hidden;
}

.result-confetti {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
  opacity: 0.8;
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}

.cartoon-character {
  margin-bottom: 16px;
  animation: characterBounce 2s ease-in-out infinite;
}

@keyframes characterBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.result-type {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 6px;
  margin-bottom: 4px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.result-type-name {
  font-size: 1.2rem;
  font-weight: 600;
  opacity: 0.95;
  margin-bottom: 10px;
}

.result-category {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1px;
  border: 1.5px solid;
  margin-bottom: 12px;
  backdrop-filter: blur(4px);
}

.result-brief {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 8px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.result-elapsed {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 16px;
}

/* Result Tags Bar */
.result-tags-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 0;
  margin-bottom: -4px;
}

.result-tag-chip {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  animation: tagPopIn 0.4s ease-out backwards;
}

.result-tag-chip:nth-child(1) { animation-delay: 0.05s; }
.result-tag-chip:nth-child(2) { animation-delay: 0.1s; }
.result-tag-chip:nth-child(3) { animation-delay: 0.15s; }
.result-tag-chip:nth-child(4) { animation-delay: 0.2s; }
.result-tag-chip:nth-child(5) { animation-delay: 0.25s; }
.result-tag-chip:nth-child(6) { animation-delay: 0.3s; }

@keyframes tagPopIn {
  from { opacity: 0; transform: scale(0.8) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.result-emojis {
  display: flex;
  gap: 12px;
  justify-content: center;
  font-size: 1.5rem;
}

.result-emojis span {
  animation: emojiPop 0.5s ease-out backwards;
}

.result-emojis span:nth-child(1) { animation-delay: 0.2s; }
.result-emojis span:nth-child(2) { animation-delay: 0.4s; }
.result-emojis span:nth-child(3) { animation-delay: 0.6s; }
.result-emojis span:nth-child(4) { animation-delay: 0.8s; }

@keyframes emojiPop {
  from { opacity: 0; transform: scale(0) rotate(-20deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Result Cards */
.result-card {
  margin: 16px 20px;
  padding: 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: cardSlideUp 0.5s ease-out backwards;
}

.result-card:nth-child(2) { animation-delay: 0.1s; }
.result-card:nth-child(3) { animation-delay: 0.2s; }
.result-card:nth-child(4) { animation-delay: 0.3s; }

@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

/* Dimension Bars */
.dimension-bars {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dim-bar-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dim-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.dim-label {
  color: var(--text-light);
}

.dim-label.dominant {
  color: var(--primary);
  font-weight: 800;
}

.dim-bar-track {
  display: flex;
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

.dim-bar-fill {
  height: 100%;
  transition: width 1s ease-out;
  min-width: 20%;
}

.dim-bar-left {
  border-radius: 12px 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 4px;
}

.dim-bar-right {
  border-radius: 0 12px 12px 0;
  display: flex;
  align-items: center;
  padding-left: 4px;
}

.dim-values {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-light);
}

/* Description List */
.desc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.desc-list li {
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.6;
  border-left: 3px solid var(--primary);
  transition: transform var(--transition);
}

.desc-list li:hover {
  transform: translateX(4px);
}

/* Detailed Description */
.detail-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
  text-align: justify;
}

/* Career Tags */
.career-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.career-tag {
  padding: 8px 16px;
  background: rgba(102, 126, 234, 0.08);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: default;
}

.career-tag:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

/* Strengths & Weaknesses Grid */
.result-card-columns .result-section-title {
  margin-bottom: 12px;
}

.strength-weakness-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sw-column {
  padding: 16px;
  border-radius: var(--radius-sm);
}

.sw-strengths {
  background: rgba(78, 205, 196, 0.06);
  border: 1px solid rgba(78, 205, 196, 0.2);
}

.sw-weaknesses {
  background: rgba(255, 107, 157, 0.06);
  border: 1px solid rgba(255, 107, 157, 0.2);
}

.sw-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 6px;
}

.sw-strength-title {
  color: #2b9e8a;
  border-bottom: 2px solid rgba(78, 205, 196, 0.3);
}

.sw-weakness-title {
  color: #d4537a;
  border-bottom: 2px solid rgba(255, 107, 157, 0.3);
}

.sw-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-list li {
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 6px 10px;
  border-radius: 8px;
  position: relative;
  padding-left: 18px;
}

.sw-strengths .sw-list li {
  background: rgba(78, 205, 196, 0.05);
}

.sw-strengths .sw-list li::before {
  content: '✓';
  position: absolute;
  left: 6px;
  color: #2b9e8a;
  font-weight: bold;
  font-size: 0.75rem;
}

.sw-weaknesses .sw-list li {
  background: rgba(255, 107, 157, 0.05);
}

.sw-weaknesses .sw-list li::before {
  content: '•';
  position: absolute;
  left: 6px;
  color: #d4537a;
  font-weight: bold;
}

/* Best Match Badge */
.best-match-badge {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 215, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.best-match-label {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
}

.best-match-types {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
}

/* Celebrity Grid */
.celebrity-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.celebrity-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.celebrity-card:hover {
  transform: translateX(6px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.celebrity-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  flex-shrink: 0;
}

.celebrity-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.celebrity-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.celebrity-title {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Result Actions */
.result-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 24px 20px 40px;
  flex-wrap: wrap;
}

.btn-retake,
.btn-share,
.btn-home {
  padding: 14px 32px;
  border-radius: 25px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn-retake {
  background: var(--card-bg);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-retake:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-share {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.btn-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.btn-home {
  background: var(--card-bg);
  color: var(--text-light);
  border: 2px solid var(--border);
}

.btn-home:hover {
  border-color: #ffa726;
  color: #ffa726;
  transform: translateY(-2px);
}

/* ===== Responsive Design ===== */

/* Tablet */
@media (max-width: 768px) {
  .welcome-title {
    font-size: 1.8rem;
  }

  .question-text {
    font-size: 1.15rem;
  }

  .result-type {
    font-size: 2.4rem;
    letter-spacing: 4px;
  }

  .test-body {
    padding: 24px 16px;
  }

  .option-card {
    padding: 14px 16px;
  }

  .option-desc {
    font-size: 0.95rem;
  }
}

/* Phone */
@media (max-width: 480px) {
  .welcome-content {
    padding: 32px 16px;
  }

  .welcome-title {
    font-size: 1.5rem;
  }

  .welcome-desc {
    font-size: 0.9rem;
  }

  .test-info {
    gap: 12px;
  }

  .info-item {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .btn-start {
    padding: 14px 36px;
    font-size: 1.05rem;
  }

  .question-text {
    font-size: 1.08rem;
    margin-bottom: 20px;
  }

  .option-card {
    padding: 12px 14px;
    gap: 12px;
  }

  .option-marker {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }

  .option-desc {
    font-size: 0.9rem;
  }

  .test-header {
    padding: 10px 14px 6px;
  }

  .test-body {
    padding: 20px 14px;
  }

  .test-footer {
    padding: 10px 14px 16px;
    gap: 8px;
  }

  .btn-nav {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .btn-submit {
    padding: 10px 24px;
    font-size: 0.9rem;
  }

  .strength-weakness-grid {
    grid-template-columns: 1fr;
  }
}

.result-type {
  font-size: 2rem;
  letter-spacing: 3px;
}

.result-card {
  margin: 12px 12px;
  padding: 18px 16px;
}

.result-hero {
  padding: 36px 16px 32px;
}

.cartoon-character svg {
  width: 100px;
  height: 83px;
}

.result-actions {
  padding: 16px 12px 32px;
  gap: 12px;
}

.btn-retake,
.btn-share,
.btn-home {
  padding: 12px 24px;
  font-size: 0.85rem;
}

/* Very small phones */
@media (max-width: 360px) {
  .welcome-title {
    font-size: 1.3rem;
  }

  .question-text {
    font-size: 1rem;
  }

  .option-card {
    padding: 10px 12px;
  }

  .btn-nav {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ===== Locked Result State ===== */
.locked-hero {
  background: linear-gradient(135deg, #9e9e9e, #757575) !important;
}

.result-card.locked-card .result-section-title {
  color: #555;
}

.result-card.locked-card .sw-title {
  color: #999;
}

.locked-dim-placeholder {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 0;
}

.locked-dim-bar {
  height: 24px;
  border-radius: 12px;
  background: repeating-linear-gradient(
    90deg,
    #e0e0e0,
    #e0e0e0 10px,
    #d0d0d0 10px,
    #d0d0d0 20px
  );
  opacity: 0.6;
}

.locked-text-line {
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e0e0e0 25%, #d0d0d0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  animation: lockedShimmer 2s ease-in-out infinite;
  margin-bottom: 10px;
  opacity: 0.6;
}

.locked-text-line.short { width: 60%; }
.locked-text-line.medium { width: 80%; }
.locked-text-line.long { width: 95%; }

@keyframes lockedShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Locked Hero Skeleton */
.locked-skeleton-avatar {
  width: 100px;
  height: 83px;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255,255,255,0.15) 25%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.15) 75%);
  background-size: 200% 100%;
  animation: lockedShimmer 2s ease-in-out infinite;
  margin: 0 auto 16px;
}

.locked-type-placeholder {
  width: 140px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,0.15) 25%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.15) 75%);
  background-size: 200% 100%;
  animation: lockedShimmer 2s ease-in-out infinite;
  margin: 0 auto 8px;
}

.locked-hero-line {
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,0.12) 25%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0.12) 75%);
  background-size: 200% 100%;
  animation: lockedShimmer 2s ease-in-out infinite;
}

.locked-emoji {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255,255,255,0.12) 25%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0.12) 75%);
  background-size: 200% 100%;
  animation: lockedShimmer 2s ease-in-out infinite;
  margin: 0 6px;
}

.locked-tag-chip {
  display: inline-block;
  width: 70px;
  height: 32px;
  border-radius: 20px;
  background: linear-gradient(90deg, #e0e0e0 25%, #d0d0d0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  animation: lockedShimmer 2s ease-in-out infinite;
}

/* Locked card dim label colors */
.result-card.locked-card .dim-label {
  color: #999;
}

.result-card.locked-card .dim-values span {
  color: #ccc;
}

/* Locked SW columns in locked card */
.result-card.locked-card .sw-strengths {
  background: rgba(158,158,158,0.06);
  border-color: rgba(158,158,158,0.2);
}

.result-card.locked-card .sw-weaknesses {
  background: rgba(158,158,158,0.06);
  border-color: rgba(158,158,158,0.2);
}

.result-card.locked-card .sw-strength-title,
.result-card.locked-card .sw-weakness-title {
  color: #999;
  border-color: rgba(158,158,158,0.3);
}

/* ===== Payment Section ===== */
.payment-overlay {
  text-align: center;
  padding: 40px 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  margin: 16px 20px;
  box-shadow: var(--shadow);
  animation: cardSlideUp 0.5s ease-out backwards;
  animation-delay: 0.2s;
}

.payment-overlay .lock-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.payment-overlay .payment-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.payment-overlay .payment-price {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 4px;
}

.payment-overlay .payment-price .currency {
  font-size: 1rem;
  font-weight: 600;
}

.payment-overlay .payment-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.btn-pay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 48px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff9800, #f44336);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(244, 67, 54, 0.35);
  transition: all var(--transition);
}

.btn-pay:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(244, 67, 54, 0.45);
}

.btn-pay:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.payment-qrcode {
  margin: 20px auto;
  max-width: 260px;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.payment-qrcode img {
  width: 100%;
  height: auto;
  display: block;
}

.payment-qrcode .qrcode-tip {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-light);
}

.payment-status-checking {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 12px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.payment-success {
  font-size: 0.9rem;
  color: #4caf50;
  font-weight: 600;
  margin-top: 12px;
}

/* ===== History Section (Welcome Page) ===== */
.history-section {
  margin: 32px 20px 0;
  text-align: center;
}

.history-section .history-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.history-empty {
  font-size: 0.85rem;
  color: var(--text-light);
  padding: 20px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 500px;
  margin: 0 auto;
  text-align: left;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 4px solid var(--primary);
}

.history-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.history-item.locked-item {
  border-left-color: #9e9e9e;
}

.history-type-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-type {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.history-type-name {
  font-size: 0.78rem;
  color: var(--text-light);
}

.history-status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
}

.history-status.unlocked {
  background: rgba(78, 205, 196, 0.12);
  color: #2b9e8a;
}

.history-status.locked {
  background: rgba(158, 158, 158, 0.12);
  color: #757575;
}

.history-time {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 2px;
}
