/* MBTI Data Statistics - Main Stylesheet */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #6C5CE7;
  --primary-dark: #5A4BD1;
  --secondary: #00B894;
  --accent: #FDCB6E;
  --danger: #E17055;
  --bg: #FAFBFC;
  --bg-card: #FFFFFF;
  --text: #2D3436;
  --text-light: #636E72;
  --text-muted: #B2BEC3;
  --border: #DFE6E9;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

/* Header & Navigation */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

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

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 800;
}

.main-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

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

.main-nav a:hover, .main-nav a.active {
  color: var(--primary);
}

.cta-btn {
  background: var(--primary);
  color: white !important;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600 !important;
  transition: background 0.2s;
}

.cta-btn:hover {
  background: var(--primary-dark);
}

/* Main Content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.3;
}

.hero p {
  font-size: 18px;
  color: var(--text-light);
  max-width: 680px;
  margin: 0 auto 24px;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Section Styles */
.section {
  margin-bottom: 48px;
}

.section-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 24px;
}

/* Cards Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.25s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

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

.card-stat {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.card-stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* Data Table */
.data-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  background: #F8F9FA;
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-light);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #F8F9FA;
}

.data-table .rank {
  font-weight: 700;
  color: var(--primary);
  width: 40px;
}

.data-table .type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  font-family: 'SF Mono', Monaco, monospace;
}

.type-analyst { background: #E8F4FD; color: #0984E3; }
.type-diplomat { background: #E8F8F0; color: #00B894; }
.type-sentinel { background: #FEF5E7; color: #F39C12; }
.type-explorer { background: #FDEDEC; color: #E17055; }

/* Bar Chart */
.bar-chart {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.bar-label {
  width: 80px;
  font-weight: 600;
  font-size: 14px;
  text-align: right;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 28px;
  background: #F1F2F6;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  transition: width 0.6s ease;
}

.bar-value {
  width: 60px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

/* Content Article */
.article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 32px;
}

.article h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 32px 0 16px;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.article h2:first-child {
  margin-top: 0;
}

.article h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text);
}

.article p {
  margin-bottom: 16px;
  color: var(--text-light);
  font-size: 15px;
  line-height: 1.8;
}

.article ul, .article ol {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--text-light);
}

.article li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.article strong {
  color: var(--text);
  font-weight: 600;
}

.article a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(108, 92, 231, 0.3);
}

.article a:hover {
  border-bottom-color: var(--primary);
}

/* Callout Box */
.callout {
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
  border-left: 4px solid;
}

.callout-info {
  background: #EBF5FF;
  border-color: #0984E3;
}

.callout-warning {
  background: #FEF9E7;
  border-color: #F39C12;
}

.callout-success {
  background: #E8F8F0;
  border-color: #00B894;
}

.callout-title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 15px;
}

.callout p {
  margin: 0;
  font-size: 14px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.stat-box {
  background: linear-gradient(135deg, #F8F9FA, #FFFFFF);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--text-light);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .sep {
  margin: 0 8px;
}

/* Related Links */
.related-links {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 32px;
}

.related-links h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #F8F9FA;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-light);
  font-size: 14px;
  transition: all 0.2s;
}

.related-item:hover {
  background: #EEF0F4;
  color: var(--primary);
}

.related-item .icon {
  font-size: 18px;
}

/* Source Note */
.source-note {
  background: #F8F9FA;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.source-note strong {
  color: var(--text-light);
}

/* Footer */
.site-footer {
  background: #2D3436;
  color: #B2BEC3;
  padding: 48px 0 32px;
  margin-top: 64px;
}

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

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

.footer-brand h3 {
  color: white;
  font-size: 18px;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
}

.footer-col h4 {
  color: white;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  color: #B2BEC3;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #636E72;
  padding-top: 24px;
  text-align: center;
  font-size: 13px;
}

/* Comparison Table Highlight */
.highlight-row td {
  background: #F0EDFC !important;
  font-weight: 600;
}

/* Two Column Layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 24px 0;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 26px; }
  .card-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .article { padding: 20px; }
  .two-col { grid-template-columns: 1fr; }
  .main-nav { display: flex; gap: 0; }
  .main-nav a:not(.cta-btn) { display: none; }
  .header-inner { height: 56px; padding: 0 16px; }
  .logo { font-size: 17px; }
  .logo-icon { width: 28px; height: 28px; font-size: 12px; }
  .cta-btn { padding: 7px 14px; font-size: 13px; white-space: nowrap; }
  .container { padding: 24px 16px; }
  .bar-label { width: 56px; font-size: 11px; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 10px 8px; }
}
