/* ==========================================================================
   TUANHOMNI.COM - PHONG CÁCH TIÊN HIỆP ĐẠO QUÂN (XIANXIA THEME SYSTEM)
   Tông Chủ: Tử Anh Omni | Vị Diện: tuanhomni.com
   ========================================================================== */

:root {
  /* Default: Thanh Lam Hư Không (Cyan / Frost Qi) */
  --bg-primary: #060913;
  --bg-secondary: #0b1120;
  --bg-tertiary: #101b33;
  --bg-card: rgba(14, 23, 42, 0.75);
  --bg-card-hover: rgba(20, 33, 61, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.6);
  --bg-glass-strong: rgba(11, 18, 33, 0.9);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-gold: #fbbf24;
  --text-cyan: #38bdf8;
  --text-purple: #c084fc;
  --text-emerald: #34d399;

  --primary: #00d2ff;
  --primary-rgb: 0, 210, 255;
  --primary-glow: rgba(0, 210, 255, 0.4);
  --primary-deep: #0284c7;

  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.45);
  --accent-gold-rgb: 245, 158, 11;

  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.4);

  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.4);

  --border-color: rgba(56, 189, 248, 0.18);
  --border-color-hover: rgba(56, 189, 248, 0.45);
  --border-gold: rgba(245, 158, 11, 0.35);

  --glow-subtle: 0 0 20px rgba(0, 210, 255, 0.15);
  --glow-medium: 0 0 30px rgba(0, 210, 255, 0.25);
  --glow-strong: 0 0 45px rgba(0, 210, 255, 0.4);
  --glow-gold: 0 0 30px rgba(245, 158, 11, 0.3);

  --font-title: 'Playfair Display', 'Be Vietnam Pro', serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.2s ease;
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme 2: Kim Đan Thánh Quang (Gold / Solar Qi) */
body[data-aura="gold"] {
  --bg-primary: #0b0904;
  --bg-secondary: #161208;
  --bg-tertiary: #241d0e;
  --bg-card: rgba(27, 21, 11, 0.75);
  --bg-card-hover: rgba(38, 30, 16, 0.88);
  --bg-glass: rgba(24, 18, 10, 0.65);
  --bg-glass-strong: rgba(20, 15, 8, 0.92);

  --primary: #f59e0b;
  --primary-rgb: 245, 158, 11;
  --primary-glow: rgba(245, 158, 11, 0.45);
  --primary-deep: #d97706;

  --border-color: rgba(245, 158, 11, 0.22);
  --border-color-hover: rgba(245, 158, 11, 0.55);
  --glow-subtle: 0 0 20px rgba(245, 158, 11, 0.2);
  --glow-medium: 0 0 35px rgba(245, 158, 11, 0.35);
  --glow-strong: 0 0 50px rgba(245, 158, 11, 0.5);
}

/* Theme 3: Tử Tiêu Ma Đạo / Hư Không Thần Lôi (Purple / Void Qi) */
body[data-aura="purple"] {
  --bg-primary: #090511;
  --bg-secondary: #120b22;
  --bg-tertiary: #1d1235;
  --bg-card: rgba(24, 15, 43, 0.75);
  --bg-card-hover: rgba(36, 23, 64, 0.88);
  --bg-glass: rgba(20, 13, 36, 0.65);
  --bg-glass-strong: rgba(16, 10, 29, 0.92);

  --primary: #c084fc;
  --primary-rgb: 192, 132, 252;
  --primary-glow: rgba(192, 132, 252, 0.45);
  --primary-deep: #9333ea;

  --border-color: rgba(192, 132, 252, 0.22);
  --border-color-hover: rgba(192, 132, 252, 0.55);
  --glow-subtle: 0 0 20px rgba(192, 132, 252, 0.2);
  --glow-medium: 0 0 35px rgba(192, 132, 252, 0.35);
  --glow-strong: 0 0 50px rgba(192, 132, 252, 0.5);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Background Layers */
.canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

#bg-particles {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.cosmic-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 50% 15%, rgba(var(--primary-rgb), 0.15) 0%, transparent 60%),
    radial-gradient(circle at 85% 65%, rgba(var(--accent-gold-rgb), 0.08) 0%, transparent 50%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.8;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.35);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

/* Text selections */
::selection {
  background: rgba(var(--primary-rgb), 0.35);
  color: #ffffff;
}

/* Container */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--text-main);
}

.xianxia-title {
  position: relative;
  display: inline-block;
  font-size: 2.2rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffffff 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.xianxia-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 650px;
  margin: 0 auto 2.5rem auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1.1rem;
  border-radius: var(--radius-full);
  background: rgba(var(--primary-rgb), 0.1);
  border: 1px solid var(--border-color);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  box-shadow: var(--glow-subtle);
}

.section-badge i {
  font-size: 0.9rem;
}

/* Glowing divider */
.talisman-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.2rem auto 0 auto;
  max-width: 280px;
  opacity: 0.8;
}

.talisman-divider .line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.talisman-divider .gem {
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

/* Glassmorphism Card Style */
.xianxia-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.xianxia-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.1), transparent 65%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.xianxia-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-color-hover);
  box-shadow: var(--glow-medium);
  background: var(--bg-card-hover);
}

.xianxia-card:hover::before {
  opacity: 1;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: #060913;
  background: linear-gradient(135deg, var(--primary) 0%, #38bdf8 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: 0 0 20px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--primary-glow), 0 5px 15px rgba(0, 0, 0, 0.5);
  filter: brightness(1.1);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  color: #ffffff;
  background: rgba(var(--primary-rgb), 0.15);
  box-shadow: var(--glow-subtle);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #1e1302;
  box-shadow: 0 0 20px var(--accent-gold-glow);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-gold:hover {
  box-shadow: 0 0 30px var(--accent-gold-glow), 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.badge-live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-tier-s {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.badge-tier-a {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.badge-tier-b {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

/* Animations */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes floatGentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px var(--primary-glow); opacity: 0.9; }
  50% { box-shadow: 0 0 35px var(--primary-glow); opacity: 1; }
}

@keyframes shimmerEffect {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.floating-anim {
  animation: floatGentle 5s ease-in-out infinite;
}

.spinning-slow {
  animation: spinSlow 30s linear infinite;
}

.spinning-reverse {
  animation: spinReverse 40s linear infinite;
}
