/* ===================================================================
   THEME.CSS - 'Celestial Premium' Design System v2.0
   State-of-the-art UI kit: depth, glassmorphism, micro-animations
   =================================================================== */

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

:root {
  /* ======== Brand Palette (Vibrant & Deep) ======== */
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-darker: #1d4ed8;
  --primary-light: #60a5fa;
  --primary-lighter: #93c5fd;
  --primary-glow: rgba(59, 130, 246, 0.5);
  --primary-glow-soft: rgba(59, 130, 246, 0.25);

  --accent: #8b5cf6;
  --accent-dark: #7c3aed;
  --accent-light: #a78bfa;
  --accent-glow: rgba(139, 92, 246, 0.5);

  --secondary: #06b6d4;
  --secondary-glow: rgba(6, 182, 212, 0.4);

  /* Surfaces & Backgrounds */
  --surface-0: #ffffff;
  --surface-50: #f8fafc;
  --surface-100: #f1f5f9;
  --surface-200: #e2e8f0;
  --surface-300: #cbd5e1;
  --surface-glass: rgba(255, 255, 255, 0.75);
  --surface-glass-strong: rgba(255, 255, 255, 0.9);
  --surface-glass-dark: rgba(15, 23, 42, 0.6);
  --surface-frosted: rgba(248, 250, 252, 0.85);

  /* ======== Text Colors ======== */
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  /* ======== Functional Colors ======== */
  --success: #10b981;
  --success-light: #34d399;
  --success-bg: rgba(16, 185, 129, 0.1);
  --success-glow: rgba(16, 185, 129, 0.4);

  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --warning-bg: rgba(245, 158, 11, 0.1);

  --danger: #ef4444;
  --danger-light: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-glow: rgba(239, 68, 68, 0.4);

  --info: #0ea5e9;
  --info-light: #38bdf8;
  --info-bg: rgba(14, 165, 233, 0.1);

  /* ======== Premium Shadows (Layered & Colored) ======== */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 2px 15px -3px rgba(0, 0, 0, 0.07), 0 10px 20px -2px rgba(0, 0, 0, 0.04);
  --shadow-dreamy: 0 4px 30px rgba(0, 0, 0, 0.08);

  /* Colored Glows */
  --glow-primary: 0 0 20px rgba(59, 130, 246, 0.15);
  --glow-primary-md: 0 0 25px rgba(59, 130, 246, 0.25);
  --glow-primary-lg: 0 10px 40px -10px rgba(59, 130, 246, 0.5);
  --glow-accent: 0 10px 40px -10px rgba(139, 92, 246, 0.4);
  --glow-hover: 0 0 15px rgba(59, 130, 246, 0.3);
  --glow-success: 0 10px 30px -5px rgba(16, 185, 129, 0.35);
  --glow-danger: 0 10px 30px -5px rgba(239, 68, 68, 0.35);

  /* ======== Border Radii ======== */
  --radius-xs: 0.375rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;

  /* ======== Typography ======== */
  --font-display: 'Outfit', sans-serif;
  --font-body: '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: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3rem;

  /* ======== 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;

  /* ======== Premium Transitions ======== */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-silk: cubic-bezier(0.22, 1, 0.36, 1);

  /* ======== Semantic Mappings ======== */
  --bg-body: #f0f4f8;
  --bg-gradient: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  --glass-border: 1px solid rgba(255, 255, 255, 0.5);
  --glass-border-strong: 1px solid rgba(255, 255, 255, 0.7);
  --glass-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
  --glass-highlight-strong: inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

/* ===================================================================
   UTILITY CLASSES - Typography
   =================================================================== */

.font-display {
  font-family: var(--font-display);
}

.font-body {
  font-family: var(--font-body);
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-subtle {
  background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-shimmer {
  background: linear-gradient(90deg,
      var(--text-main) 0%,
      var(--primary) 25%,
      var(--accent) 50%,
      var(--primary) 75%,
      var(--text-main) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShimmer 3s linear infinite;
}

/* ===================================================================
   KEYFRAME ANIMATIONS - Premium Collection
   =================================================================== */

/* Basic Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Premium Animations */
@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes floatSoft {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-5px) rotate(0.5deg);
  }

  75% {
    transform: translateY(3px) rotate(-0.5deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes pulseSoft {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.02);
    opacity: 0.9;
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
  }

  50% {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.4);
  }
}

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

  100% {
    background-position: 200% 0;
  }
}

@keyframes textShimmer {
  0% {
    background-position: 200% center;
  }

  100% {
    background-position: -200% center;
  }
}

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

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes borderGlow {

  0%,
  100% {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
  }

  50% {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.15);
  }
}

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

  to {
    transform: rotate(360deg);
  }
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }

  50% {
    transform: translateY(-15%);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

@keyframes wiggle {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-3deg);
  }

  75% {
    transform: rotate(3deg);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.8;
  }

  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes morphBg {

  0%,
  100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }

  25% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }

  50% {
    border-radius: 50% 60% 30% 60% / 30% 40% 70% 50%;
  }

  75% {
    border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%;
  }
}

@keyframes glowPulse {

  0%,
  100% {
    filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.4));
  }

  50% {
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.8));
  }
}

