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

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;

    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;

    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;

    --primary: 221 83% 53%;
    --primary-foreground: 210 40% 98%;
    --primary-glow: 221 100% 70%;

    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;

    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;

    --accent: 268 91% 67%;
    --accent-foreground: 210 40% 98%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;

    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222.2 84% 4.9%;

    /* Premium Design Tokens */
    --gradient-primary: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
    --gradient-subtle: linear-gradient(180deg, hsl(var(--background)), hsl(210 40% 98%));
    --gradient-hero: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary-glow)), hsl(var(--accent)));
    --shadow-elegant: 0 10px 30px -10px hsl(var(--primary) / 0.3);
    --shadow-glow: 0 0 40px hsl(var(--primary-glow) / 0.4);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);

    --radius: 0.5rem;

    --sidebar-background: 0 0% 98%;
    --sidebar-foreground: 240 5.3% 26.1%;
    --sidebar-primary: 240 5.9% 10%;
    --sidebar-primary-foreground: 0 0% 98%;
    --sidebar-accent: 240 4.8% 95.9%;
    --sidebar-accent-foreground: 240 5.9% 10%;
    --sidebar-border: 220 13% 91%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;

    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;

    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;

    --primary: 221 83% 53%;
    --primary-foreground: 222.2 47.4% 11.2%;
    --primary-glow: 221 100% 80%;

    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;

    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;

    --accent: 268 91% 67%;
    --accent-foreground: 210 40% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;

    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 212.7 26.8% 83.9%;
    
    /* Premium Dark Mode Tokens */
    --gradient-primary: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
    --gradient-subtle: linear-gradient(180deg, hsl(var(--background)), hsl(222 84% 6%));
    --gradient-hero: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary-glow)), hsl(var(--accent)));
    --shadow-elegant: 0 10px 30px -10px hsl(var(--primary) / 0.5);
    --shadow-glow: 0 0 40px hsl(var(--primary-glow) / 0.3);
    --glass-bg: rgba(20, 20, 40, 0.1);
    --glass-border: rgba(255, 255, 255, 0.05);
    
    --sidebar-background: 222.2 84% 4.9%;
    --sidebar-foreground: 210 40% 98%;
    --sidebar-primary: 224.3 76.3% 48%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 217.2 32.6% 17.5%;
    --sidebar-accent-foreground: 210 40% 98%;
    --sidebar-border: 217.2 32.6% 17.5%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }
}

@layer base {
  * {
    @apply border-border;
  }

  html {
    font-family: 'Inter', system-ui, sans-serif;
    scroll-behavior: smooth;
  }

  body {
    @apply bg-background text-foreground;
    font-feature-settings: "ss01", "ss02", "cv01", "cv02", "cv03";
  }
}

/* Enhanced Animation Keyframes */
@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-8px) rotate(1deg);
  }
  66% {
    transform: translateY(-12px) rotate(-1deg);
  }
}

@keyframes magnetic-hover {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.02);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes premium-glow {
  0%, 100% {
    box-shadow: 0 0 20px hsl(var(--primary) / 0.3), 0 0 40px hsl(var(--primary) / 0.1);
  }
  50% {
    box-shadow: 0 0 40px hsl(var(--primary) / 0.5), 0 0 80px hsl(var(--primary) / 0.2);
  }
}

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

@keyframes particle-float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.3;
  }
  25% {
    transform: translate(10px, -10px) rotate(90deg);
    opacity: 0.7;
  }
  50% {
    transform: translate(-5px, -20px) rotate(180deg);
    opacity: 1;
  }
  75% {
    transform: translate(-15px, -10px) rotate(270deg);
    opacity: 0.7;
  }
}

@keyframes float-delayed {
  0%, 100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  33% {
    transform: translateY(-15px) rotate(2deg) scale(1.05);
  }
  66% {
    transform: translateY(-10px) rotate(-2deg) scale(0.95);
  }
}

