@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0); /* Pure white */
  --foreground: oklch(0 0 0); /* Pure black */
  --card: oklch(1 0 0); /* Pure white */
  --card-foreground: oklch(0 0 0); /* Pure black */
  --popover: oklch(1 0 0); /* Pure white */
  --popover-foreground: oklch(0 0 0); /* Pure black */
  --primary: oklch(0 0 0); /* Pure black */
  --primary-foreground: oklch(1 0 0); /* Pure white */
  --secondary: oklch(0.95 0 0); /* Light gray */
  --secondary-foreground: oklch(0 0 0); /* Pure black */
  --muted: oklch(0.95 0 0); /* Light gray */
  --muted-foreground: oklch(0.3 0 0); /* Dark gray */
  --accent: oklch(0 0 0); /* Pure black */
  --accent-foreground: oklch(1 0 0); /* Pure white */
  --destructive: oklch(0 0 0); /* Pure black */
  --border: oklch(0.8 0 0); /* Medium gray */
  --input: oklch(0.9 0 0); /* Light gray */
  --ring: oklch(0.5 0 0); /* Medium gray */
  --chart-1: oklch(0 0 0); /* Pure black */
  --chart-2: oklch(0.2 0 0); /* Dark gray */
  --chart-3: oklch(0.4 0 0); /* Medium gray */
  --chart-4: oklch(0.6 0 0); /* Light gray */
  --chart-5: oklch(0.8 0 0); /* Very light gray */
  --sidebar: oklch(1 0 0); /* Pure white */
  --sidebar-foreground: oklch(0 0 0); /* Pure black */
  --sidebar-primary: oklch(0 0 0); /* Pure black */
  --sidebar-primary-foreground: oklch(1 0 0); /* Pure white */
  --sidebar-accent: oklch(0.95 0 0); /* Light gray */
  --sidebar-accent-foreground: oklch(0 0 0); /* Pure black */
  --sidebar-border: oklch(0.8 0 0); /* Medium gray */
  --sidebar-ring: oklch(0.5 0 0); /* Medium gray */
}

.dark {
  --background: oklch(0 0 0); /* Pure black */
  --foreground: oklch(1 0 0); /* Pure white */
  --card: oklch(0.1 0 0); /* Nearly black */
  --card-foreground: oklch(1 0 0); /* Pure white */
  --popover: oklch(0.1 0 0); /* Nearly black */
  --popover-foreground: oklch(1 0 0); /* Pure white */
  --primary: oklch(1 0 0); /* Pure white */
  --primary-foreground: oklch(0 0 0); /* Pure black */
  --secondary: oklch(0.2 0 0); /* Very dark gray */
  --secondary-foreground: oklch(1 0 0); /* Pure white */
  --muted: oklch(0.2 0 0); /* Very dark gray */
  --muted-foreground: oklch(0.7 0 0); /* Light gray */
  --accent: oklch(1 0 0); /* Pure white */
  --accent-foreground: oklch(0 0 0); /* Pure black */
  --destructive: oklch(1 0 0); /* Pure white */
  --border: oklch(0.3 0 0); /* Dark gray */
  --input: oklch(0.2 0 0); /* Very dark gray */
  --ring: oklch(0.5 0 0); /* Medium gray */
  --chart-1: oklch(1 0 0); /* Pure white */
  --chart-2: oklch(0.8 0 0); /* Light gray */
  --chart-3: oklch(0.6 0 0); /* Medium gray */
  --chart-4: oklch(0.4 0 0); /* Dark gray */
  --chart-5: oklch(0.2 0 0); /* Very dark gray */
  --sidebar: oklch(0.1 0 0); /* Nearly black */
  --sidebar-foreground: oklch(1 0 0); /* Pure white */
  --sidebar-primary: oklch(1 0 0); /* Pure white */
  --sidebar-primary-foreground: oklch(0 0 0); /* Pure black */
  --sidebar-accent: oklch(0.2 0 0); /* Very dark gray */
  --sidebar-accent-foreground: oklch(1 0 0); /* Pure white */
  --sidebar-border: oklch(0.3 0 0); /* Dark gray */
  --sidebar-ring: oklch(0.5 0 0); /* Medium gray */
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
    background-attachment: fixed;
  }
  
  body:not(.dark) {
    background-image: 
      radial-gradient(circle at 15% 15%, color-mix(in oklch, oklch(0.9 0 0), transparent 94%) 0%, transparent 35%),
      radial-gradient(circle at 85% 85%, color-mix(in oklch, oklch(0.9 0 0), transparent 94%) 0%, transparent 35%),
      linear-gradient(120deg, color-mix(in oklch, var(--background), oklch(0.95 0 0) 5%) 0%, var(--background) 100%);
    background-size: 100% 100%;
    position: relative;
  }
  
  /* Grid pattern for light mode */
  body:not(.dark)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
      linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: -1;
    pointer-events: none;
  }
  
  /* Dark mode background gradients removed to make grid visible */
  
  /* Grid pattern for dark mode */
  html.dark body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
      linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: -1;
    pointer-events: none;
  }
  
  /* Floating orbs removed to make grid more visible */
}

