/**
 * CollabMatch Design System - Standardized CSS Variables
 * Award-winning dark theme with WCAG AA compliance
 * v1.0 - January 2026
 */

:root {
  /* Primary Palette - Indigo to Purple gradient */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  /* Secondary & Accent Colors */
  --secondary: #8b5cf6;
  --secondary-hover: #7c3aed;
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  
  /* Semantic Colors */
  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --info: #3b82f6;
  --info-light: rgba(59, 130, 246, 0.15);
  
  /* Background System - 4 Layer Depth */
  --background: #0f0f23;
  --background-elevated: #12122a;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-elevated: rgba(255, 255, 255, 0.08);
  --panel: #141428;
  --card: #181830;
  
  /* Text Colors - WCAG AA Compliant */
  --text: #ffffff;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Border System */
  --border: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.15);
  
  /* Gradient Presets */
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
  --gradient-surface: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
  
  /* Glassmorphism */
  --glass: rgba(20, 20, 40, 0.8);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 12px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--primary-glow);
  
  /* Spacing Scale (8pt grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* Font Sizes */
  --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;
  --text-5xl: 3rem;
  
  /* Line Heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;
  
  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
  
  /* Touch Targets */
  --touch-target: 44px;
  --touch-target-sm: 38px;
  --touch-target-lg: 52px;
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 1rem 1.5rem;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
  transition: left var(--transition-fast);
}

.skip-to-main:focus {
  left: 0;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Focus-visible styles for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: rgba(255, 255, 255, 0.3);
    --border-strong: rgba(255, 255, 255, 0.5);
    --text-muted: #a0aec0;
  }
  
  .btn {
    border-width: 2px !important;
  }
}

/* ============================================
   BUTTON SYSTEM
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  min-height: var(--touch-target);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Primary Button */
.btn-primary {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #7c3aed 100%);
  box-shadow: 0 6px 20px var(--primary-glow);
}

/* Secondary Button */
.btn-secondary {
  background: var(--secondary);
  color: #fff;
  border-color: transparent;
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

/* Outline Button */
.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

/* Button Sizes */
.btn-sm {
  padding: 0.5rem 1rem;
  min-height: var(--touch-target-sm);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: 1rem 2rem;
  min-height: var(--touch-target-lg);
  font-size: var(--text-lg);
}

/* Button with loading spinner */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading .spinner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   CARD SYSTEM
   ============================================ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

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

/* Glass Card */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

/* Stat Card */
.stat-card {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--gradient-surface);
  border: 1px solid var(--border);
}

/* Card Body */
.card-body {
  padding: var(--space-6);
}

