/* ============================================================
   TraitMind Theme - Modern Test Platform
   ============================================================ */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --accent: #ec4899;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: "Inter", "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 64px;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.logo-icon { font-size: 26px; }
.logo-highlight { color: var(--primary); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover { color: var(--primary); }

/* ===== Language Switcher ===== */
.lang-dropdown { position: relative; }

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-light);
  transition: var(--transition);
}

.lang-btn:hover { border-color: var(--primary-light); }

.lang-current {
  font-weight: 600;
  font-size: 12px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 100;
}

.lang-dropdown:hover .lang-menu,
.lang-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-item {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  transition: var(--transition);
}

.lang-item:hover { background: var(--bg); color: var(--primary); }
.lang-item.active { color: var(--primary); font-weight: 600; background: #eef2ff; }
.lang-item:first-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.lang-item:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 64px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 20% 20%, rgba(99,102,241,0.08), transparent),
    radial-gradient(ellipse 60% 60% at 80% 80%, rgba(236,72,153,0.06), transparent);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 0;
}

.hero-title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-light);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-actions { margin-bottom: 48px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-family: var(--font);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}

.btn-lg { padding: 16px 32px; font-size: 17px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.stat-item { text-align: center; }
.stat-num {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Sections ===== */
.section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 32px;
  font-weight: 700;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 3px;
  background: linear-gradient(to right, var(--primary), var(--accent));
  border-radius: 3px;
}

/* ===== Tests Grid ===== */
.tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.test-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.test-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-color);
  opacity: 0.6;
  transition: var(--transition);
}

.test-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.test-card:hover::before { opacity: 1; height: 4px; }

.card-icon { font-size: 40px; margin-bottom: 16px; }

.card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.card-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 16px;
}

.card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.card-meta i { margin-right: 4px; }

.card-action { text-align: right; }

.card-action .btn { color: #fff; font-weight: 500; }

/* ===== Test Page ===== */
.test-page {
  padding: 100px 0 60px;
  min-height: 100vh;
}

.test-header {
  text-align: center;
  margin-bottom: 40px;
}

.test-header .test-icon { font-size: 56px; margin-bottom: 16px; }

.test-header h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.test-header p {
  font-size: 16px;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 24px;
}

.test-info {
  display: inline-flex;
  gap: 24px;
  padding: 12px 24px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-light);
}

.test-info i { margin-right: 4px; color: var(--primary); }

/* ===== Test Quiz ===== */
.quiz-container {
  max-width: 700px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  border: 1px solid var(--border);
  min-height: 400px;
}

.quiz-progress {
  margin-bottom: 32px;
}

.progress-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-text {
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
}

.quiz-question {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 32px;
  line-height: 1.5;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 15px;
  font-weight: 500;
}

.quiz-option:hover {
  border-color: var(--primary-light);
  background: #eef2ff;
}

.quiz-option.selected {
  border-color: var(--primary);
  background: #eef2ff;
}

.quiz-option .option-key {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.quiz-option.selected .option-key {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== Results ===== */
.result-container {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.result-type {
  font-size: 56px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 16px 0;
}

.result-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.result-desc {
  font-size: 16px;
  color: var(--text-light);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 32px;
}

.result-details {
  text-align: left;
  margin: 32px 0;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-section li {
  padding: 6px 14px;
  background: var(--bg);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-light);
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* ===== Footer ===== */
.site-footer {
  background: #1e293b;
  color: #cbd5e1;
  padding: 60px 0 30px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-logo {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.footer-desc { font-size: 14px; line-height: 1.7; }

.footer-links h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links a {
  display: block;
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 10px;
  transition: var(--transition);
}

.footer-links a:hover { color: var(--primary-light); }

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid #334155;
  text-align: center;
  font-size: 13px;
  color: #64748b;
}

/* ===== 404 ===== */
.error-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-page h1 { font-size: 120px; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.error-page p { font-size: 18px; color: var(--text-light); margin: 16px 0 32px; }

/* ===== Animations ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-aos] { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-aos].aos-animate { opacity: 1; transform: translateY(0); }
[data-aos-delay="100"] { transition-delay: 0.1s; }
[data-aos-delay="200"] { transition-delay: 0.2s; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .tests-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
  .test-info { flex-direction: column; gap: 8px; }
  .quiz-container { padding: 24px; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-link { display: none; }
  .quiz-question { font-size: 17px; }
}

/* Accessibility & Polish */
::selection { background: var(--primary); color: #fff; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
