/* ============================================
   RaxhuAI — Design System
   ============================================ */

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

:root {
  /* Brand Colors */
  --color-primary: #6C63FF;
  --color-primary-light: #8B85FF;
  --color-primary-dark: #5046E5;
  --color-secondary: #FF6B9D;
  --color-secondary-light: #FF8DB5;
  --color-accent-cyan: #00D2FF;
  --color-accent-green: #00E897;
  --color-accent-orange: #FF9F43;

  /* Background */
  --color-bg: #F8F9FC;
  --color-bg-gradient-pink: rgba(252, 228, 236, 0.45);
  --color-bg-gradient-blue: rgba(227, 242, 253, 0.45);
  --color-bg-gradient-purple: rgba(237, 231, 255, 0.35);

  /* Text */
  --color-text: #1A1A2E;
  --color-text-secondary: #6B7280;
  --color-text-light: #9CA3AF;
  --color-text-inverse: #FFFFFF;

  /* Surfaces */
  --color-surface: rgba(255, 255, 255, 0.72);
  --color-surface-hover: rgba(255, 255, 255, 0.88);
  --color-surface-solid: #FFFFFF;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.18);
  --glass-bg-strong: rgba(255, 255, 255, 0.30);
  --glass-bg-card: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.35);
  --glass-border-light: rgba(255, 255, 255, 0.20);
  --glass-blur: 20px;
  --glass-blur-strong: 30px;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Borders */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
  --shadow-glow-primary: 0 0 24px rgba(108, 99, 255, 0.25);
  --shadow-glow-pink: 0 0 24px rgba(255, 107, 157, 0.25);
  --shadow-glow-cyan: 0 0 24px rgba(0, 210, 255, 0.25);

  /* Layout */
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 80px;
  --header-height: 56px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ============================================
   Aurora / Animated Gradient Background
   ============================================ */
.aurora-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  overflow: hidden;
}

.aurora-bg .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: auroraFloat 12s ease-in-out infinite alternate;
}

.aurora-bg .blob-1 {
  width: 600px;
  height: 600px;
  background: var(--color-bg-gradient-pink);
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.aurora-bg .blob-2 {
  width: 500px;
  height: 500px;
  background: var(--color-bg-gradient-blue);
  top: 10%;
  right: -5%;
  animation-delay: -4s;
  animation-duration: 15s;
}

.aurora-bg .blob-3 {
  width: 450px;
  height: 450px;
  background: var(--color-bg-gradient-purple);
  bottom: -5%;
  left: 30%;
  animation-delay: -8s;
  animation-duration: 18s;
}

.aurora-bg .blob-4 {
  width: 350px;
  height: 350px;
  background: rgba(0, 210, 255, 0.15);
  bottom: 20%;
  right: 20%;
  animation-delay: -2s;
  animation-duration: 14s;
}

@keyframes auroraFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(40px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
  100% {
    transform: translate(30px, 10px) scale(1.05);
  }
}

/* ============================================
   Dark Mode
   ============================================ */
body.dark-mode {
  --color-bg: #0F0F1A;
  --color-text: #E4E4F0;
  --color-text-secondary: #9CA3C0;
  --color-text-light: #6B7290;
  --color-surface: rgba(30, 30, 50, 0.65);
  --color-surface-hover: rgba(40, 40, 65, 0.80);
  --color-surface-solid: #1A1A2E;

  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-strong: rgba(255, 255, 255, 0.10);
  --glass-bg-card: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-border-light: rgba(255, 255, 255, 0.06);
}

body.dark-mode .aurora-bg .blob-1 {
  background: rgba(108, 99, 255, 0.15);
}
body.dark-mode .aurora-bg .blob-2 {
  background: rgba(255, 107, 157, 0.10);
}
body.dark-mode .aurora-bg .blob-3 {
  background: rgba(0, 210, 255, 0.08);
}
body.dark-mode .aurora-bg .blob-4 {
  background: rgba(0, 232, 151, 0.08);
}

/* ============================================
   Glassmorphism Utilities
   ============================================ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur-strong));
  -webkit-backdrop-filter: blur(var(--glass-blur-strong));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.glass-card {
  background: var(--glass-bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  background: var(--color-surface-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(108, 99, 255, 0.25);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(108, 99, 255, 0.45);
}

/* ============================================
   Main Layout
   ============================================ */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

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

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

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

@keyframes gradientBorder {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

@keyframes ripple {
  0% { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(4); opacity: 0; }
}

/* ============================================
   Special Effect Layers
   ============================================ */
#confetti-canvas,
#matrix-canvas,
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

#matrix-canvas {
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#hearts-container,
#fireworks-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9997;
  overflow: hidden;
}

/* Floating hearts */
.floating-heart {
  position: absolute;
  font-size: 1.5rem;
  animation: heartFloat 3s ease-out forwards;
  pointer-events: none;
}

@keyframes heartFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.5) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-400px) scale(1.3) rotate(45deg);
  }
}

/* Firework particle */
.firework-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  animation: fireworkBurst 1.2s ease-out forwards;
  pointer-events: none;
}

@keyframes fireworkBurst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.3); }
}

/* Spark particles */
.spark-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: gold;
  border-radius: 50%;
  pointer-events: none;
  animation: sparkFly 1.5s ease-out forwards;
}

@keyframes sparkFly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  50% { opacity: 0.8; }
  100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(0); }
}

/* Glitch effect */
.glitch-active {
  animation: glitchEffect 0.3s ease infinite;
}

@keyframes glitchEffect {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 3px); }
  40% { transform: translate(-3px, -3px); }
  60% { transform: translate(3px, 3px); }
  80% { transform: translate(3px, -3px); }
  100% { transform: translate(0); }
}

/* Glow text */
.glow-text {
  text-shadow: 0 0 10px var(--color-primary), 0 0 20px var(--color-primary), 0 0 40px var(--color-primary);
}

/* Energy burst aura */
.energy-aura {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 165, 0, 0.3), 0 0 80px rgba(255, 69, 0, 0.2);
  animation: energyPulse 0.5s ease infinite alternate;
}

@keyframes energyPulse {
  from { box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 165, 0, 0.3); }
  to { box-shadow: 0 0 30px rgba(255, 215, 0, 0.7), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 100px rgba(255, 69, 0, 0.3); }
}

/* Overlay for special effects */
.effect-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9990;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.effect-overlay.active {
  opacity: 1;
}

.dark-overlay {
  background: rgba(0, 0, 0, 0.6);
}

/* ============================================
   Loading / Skeleton
   ============================================ */
.skeleton {
  background: linear-gradient(90deg,
    var(--glass-bg) 25%,
    var(--glass-bg-strong) 50%,
    var(--glass-bg) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ============================================
   Badge / Tag
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border-light);
  color: var(--color-text-secondary);
}

.badge-primary {
  background: rgba(108, 99, 255, 0.12);
  color: var(--color-primary);
  border-color: rgba(108, 99, 255, 0.2);
}

.badge-pink {
  background: rgba(255, 107, 157, 0.12);
  color: var(--color-secondary);
  border-color: rgba(255, 107, 157, 0.2);
}

.badge-cyan {
  background: rgba(0, 210, 255, 0.12);
  color: var(--color-accent-cyan);
  border-color: rgba(0, 210, 255, 0.2);
}

/* ============================================
   Tooltip
   ============================================ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: var(--space-1) var(--space-3);
  background: var(--color-text);
  color: var(--color-text-inverse);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
  z-index: 100;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