/* Custom animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

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

@keyframes scaleIn {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes pulse-subtle {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.1); }
  100% { filter: brightness(1); }
}

@keyframes spin-slow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

@keyframes floatingOrbs {
  0% { background-position: 0% 0%; }
  25% { background-position: 5% 5%; }
  50% { background-position: 0% 10%; }
  75% { background-position: -5% 5%; }
  100% { background-position: 0% 0%; }
}

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

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

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

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

.animate-scaleIn {
  animation: scaleIn 0.3s ease-out forwards;
  transform-origin: center;
}

.animate-pulse-subtle {
  animation: pulse-subtle 3s infinite;
}

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

.animate-tabChange {
  animation: tabFadeIn 0.3s ease-out forwards;
}

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

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

/* Page transition effects */
.page-transition-enter {
  opacity: 0;
  transform: translateY(10px);
}

.page-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s, transform 0.3s;
}

/* Card hover effects */
.hover-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.hover-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Light mode card styling */
body:not(.dark) .bg-card\/50,
body:not(.dark) .hover-card {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.02);
}

body:not(.dark) .hover-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
  background: rgba(255, 255, 255, 0.8);
}

body:not(.dark) .hover-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  opacity: 0.7;
}

body:not(.dark) .hover-card:hover::before {
  transform: scaleX(1);
}

/* Light mode header improvements */
body:not(.dark) .sticky.backdrop-blur-md.bg-background\/80 {
  background-color: rgba(255, 255, 255, 0.8);
  border-bottom-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* Light mode border improvements */
body:not(.dark) .border {
  border-color: rgba(0, 0, 0, 0.1);
}

body:not(.dark) .border-border {
  border-color: rgba(0, 0, 0, 0.08);
}

body:not(.dark) .border-t {
  border-top-color: rgba(0, 0, 0, 0.06);
}

body:not(.dark) .border-b {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* Light mode footer improvements */
body:not(.dark) footer {
  background-color: rgba(133, 133, 141, 0.2);
  border-top: none;
}

/* Dark mode card styling */
body.dark .bg-card\/50,
body.dark .hover-card {
  background: rgba(23, 23, 23, 0.7); /* Match the updated --card color */
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

body.dark .hover-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
  background: rgba(23, 23, 23, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark .hover-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  opacity: 0.8;
}

body.dark .hover-card:hover::before {
  transform: scaleX(1);
}

/* Dark mode header improvements */
body.dark .sticky.backdrop-blur-md.bg-background\/80 {
  background-color: rgba(18, 18, 18, 0.8); /* Match the updated --background color */
  border-bottom-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Dark mode footer improvements */
body.dark footer {
  background-color: rgba(133, 133, 141, 0.2);
  border-top: none;
}

/* Gradient text effect */
.gradient-text {
  background: linear-gradient(90deg, oklch(0 0 0) 0%, oklch(0.3 0 0) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Dark mode specific UI improvements */
body.dark .bg-primary {
  background: linear-gradient(135deg, var(--primary), color-mix(in oklch, var(--primary), oklch(0.7 0 0) 40%));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark .bg-secondary {
  background-color: rgba(34, 34, 34, 0.8); /* Match the updated --secondary color */
}

body.dark .bg-secondary\/50 {
  background-color: rgba(34, 34, 34, 0.5);
}

body.dark .bg-muted {
  background-color: rgba(34, 34, 34, 0.8);
}

body.dark .bg-muted\/50 {
  background-color: rgba(34, 34, 34, 0.5);
}

body.dark .bg-card\/30 {
  background-color: rgba(23, 23, 23, 0.3);
  border-color: rgba(255, 255, 255, 0.05);
}

/* Improve button hover states in dark mode */
body.dark button:not([disabled]):hover.bg-primary {
  filter: brightness(1.1);
}

body.dark button:not([disabled]):active.bg-primary {
  filter: brightness(0.9);
}

/* Dark mode position health card special styling - this is the gray card from the screenshot */
body.dark .position-health-card {
  background: rgba(30, 30, 35, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Dark mode specific class for the Liquidation section cards */
body.dark .dark-card {
  background: #181820;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.dark .dark-preview-card {
  background: #2a2a32;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Dark mode gauge improvements */
body.dark .bg-secondary\/30 {
  background-color: rgba(30, 30, 35, 0.7);
}

body.dark .bg-white\/20 {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.3));
}

body:not(.dark) .gradient-text {
  background: linear-gradient(90deg, oklch(0 0 0) 0%, oklch(0.3 0 0) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.05);
}