/* Card Header */
.card-header {
  padding: var(--space-4) var(--space-6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-control,
.form-select {
  width: 100%;
  height: var(--touch-target);
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.form-control:hover,
.form-select:hover {
  border-color: var(--border-strong);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

/* Form Label */
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text);
}

/* Required indicator */
.form-label.required::after {
  content: " *";
  color: var(--danger);
}

/* Validation States */
.form-control.is-invalid {
  border-color: var(--danger);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px var(--danger-light);
}

.form-control.is-valid {
  border-color: var(--success);
}

.form-control.is-valid:focus {
  box-shadow: 0 0 0 3px var(--success-light);
}

.invalid-feedback {
  color: var(--danger);
  font-size: var(--text-sm);
  margin-top: 0.25rem;
}

.valid-feedback {
  color: var(--success);
  font-size: var(--text-sm);
  margin-top: 0.25rem;
}

/* ============================================
   LOADING STATES
   ============================================ */

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-elevated) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: 1rem;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-card {
  height: 200px;
  border-radius: var(--radius);
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* Progress Bar */
.progress {
  height: 8px;
  background: var(--surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: toast-slide-in 0.3s ease-out;
}

.toast.hide {
  animation: toast-slide-out 0.3s ease-in forwards;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--info); }

/* ============================================
   MICRO-INTERACTIONS
   ============================================ */

/* Hover lift effect */
.hover-lift {
  transition: transform var(--transition), box-shadow var(--transition);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Hover scale effect */
.hover-scale {
  transition: transform var(--transition);
}

.hover-scale:hover {
  transform: scale(1.02);
}

/* Hover glow effect */
.hover-glow {
  transition: box-shadow var(--transition);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* Pulse animation for notifications */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Scale in animation */
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.scale-in {
  animation: scaleIn 0.2s ease-out;
}

/* ============================================
   RESPONSIVE MOBILE STYLES
   ============================================ */

@media (max-width: 767.98px) {
  :root {
    --text-4xl: 1.875rem;
    --text-5xl: 2.25rem;
  }
  
  .btn {
    min-height: var(--touch-target);
    padding: 0.75rem 1.25rem;
  }
  
  .btn-sm {
    min-height: var(--touch-target);
  }
  
  .form-control,
  .form-select {
    min-height: 48px;
    font-size: 16px; /* Prevents iOS zoom */
  }
  
  .card-body {
    padding: var(--space-4);
  }
  
  .toast-container {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: 100%;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text utilities */
.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Background utilities */
.bg-glass {
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.bg-gradient { background: var(--gradient); }
.bg-surface { background: var(--surface); }
.bg-panel { background: var(--panel); }

/* Border utilities */
.border-subtle { border: 1px solid var(--border-subtle); }
.border-default { border: 1px solid var(--border); }
.border-strong { border: 1px solid var(--border-strong); }

/* Spacing utilities */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   MICRO-INTERACTIONS & ANIMATIONS
   ============================================ */

/* Success bounce animation */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-8px); }
  50% { transform: translateY(-4px); }
  75% { transform: translateY(-2px); }
}

.success-bounce {
  animation: bounce 0.5s ease-out;
}

/* Pulse notification effect */
@keyframes pulse {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }
  50% { 
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
  }
}

.pulse-notification {
  animation: pulse 2s infinite;
}

/* Subtle glow pulse */
@keyframes glow-pulse {
  0%, 100% { 
    box-shadow: 0 0 0 0 var(--primary-glow);
  }
  50% { 
    box-shadow: 0 0 20px 4px var(--primary-glow);
  }
}

.glow-pulse {
  animation: glow-pulse 2s ease-in-out infinite;
}

/* Confetti animation (CSS-only lightweight version) */
@keyframes confetti-fall {
  0% { 
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }
  100% { 
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confetti-fall 3s ease-out forwards;
}

.confetti-piece:nth-child(odd) {
  background: var(--primary);
  border-radius: 2px;
}

.confetti-piece:nth-child(even) {
  background: var(--secondary);
  border-radius: 50%;
}

.confetti-piece:nth-child(3n) {
  background: var(--success);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.confetti-piece:nth-child(4n) {
  background: var(--warning);
}

/* Shake animation for attention */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake-attention {
  animation: shake 0.6s ease-in-out;
}

/* Fade in up animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.4s ease-out forwards;
}

/* Staggered animation for lists */
.stagger-animate > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease-out forwards;
}

.stagger-animate > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-animate > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-animate > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-animate > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-animate > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-animate > *:nth-child(6) { animation-delay: 0.3s; }

/* Scale pop animation */
@keyframes scalePop {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.scale-pop {
  animation: scalePop 0.3s ease-out forwards;
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.3s ease-out forwards;
}

/* Success checkmark animation */
@keyframes checkmark-draw {
  0% { stroke-dashoffset: 50; }
  100% { stroke-dashoffset: 0; }
}

.checkmark-animate {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: checkmark-draw 0.5s ease-out 0.2s forwards;
}

/* Hover lift effect */
.hover-lift {
  transition: transform var(--transition), box-shadow var(--transition);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Hover glow effect */
.hover-glow {
  transition: box-shadow var(--transition);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* Button ripple effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
  width: 300px;
  height: 300px;
}

/* Page transition fade */
.page-transition {
  animation: fadeInUp 0.3s ease-out;
}

/* Loading shimmer effect */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Number counter animation */
@keyframes countUp {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

.count-animate {
  animation: countUp 0.3s ease-out;
}

/* Achievement unlock flash */
@keyframes achievementFlash {
  0% { 
    opacity: 0; 
    transform: scale(0.5);
  }
  50% { 
    opacity: 1;
    transform: scale(1.1);
  }
  100% { 
    opacity: 1;
    transform: scale(1);
  }
}

.achievement-unlock {
  animation: achievementFlash 0.5s ease-out forwards;
}

/* Toast notification slide */
@keyframes toastSlide {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-animate {
  animation: toastSlide 0.3s ease-out forwards;
}

/* Heartbeat for important elements */
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.05); }
  50% { transform: scale(1); }
  75% { transform: scale(1.03); }
}

.heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* Typing indicator dots */
@keyframes typingDot {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

.typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  margin: 0 2px;
  animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Progress bar animation */
@keyframes progressFill {
  from { width: 0; }
}

.progress-animate {
  animation: progressFill 0.8s ease-out forwards;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .success-bounce,
  .pulse-notification,
  .glow-pulse,
  .shake-attention,
  .fade-in-up,
  .scale-pop,
  .slide-in-right,
  .hover-lift,
  .shimmer,
  .achievement-unlock,
  .toast-animate,
  .heartbeat,
  .stagger-animate > *,
  .progress-animate {
    animation: none !important;
  }
  
  .hover-lift:hover {
    transform: none;
  }
  
  .confetti-container {
    display: none;
  }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #e2e8f0;
  font-size: 0.9375rem;
}

.toast-content i {
  font-size: 1.25rem;
}

.toast-success .toast-content i { color: var(--success); }
.toast-error .toast-content i { color: var(--danger); }
.toast-warning .toast-content i { color: var(--warning); }
.toast-info .toast-content i { color: var(--primary); }

.toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.25rem;
  line-height: 1;
  transition: color 0.2s;
}

.toast-close:hover {
  color: #e2e8f0;
}

/* ============================================
   ACHIEVEMENT OVERLAY
   ============================================ */

.achievement-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-popup {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 20px;
  padding: 2.5rem;
  text-align: center;
  max-width: 400px;
  box-shadow: 
    0 0 0 1px rgba(139, 92, 246, 0.2),
    0 25px 80px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(139, 92, 246, 0.15);
}

.achievement-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #1f2937;
  box-shadow: 0 10px 40px rgba(245, 158, 11, 0.4);
}

.achievement-popup h3 {
  color: #f59e0b;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.achievement-popup p {
  color: #94a3b8;
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #6366f1;
}

.empty-state-title {
  color: #e2e8f0;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state-description {
  color: #94a3b8;
  font-size: 0.9375rem;
  max-width: 320px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

.empty-state-tip {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #a78bfa;
  margin-top: 1.5rem;
  display: inline-block;
}

.empty-state-tip i {
  margin-right: 0.5rem;
}
