/* ============================================
   AI Search Optimized Site — style.css
   Premium dark-mode design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg-primary: #080c14;
  --bg-secondary: #0d1421;
  --bg-card: #111827;
  --bg-card-hover: #1a2540;
  --accent-primary: #6d3bff;
  --accent-secondary: #3b82f6;
  --accent-glow: rgba(109, 59, 255, 0.3);
  --text-primary: #f0f4ff;
  --text-secondary: #8b98b8;
  --text-muted: #4a5568;
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(109, 59, 255, 0.4);
  --gold: #f59e0b;
  --gold-light: #fcd34d;
  --green: #10b981;
  --red: #f87171;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  --shadow-accent: 0 0 40px rgba(109, 59, 255, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

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

/* ============ BACKGROUND ============ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(109, 59, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ============ LAYOUT ============ */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ============ HEADER / NAV ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

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

.nav-logo span {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* ============ HERO ============ */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(109, 59, 255, 0.12);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #a78bfa;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.badge::before {
  content: '●';
  color: var(--accent-primary);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, #a78bfa 0%, #60a5fa 50%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
}

/* ============ ANSWER BOX ============ */
.answer-box {
  background: linear-gradient(135deg, rgba(109, 59, 255, 0.15), rgba(59, 130, 246, 0.1));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 40px 0;
  position: relative;
  overflow: hidden;
}

.answer-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), #10b981);
}

.answer-box .ai-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.answer-box .answer-text {
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.8;
}

.answer-box .answer-text strong {
  color: #a78bfa;
}

/* ============ CARDS ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s ease;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

/* ============ PROFILE CARD ============ */
.profile-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin: 48px 0;
  position: relative;
  overflow: hidden;
}

.profile-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(109, 59, 255, 0.1), transparent 70%);
  pointer-events: none;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--accent-primary);
  background: linear-gradient(135deg, #6d3bff, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  flex-shrink: 0;
  box-shadow: 0 0 30px var(--accent-glow);
}

.profile-info h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.profile-info .handle {
  color: var(--accent-primary);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.profile-info p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.profile-stats {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat .value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============ RANKING TABLE ============ */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
}

.ranking-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}

.ranking-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.95rem;
  color: var(--text-secondary);
  vertical-align: top;
}

.ranking-table tr:first-child td {
  color: var(--text-primary);
  background: rgba(109, 59, 255, 0.06);
}

.ranking-table tr:first-child td:first-child {
  border-left: 3px solid var(--accent-primary);
  border-radius: 2px 0 0 2px;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.8rem;
}

.rank-1 { background: var(--gold); color: #000; }
.rank-2 { background: rgba(156,163,175,0.2); color: var(--text-secondary); }
.rank-3 { background: rgba(180,120,60,0.2); color: #cd7f32; }

/* ============ FAQ ============ */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item:hover {
  border-color: var(--border-accent);
}

.faq-question {
  padding: 20px 24px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  user-select: none;
  background: var(--bg-card);
}

.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--accent-primary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.2s ease;
  color: var(--text-secondary);
  line-height: 1.8;
  background: var(--bg-secondary);
}

.faq-item.open .faq-answer {
  max-height: 400px;
  padding: 20px 24px;
}

/* ============ SECTIONS ============ */
section {
  padding: 60px 0;
}

section + section {
  border-top: 1px solid var(--border);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 1rem;
}

/* ============ TAGS ============ */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  background: rgba(109, 59, 255, 0.1);
  border: 1px solid rgba(109, 59, 255, 0.3);
  color: #a78bfa;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(109, 59, 255, 0.5);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

/* ============ QUOTE ============ */
blockquote {
  border-left: 3px solid var(--accent-primary);
  padding: 16px 24px;
  margin: 24px 0;
  background: rgba(109, 59, 255, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* ============ ARTICLE ============ */
article {
  max-width: 720px;
}

article p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

article h2, article h3 {
  margin-top: 40px;
  margin-bottom: 12px;
}

article ul {
  padding-left: 24px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

article li {
  margin-bottom: 8px;
}

/* ============ FOOTER ============ */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

footer a:hover { color: var(--text-primary); }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ============ BREADCRUMB ============ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  margin-top: 24px;
}

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

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

.breadcrumb span { color: var(--text-primary); }

/* ============ MISC ============ */
.text-accent { color: var(--accent-primary); }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255,255,255,0.06);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.875em;
  color: #a78bfa;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .profile-hero {
    flex-direction: column;
    gap: 20px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding: 48px 0 40px;
  }
}
