/* MBTI City Test Styles */
/* Primary Color: #1A535C (Deep Teal / City Night) */

:root {
  --primary: #2B7A85;
  --primary-dark: #1A535C;
  --primary-light: #4ECDC4;
  --primary-glow: rgba(43, 122, 133, 0.3);
  --primary-glow-solid: #4ECDC4;
  --bg: #0a0a1a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f0f5f5;
    --bg-card: rgba(26, 83, 92, 0.05);
    --text: #1a1a2e;
    --text-muted: #556666;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --primary-glow: rgba(43, 122, 133, 0.15);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  z-index: 10001;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* App Loader */
.app-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.4s ease;
}
.app-loader.hidden { opacity: 0; pointer-events: none; }
.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* City lights particle effect */
.particle-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.city-light {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--primary-light);
  border-radius: 50%;
  animation: cityGlow 4s ease-in-out infinite;
  opacity: 0;
}
@keyframes cityGlow {
  0% { opacity: 0; transform: scale(0.5); }
  25% { opacity: 0.6; transform: scale(1.2); }
  50% { opacity: 0.3; transform: scale(1); }
  75% { opacity: 0.7; transform: scale(1.3); }
  100% { opacity: 0; transform: scale(0.5); }
}

/* Container */
.container {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

/* Screen */
.screen { display: none; }
.screen.active { display: block; }

/* Hero */
.hero {
  text-align: center;
  padding: 40px 0 30px;
}
.hero-icon {
  margin-bottom: 16px;
}
.city-hero-svg {
  width: 160px;
  height: 110px;
  filter: drop-shadow(0 0 15px var(--primary-glow));
  animation: skylineFloat 4s ease-in-out infinite;
}
.city-hero-svg rect[opacity] {
  animation: windowBlink 3s ease-in-out infinite alternate;
}
.city-hero-svg rect:nth-child(2n) { animation-delay: 0.5s; }
.city-hero-svg rect:nth-child(3n) { animation-delay: 1s; }
.city-hero-svg rect:nth-child(4n) { animation-delay: 1.5s; }
.city-hero-svg rect:nth-child(5n) { animation-delay: 2s; }
@keyframes skylineFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes windowBlink {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}
.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 400px;
  margin: 0 auto;
}

/* Card */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* Progress - skyline that builds */
.progress-container {
  text-align: center;
  margin-bottom: 24px;
}
.skyline-progress {
  position: relative;
  width: 200px;
  height: 80px;
  margin: 0 auto 12px;
}
.skyline-progress svg {
  width: 100%;
  height: 100%;
}
.building {
  transition: opacity 0.6s ease, filter 0.6s ease;
}
.building.lit {
  opacity: 0.8 !important;
  filter: drop-shadow(0 0 6px var(--primary-glow));
}
.progress-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Question Card */
.question-card {
  animation: fadeInUp 0.4s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.question-number {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.question-text {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Answer options */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) / 2);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  line-height: 1.4;
}
.option-btn:hover {
  border-color: var(--primary);
  background: rgba(43, 122, 133, 0.1);
  transform: translateX(4px);
}
.option-btn:active {
  transform: translateX(2px);
}
.option-btn .option-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}
.option-btn.selected {
  border-color: var(--primary);
  background: rgba(43, 122, 133, 0.15);
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Result screen */
.result-container {
  text-align: center;
  animation: fadeInUp 0.6s ease;
}
.result-city-skyline {
  margin-bottom: 16px;
}
.result-city-skyline svg {
  width: 180px;
  height: 100px;
  filter: drop-shadow(0 0 20px var(--primary-glow));
}
.result-mbti {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(43, 122, 133, 0.1);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 6px 16px;
  margin-bottom: 12px;
  letter-spacing: 2px;
}
.result-city-name {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.result-tagline {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 24px;
  font-style: italic;
}
.result-description {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 24px;
  text-align: left;
}
.result-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}
.trait-tag {
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(43, 122, 133, 0.1);
  border: 1px solid var(--border);
  color: var(--primary-light);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 14px 28px;
  border: none;
  border-radius: calc(var(--radius) / 2);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  gap: 8px;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  width: 100%;
  margin-top: 16px;
  font-size: 1.1rem;
  box-shadow: 0 4px 20px var(--primary-glow);
  animation: ctaPulse 2s ease-in-out 1s 3;
}
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 4px 20px var(--primary-glow); }
  50% { box-shadow: 0 0 0 12px transparent, 0 4px 30px var(--primary-glow); }
}
.btn-primary:hover { box-shadow: 0 6px 30px var(--primary-glow); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
  margin-top: 12px;
}

