@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');
@import "tailwindcss";

@theme {
  /* Priority Tracker Brand Colors */
  --color-primary-50: #f0fdf4;
  --color-primary-100: #dcfce7;
  --color-primary-200: #bbf7d0;
  --color-primary-300: #86efac;
  --color-primary-400: #4ade80;
  --color-primary-500: #22c55e;
  --color-primary-600: #16a34a;
  --color-primary-700: #15803d;
  --color-primary-800: #166534;
  --color-primary-900: #14532d;

  --color-accent-50: #fdf4ff;
  --color-accent-100: #fae8ff;
  --color-accent-200: #f5d0fe;
  --color-accent-300: #f0abfc;
  --color-accent-400: #e879f9;
  --color-accent-500: #d946ef;
  --color-accent-600: #c026d3;
  --color-accent-700: #a21caf;
  --color-accent-800: #86198f;
  --color-accent-900: #701a75;

  --color-surface-50: #fafafa;
  --color-surface-100: #f4f4f5;
  --color-surface-200: #e4e4e7;
  --color-surface-300: #d4d4d8;
  --color-surface-400: #a1a1aa;
  --color-surface-500: #71717a;
  --color-surface-600: #52525b;
  --color-surface-700: #3f3f46;
  --color-surface-800: #27272a;
  --color-surface-900: #18181b;
  --color-surface-950: #09090b;

  /* Priority colors */
  --color-p0: #ef4444;
  --color-p1: #f59e0b;
  --color-p2: #3b82f6;
  --color-p3: #6b7280;

  --font-sans: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;

  /* Glassmorphism tokens */
  --glass-bg: rgba(24, 24, 27, 0.4);
  --glass-bg-light: rgba(39, 39, 42, 0.3);
  --glass-border: rgba(63, 63, 70, 0.5);
  --glass-highlight: rgba(255, 255, 255, 0.05);
}

@layer base {
  body {
    background-color: var(--color-surface-950);
    color: var(--color-surface-100);
    font-family: var(--font-sans);
    background-image:
      radial-gradient(ellipse at top left, rgba(34, 197, 94, 0.12) 0%, transparent 50%),
      radial-gradient(ellipse at bottom right, rgba(217, 70, 239, 0.08) 0%, transparent 50%),
      radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 40%);
    min-height: 100vh;
  }
}

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

::-webkit-scrollbar-track {
  background-color: rgba(39, 39, 42, 0.5);
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-surface-600);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-surface-500);
}

/* Glassmorphism utilities */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 var(--glass-highlight);
}

.glass-light {
  background: var(--glass-bg-light);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 2px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 var(--glass-highlight);
}

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

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

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

@keyframes pulse-glow {
  0%, 100% { 
    box-shadow: 0 0 5px currentColor;
    opacity: 1;
  }
  50% { 
    box-shadow: 0 0 20px currentColor;
    opacity: 0.8;
  }
}

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

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

.animate-slide-up {
  animation: slideUp 0.4s ease-out forwards;
  opacity: 0;
}

.animate-slide-in-left {
  animation: slideInLeft 0.3s ease-out forwards;
  opacity: 0;
}

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

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }

/* Task card styling */
.task-card {
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.task-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, transparent 60%);
}

.task-card:hover::before {
  opacity: 1;
}

.task-card:hover {
  transform: translateX(4px);
}

/* Priority badge glow */
.priority-badge-p0 {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.priority-badge-p1 {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.priority-badge-p2 {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.priority-badge-p3 {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  box-shadow: 0 0 8px rgba(107, 114, 128, 0.2);
}

/* Status indicator dots */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
}

.status-dot.not_started { background-color: #6b7280; }
.status-dot.in_progress { 
  background-color: #22c55e; 
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}
.status-dot.complete { background-color: #3b82f6; }
.status-dot.blocked { 
  background-color: #ef4444;
  animation: pulse-glow 2s ease-in-out infinite;
}
.status-dot.waiting { 
  background-color: #f59e0b; 
  animation: pulse-glow 3s ease-in-out infinite;
}

/* Heap visualization */
.heap-node {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.heap-node:hover {
  transform: scale(1.05);
  z-index: 10;
}

.heap-connection {
  stroke: var(--color-surface-600);
  stroke-width: 2;
  fill: none;
}

/* Slider styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-track {
  height: 6px;
  background: var(--color-surface-700);
  border-radius: 9999px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
  border-radius: 50%;
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

input[type="range"]:focus {
  outline: none;
}

/* Shimmer loading effect */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--color-surface-800) 0%,
    var(--color-surface-700) 50%,
    var(--color-surface-800) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