@keyframes morphing-gradient {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes data-flow {
  0% {
    transform: translateX(-100%) translateY(0);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(100vw) translateY(-20px);
    opacity: 0;
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes shimmer-sweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

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

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

@keyframes slide-up-fade {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Financial & Tech-Themed 3D Animations */
@keyframes financial-float {
  0%, 100% { 
    transform: translateY(0px) rotateY(0deg) scale(1); 
  }
  50% { 
    transform: translateY(-15px) rotateY(180deg) scale(1.05); 
  }
}

@keyframes data-pulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }
  50% { 
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
}

@keyframes network-connection {
  0% { 
    stroke-dasharray: 0, 100;
    opacity: 0.3;
  }
  50% { 
    stroke-dasharray: 50, 100;
    opacity: 0.8;
  }
  100% { 
    stroke-dasharray: 100, 100;
    opacity: 0.3;
  }
}

@keyframes currency-spin {
  0% { transform: rotateY(0deg) rotateX(0deg); }
  25% { transform: rotateY(90deg) rotateX(5deg); }
  50% { transform: rotateY(180deg) rotateX(0deg); }
  75% { transform: rotateY(270deg) rotateX(-5deg); }
  100% { transform: rotateY(360deg) rotateX(0deg); }
}

@keyframes slide-in-3d {
  0% {
    transform: translate3d(-100%, 0, -100px) rotateY(-90deg);
    opacity: 0;
  }
  100% {
    transform: translate3d(0, 0, 0) rotateY(0deg);
    opacity: 1;
  }
}

@keyframes card-flip {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg) scale(1.1); }
  100% { transform: rotateY(360deg); }
}

@keyframes levitate {
  0%, 100% {
    transform: translateY(0px) rotateX(0deg) rotateZ(0deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }
  50% {
    transform: translateY(-20px) rotateX(5deg) rotateZ(2deg);
    box-shadow: 0 25px 35px rgba(0, 0, 0, 0.2);
  }
}

@keyframes matrix-rain {
  0% {
    transform: translateY(-100vh) rotateZ(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotateZ(360deg);
    opacity: 0;
  }
}

/* Updated Financial Animation Classes */
.animate-financial-float {
  animation: financial-float 4s ease-in-out infinite;
}

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

.animate-network-connection {
  animation: network-connection 3s ease-in-out infinite;
}

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

/* Animation Classes */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

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

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

.animate-data-flow {
  animation: data-flow 3s linear infinite;
}

.animate-pulse-ring {
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

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

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

.animate-slide-up-fade {
  animation: slide-up-fade 0.6s ease-out forwards;
}

.animate-scale-fade-in {
  animation: scale-fade-in 0.5s ease-out forwards;
}

.animate-magnetic-hover {
  animation: magnetic-hover 0.3s ease-in-out;
}

.animate-premium-glow {
  animation: premium-glow 3s ease-in-out infinite;
}

.animate-text-shimmer {
  background: linear-gradient(
    90deg,
    hsl(var(--foreground)),
    hsl(var(--primary)),
    hsl(var(--accent)),
    hsl(var(--foreground))
  );
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-shimmer 3s linear infinite;
}

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

/* 3D Animation Classes */
.animate-float-3d {
  animation: float-3d 6s ease-in-out infinite;
}

.animate-pulse-3d {
  animation: pulse-3d 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-rotate-3d {
  animation: rotate-3d 8s linear infinite;
}

.animate-bounce-3d {
  animation: bounce-3d 2s infinite;
}

.animate-slide-in-3d {
  animation: slide-in-3d 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-card-flip {
  animation: card-flip 3s ease-in-out infinite;
}

.animate-levitate {
  animation: levitate 4s ease-in-out infinite;
}

.animate-matrix-rain {
  animation: matrix-rain 3s linear infinite;
}

/* Perspective and 3D Transform Utilities */
.perspective-1000 {
  perspective: 1000px;
}

.perspective-2000 {
  perspective: 2000px;
}

.transform-style-3d {
  transform-style: preserve-3d;
}

.backface-hidden {
  backface-visibility: hidden;
}

/* Enhanced Visual Effects */
.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-elegant);
}

.dark .glass-effect {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-elegant);
}

.premium-card {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1), 
    rgba(255, 255, 255, 0.05)
  );
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.premium-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 0 40px hsl(var(--primary) / 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dark .premium-card {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.05), 
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dark .premium-card:hover {
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 40px hsl(var(--primary) / 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.hero-text-glow {
  text-shadow: 
    0 0 20px hsl(var(--primary) / 0.5),
    0 0 40px hsl(var(--primary) / 0.3),
    0 0 60px hsl(var(--primary) / 0.1);
}

.premium-gradient-text {
  background: var(--gradient-hero);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradient-rotate 4s ease infinite;
}

.morphing-border {
  background: linear-gradient(45deg, #3B82F6, #8B5CF6, #06B6D4, #10B981);
  background-size: 400% 400%;
  animation: morphing-gradient 4s ease infinite;
}

.shimmer-effect {
  position: relative;
  overflow: hidden;
}

.shimmer-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer-sweep 2s ease-in-out infinite;
}

.dark .shimmer-effect::before {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
}

/* 3D Card Effects */
.card-3d {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.3s ease;
}

.card-3d:hover {
  transform: rotateX(5deg) rotateY(5deg) translateZ(10px);
}

.card-3d-content {
  transform: translateZ(20px);
}

/* Interactive Hover Effects */
.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.dark .hover-glow:hover {
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

.hover-scale {
  transition: transform 0.2s ease;
}

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

/* Background Patterns */
.pattern-grid {
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.pattern-dots {
  background-image: radial-gradient(rgba(59, 130, 246, 0.3) 1px, transparent 1px);
  background-size: 20px 20px;
}

.dark .pattern-dots {
  background-image: radial-gradient(rgba(59, 130, 246, 0.2) 1px, transparent 1px);
}

/* Gradient Text Effects */
.gradient-text {
  background: linear-gradient(135deg, #3B82F6, #8B5CF6, #06B6D4);
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-rotate 3s ease infinite;
}

/* Enhanced Button Effects */
.button-gradient {
  background: var(--gradient-primary);
  background-size: 200% 200%;
  animation: gradient-rotate 3s ease infinite;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-elegant);
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.button-gradient:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.button-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.button-gradient:hover::before {
  left: 100%;
}

.premium-button {
  background: var(--gradient-primary);
  border: none;
  box-shadow: 
    0 4px 15px hsl(var(--primary) / 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
}

.premium-button:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 8px 25px hsl(var(--primary) / 0.4),
    0 0 30px hsl(var(--primary) / 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.premium-button::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.premium-button:hover::after {
  left: 100%;
}

/* Loading and Skeleton Effects */
.skeleton-loading {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.1)
  );
  background-size: 200px 100%;
  animation: shimmer-sweep 1.5s ease-in-out infinite;
}

.dark .skeleton-loading {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.15),
    rgba(255, 255, 255, 0.05)
  );
}

/* Enhanced Dashboard Elements */
.dashboard-card {
  @apply bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700 transition-all duration-300;
}

.dashboard-card:hover {
  @apply shadow-lg transform -translate-y-1;
}

.stat-card {
  @apply dashboard-card p-6 hover:shadow-xl;
}

.stat-card-icon {
  @apply p-3 rounded-xl bg-gradient-to-br from-blue-500 to-purple-500 text-white mb-4 inline-flex;
}

/* Performance Optimizations */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .card-3d:hover {
    transform: none;
  }
  
  .hover-lift:hover {
    transform: translateY(-4px) scale(1.01);
  }
}

/* Focus and Accessibility */
.focus-ring {
  @apply focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  @apply bg-gray-100 dark:bg-gray-800;
}

::-webkit-scrollbar-thumb {
  @apply bg-gray-400 dark:bg-gray-600 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
  @apply bg-gray-500 dark:bg-gray-500;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .glass-effect {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #000;
  }
  
  .dark .glass-effect {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #fff;
  }
}