/* Share Section */
.share-section {
  text-align: center;
  margin-top: 24px;
}
.share-section h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.share-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) / 2);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
}
.share-btn:hover {
  border-color: var(--primary);
  background: rgba(43, 122, 133, 0.1);
}
.share-btn.kakao:hover { border-color: #FEE500; background: rgba(254, 229, 0, 0.1); }
.share-btn.twitter:hover { border-color: #1DA1F2; background: rgba(29, 161, 242, 0.1); }
.share-btn.facebook:hover { border-color: #1877F2; background: rgba(24, 119, 242, 0.1); }

/* Language selector */
.lang-selector {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 100;
}
.lang-selector select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-height: 44px;
}

/* Responsive */
@media (min-width: 640px) {
  .hero h1 { font-size: 2.5rem; }
  .result-city-name { font-size: 2.2rem; }
  .question-text { font-size: 1.3rem; }
}

@media (max-width: 640px) {
  .hero { padding: 16px 0 8px; }
  .hero-icon { margin-bottom: 8px; }
  .city-hero-svg { width: 100px; height: 60px; }
  .social-proof-badge {
    padding: 4px 12px;
    gap: 6px;
    margin-bottom: 8px;
  }
  .social-proof-count { font-size: 0.9rem; }
  .hero h1 { font-size: 1.5rem; margin-bottom: 6px; }
  .subtitle { font-size: 0.9rem; }
  .result-carousel { margin-top: 8px; }
  .sample-question-preview { display: none; }
  .city-light:nth-child(n+9) { display: none; }
}

@media (max-width: 360px) {
  .share-btn span { display: none; }
  .share-btn { padding: 10px; }
  .hero h1 { font-size: 1.6rem; }
}

/* Social proof & meta */
.social-proof {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.1);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.time-estimate {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.result-preview {
  margin-top: 16px;
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
}

/* Related Tests */
.related-tests { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.related-tests h3 { font-size: 16px; color: var(--text-muted, #94a3b8); margin-bottom: 12px; text-align: center; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.related-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
  text-decoration: none; color: var(--text, #fff);
  transition: transform 0.2s, border-color 0.2s;
}
.related-card:hover { transform: translateY(-2px); border-color: var(--card-color, #3498db); }
.related-emoji { font-size: 28px; }
.related-name { font-size: 12px; font-weight: 600; text-align: center; color: var(--text-muted, #94a3b8); }
[data-theme="light"] .related-card { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); }

/* City rarity stat */
.city-rarity { text-align: center; margin: 16px 0 0; font-size: 13px; color: var(--text-muted, #94a3b8); }
.city-rarity strong { color: var(--primary, #FF6B35); }

/* Enhanced social proof badge */
.social-proof-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(43,122,133,0.15), rgba(43,122,133,0.05));
  border: 1px solid rgba(43,122,133,0.2);
  margin-bottom: 16px;
}
.social-proof-count {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-light);
}
.social-proof-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.social-proof-stars {
  display: flex;
  gap: 2px;
  font-size: 0.75rem;
  color: #f5a623;
}

/* Result carousel */
.result-carousel {
  margin-top: 16px;
  padding: 14px 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.carousel-item {
  font-size: 0.95rem;
  font-weight: 600;
  animation: carouselFade 0.5s ease;
}
@keyframes carouselFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sample question preview */
.sample-question-preview {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}
.sample-q-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 6px;
}
.sample-q-text {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}
.sample-q-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  user-select: none;
}
.sample-q-option {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* About / Collapsible Section */
.about-section {
  max-width: 480px;
  margin: 24px auto;
  padding: 0 16px;
}
.about-section details {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
}
.about-section summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.about-section summary::after {
  content: "+";
  font-size: 18px;
  color: var(--primary-light);
  transition: transform 0.2s;
}
.about-section details[open] summary::after {
  content: "\2212";
}
.about-section summary::-webkit-details-marker { display: none; }
.about-content {
  padding: 0 18px 18px;
}
.about-content h2 {
  font-size: 16px;
  color: var(--primary-light);
  margin: 16px 0 8px;
}
.about-content p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 12px;
}

/* Mid-quiz encouragement */
.mid-quiz-encouragement {
  text-align: center;
  font-size: 0.85rem;
  color: var(--primary-light);
  padding: 8px 0;
  margin-bottom: 8px;
  animation: encourageFade 2.5s ease forwards;
}
@keyframes encourageFade {
  0% { opacity: 0; transform: translateY(-6px); }
  15% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .city-light { display: none; }
}