@keyframes slideUpStagger {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes skeletonLoading {
  0% {
    background-position: -200px 0;
  }

  100% {
    background-position: calc(200px + 100%) 0;
  }
}

@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
  }

  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes scaleRotate {
  from {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

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

.animate-fade-in {
  animation: fadeIn 0.6s var(--ease-out) forwards;
}

.animate-slide-up {
  animation: slideUpFade 0.7s var(--ease-silk) forwards;
}

.animate-slide-down {
  animation: slideDownFade 0.7s var(--ease-silk) forwards;
}

.animate-slide-right {
  animation: slideInRight 0.7s var(--ease-silk) forwards;
}

.animate-slide-left {
  animation: slideInLeft 0.7s var(--ease-silk) forwards;
}

.animate-scale-in {
  animation: scaleIn 0.5s var(--ease-spring) forwards;
}

.animate-scale-up {
  animation: scaleUp 0.6s var(--ease-silk) forwards;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-soft {
  animation: floatSoft 8s ease-in-out infinite;
}

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

.animate-pulse-soft {
  animation: pulseSoft 3s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 2.5s ease-in-out infinite;
}

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-spin-slow {
  animation: spinSlow 3s linear infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-wiggle {
  animation: wiggle 0.5s ease-in-out;
}

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

.animate-morph {
  animation: morphBg 15s ease-in-out infinite;
}

/* Staggered Animation Delays */
.stagger-1 {
  animation-delay: 0.1s;
}

.stagger-2 {
  animation-delay: 0.2s;
}

.stagger-3 {
  animation-delay: 0.3s;
}

.stagger-4 {
  animation-delay: 0.4s;
}

.stagger-5 {
  animation-delay: 0.5s;
}

.stagger-6 {
  animation-delay: 0.6s;
}

/* Animation on View (starts hidden) */
.reveal {
  opacity: 0;
  transform: translateY(20px);
}

.reveal.visible {
  animation: slideUpFade 0.6s var(--ease-silk) forwards;
}

/* ===================================================================
   INTERACTIVE HOVER EFFECTS
   =================================================================== */

.hover-lift {
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-out);
}

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

.hover-lift:active {
  transform: translateY(-2px);
}

.hover-scale {
  transition: transform 0.3s var(--ease-spring);
}

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

.hover-scale:active {
  transform: scale(0.98);
}

.hover-glow {
  transition: box-shadow 0.4s var(--ease-out);
}

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

.hover-shine {
  position: relative;
  overflow: hidden;
}

.hover-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg,
      transparent 30%,
      rgba(255, 255, 255, 0.1) 50%,
      transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.hover-shine:hover::after {
  transform: translateX(100%);
}

.hover-rotate {
  transition: transform 0.4s var(--ease-spring);
}

.hover-rotate:hover {
  transform: rotate(5deg) scale(1.05);
}

.hover-border-glow {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hover-border-glow:hover {
  border-color: var(--primary-light);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.click-scale {
  transition: transform 0.1s ease;
}

.click-scale:active {
  transform: scale(0.96);
}

.click-ripple {
  position: relative;
  overflow: hidden;
}

/* ===================================================================
   GLASSMORPHISM UTILITIES
   =================================================================== */

.glass-panel {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: var(--glass-border);
  box-shadow: var(--shadow-lg), var(--glass-highlight);
}

.glass-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-soft);
  transition: all 0.4s var(--ease-silk);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-xl), var(--glow-primary);
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.8);
}

.glass-strong {
  background: var(--surface-glass-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: var(--glass-border-strong);
  box-shadow: var(--shadow-dreamy), var(--glass-highlight-strong);
}

.glass-frosted {
  background: var(--surface-frosted);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow-md);
}

.glass-dark {
  background: var(--surface-glass-dark);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-inverse);
}

/* ===================================================================
   SKELETON LOADING
   =================================================================== */

.skeleton {
  background: linear-gradient(90deg,
      var(--surface-100) 0px,
      var(--surface-50) 40px,
      var(--surface-100) 80px);
  background-size: 200px 100%;
  animation: skeletonLoading 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 1em;
  border-radius: var(--radius-xs);
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
}

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

/* ===================================================================
   CUSTOM SCROLLBAR
   =================================================================== */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--surface-100);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  border-radius: var(--radius-full);
  border: 2px solid var(--surface-100);
  transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-light) var(--surface-100);
}

/* ===================================================================
   FOCUS & ACCESSIBILITY
   =================================================================== */

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow-soft), var(--shadow-sm);
}

/* Skip to content for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: var(--space-2) var(--space-4);
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* ===================================================================
   BACKGROUND DECORATIONS
   =================================================================== */

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.bg-gradient-accent {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.bg-gradient-success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.bg-gradient-mesh {
  background:
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.08) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%);
}

.bg-dots {
  background-image: radial-gradient(circle, var(--surface-200) 1px, transparent 1px);
  background-size: 24px 24px;
}

.bg-grid {
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ===================================================================
   BADGE & STATUS UTILITIES  
   =================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25em 0.75em;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.badge-primary {
  background: var(--primary-glow-soft);
  color: var(--primary-dark);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-neutral {
  background: var(--surface-100);
  color: var(--text-muted);
}

/* ===================================================================
   REDUCED MOTION ACCESSIBILITY
   =================================================================== */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===================================================================
   SELECTION STYLING
   =================================================================== */

::selection {
  background: var(--primary-glow-soft);
  color: var(--primary-dark);
}

::-moz-selection {
  background: var(--primary-glow-soft);
  color: var(--primary-dark);
}