@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);
  --color-emerald: oklch(0.696 0.17 162.48);
  --color-risk-low: oklch(0.723 0.219 149.58);
  --color-risk-medium: oklch(0.795 0.184 86.05);
  --color-risk-high: oklch(0.704 0.191 22.216);
  --color-risk-critical: oklch(0.577 0.245 27.325);
}

:root {
  --radius: 0.625rem;
  /* Light theme - refined with emerald tint, no pure white */
  --background: oklch(0.97 0.008 155);
  --foreground: oklch(0.145 0.005 155);
  --card: oklch(0.975 0.01 155);
  --card-foreground: oklch(0.145 0.005 155);
  --popover: oklch(0.975 0.01 155);
  --popover-foreground: oklch(0.145 0.005 155);
  --primary: oklch(0.558 0.158 155);
  --primary-foreground: oklch(0.985 0.002 155);
  --secondary: oklch(0.94 0.02 155);
  --secondary-foreground: oklch(0.205 0.01 155);
  --muted: oklch(0.94 0.02 155);
  --muted-foreground: oklch(0.5 0.015 155);
  --accent: oklch(0.92 0.03 155);
  --accent-foreground: oklch(0.205 0.01 155);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.895 0.02 155);
  --input: oklch(0.895 0.02 155);
  --ring: oklch(0.558 0.158 155);
  --chart-1: oklch(0.558 0.158 155);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --sidebar: oklch(0.975 0.005 155);
  --sidebar-foreground: oklch(0.145 0.005 155);
  --sidebar-primary: oklch(0.558 0.158 155);
  --sidebar-primary-foreground: oklch(0.985 0.002 155);
  --sidebar-accent: oklch(0.935 0.025 155);
  --sidebar-accent-foreground: oklch(0.205 0.01 155);
  --sidebar-border: oklch(0.905 0.012 155);
  --sidebar-ring: oklch(0.558 0.158 155);
}

.dark {
  --background: oklch(0.1 0.015 155);
  --foreground: oklch(0.96 0.01 155);
  --card: oklch(0.14 0.02 155);
  --card-foreground: oklch(0.96 0.01 155);
  --popover: oklch(0.14 0.02 155);
  --popover-foreground: oklch(0.96 0.01 155);
  --primary: oklch(0.65 0.19 155);
  --primary-foreground: oklch(0.1 0.015 155);
  --secondary: oklch(0.18 0.02 155);
  --secondary-foreground: oklch(0.96 0.01 155);
  --muted: oklch(0.18 0.02 155);
  --muted-foreground: oklch(0.65 0.02 155);
  --accent: oklch(0.18 0.025 155);
  --accent-foreground: oklch(0.96 0.01 155);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(0.22 0.025 155);
  --input: oklch(0.22 0.025 155);
  --ring: oklch(0.65 0.19 155);
  --chart-1: oklch(0.65 0.19 155);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.12 0.02 155);
  --sidebar-foreground: oklch(0.96 0.01 155);
  --sidebar-primary: oklch(0.65 0.19 155);
  --sidebar-primary-foreground: oklch(0.1 0.015 155);
  --sidebar-accent: oklch(0.18 0.025 155);
  --sidebar-accent-foreground: oklch(0.96 0.01 155);
  --sidebar-border: oklch(0.22 0.025 155);
  --sidebar-ring: oklch(0.65 0.19 155);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: oklch(0.5 0.02 155);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: oklch(0.6 0.04 155);
}

/* Glassmorphism utility - Light mode */
.glass {
  background: oklch(0.975 0.01 155 / 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid oklch(0.85 0.025 155 / 0.6);
  box-shadow: 0 1px 3px oklch(0.558 0.158 155 / 0.06);
}

/* Glassmorphism utility - Dark mode */
.dark .glass {
  background: oklch(0.15 0.025 155 / 0.8);
  border: 1px solid oklch(0.25 0.04 155 / 0.5);
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.2);
}

/* Animated gradient background - Light mode */
.gradient-bg {
  background: linear-gradient(135deg, oklch(0.558 0.158 155 / 0.08) 0%, oklch(0.6 0.118 184.704 / 0.08) 50%, oklch(0.558 0.158 155 / 0.08) 100%);
}

/* Animated gradient background - Dark mode */
.dark .gradient-bg {
  background: linear-gradient(135deg, oklch(0.558 0.158 155 / 0.1) 0%, oklch(0.6 0.118 184.704 / 0.1) 50%, oklch(0.558 0.158 155 / 0.1) 100%);
}

/* Pulse animation for risk indicators */
@keyframes risk-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.risk-pulse {
  animation: risk-pulse 2s ease-in-out infinite;
}

/* Shield glow animation */
@keyframes shield-glow {
  0%, 100% { filter: drop-shadow(0 0 8px oklch(0.558 0.158 155 / 0.3)); }
  50% { filter: drop-shadow(0 0 20px oklch(0.558 0.158 155 / 0.6)); }
}
.shield-glow {
  animation: shield-glow 3s ease-in-out infinite;
}

/* Float animation for particles - CSS-only for performance */
@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.15; }
  50% { transform: translateY(-20px) translateX(8px); opacity: 0.5; }
}
.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* Slow pulse for gradient circles */
@keyframes pulse-slow {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.25; transform: scale(1.05); }
}
.animate-pulse-slow {
  animation: pulse-slow 8s ease-in-out infinite;
}

/* Grid pattern background - Light mode (more visible) */
.cyber-grid {
  background-image: 
    linear-gradient(oklch(0.558 0.158 155 / 0.04) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0.558 0.158 155 / 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Grid pattern background - Dark mode (more visible) */
.dark .cyber-grid {
  background-image: 
    linear-gradient(oklch(0.558 0.158 155 / 0.06) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0.558 0.158 155 / 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ─── Light-mode-specific enhancements ──────────────────────────────────────── */

/* Card hover shadow - more visible in light mode */
.glass:hover {
  box-shadow: 0 4px 16px oklch(0.558 0.158 155 / 0.12);
}
.dark .glass:hover {
  box-shadow: 0 4px 16px oklch(0.558 0.158 155 / 0.15);
}

/* Light mode badge/text contrast improvements */
:not(.dark) .bg-emerald-500\/10 {
  background-color: oklch(0.558 0.158 155 / 0.08);
}

/* Light mode section backgrounds - emerald tinted instead of gray */
:not(.dark) .bg-muted\/30 {
  background-color: oklch(0.94 0.02 155 / 0.6);
}

/* ─── Light mode card styling ─────────────────────────────────────────────── */

/* Trending alert cards in light mode - emerald tinted */
:not(.dark) .card-themed {
  background: linear-gradient(135deg, oklch(0.975 0.012 155), oklch(0.965 0.02 155));
  border-color: oklch(0.88 0.025 155);
}

/* Category cards in light mode */
:not(.dark) .card-category {
  background: linear-gradient(180deg, oklch(0.975 0.01 155), oklch(0.96 0.018 155));
}

/* Stat cards in light mode */
:not(.dark) .card-stat {
  background: linear-gradient(135deg, oklch(0.975 0.012 155), oklch(0.96 0.02 155));
}

/* Risk level cards in light mode */
:not(.dark) .card-risk {
  background: oklch(0.975 0.01 155);
}

/* Section alternating backgrounds in light mode */
:not(.dark) .section-alt {
  background: linear-gradient(180deg, oklch(0.955 0.015 155 / 0.5), oklch(0.94 0.025 155 / 0.5));
}

/* ─── Dark mode card styling ────────────────────────────────────────────── */

/* Trending alert cards in dark mode - deep emerald */
.dark .card-themed {
  background: linear-gradient(135deg, oklch(0.15 0.025 155), oklch(0.13 0.03 155));
  border-color: oklch(0.25 0.04 155);
}

/* Category cards in dark mode */
.dark .card-category {
  background: linear-gradient(180deg, oklch(0.14 0.025 155), oklch(0.12 0.03 155));
  border-color: oklch(0.22 0.035 155);
}

/* Stat cards in dark mode */
.dark .card-stat {
  background: linear-gradient(135deg, oklch(0.15 0.025 155), oklch(0.13 0.03 155));
}

/* Risk level cards in dark mode */
.dark .card-risk {
  background: oklch(0.14 0.025 155);
}

/* Section alternating backgrounds in dark mode - subtle emerald tint */
.dark .section-alt {
  background: linear-gradient(180deg, oklch(0.12 0.02 155 / 0.6), oklch(0.1 0.03 155 / 0.6));
}

/* Dark mode bg-muted/30 - deeper, more emerald */
.dark .bg-muted\/30 {
  background-color: oklch(0.13 0.025 155 / 0.5);
}

/* Subtle border enhancement in light mode for card separation */
:not(.dark) .border-border\/50 {
  border-color: oklch(0.89 0.012 155);
}

/* Dark mode border enhancement */
.dark .border-border\/50 {
  border-color: oklch(0.22 0.035 155);
}

/* ─── CSS animations (replacing framer-motion infinite repeats) ─────────────── */

/* Glow ring pulse animation */
@keyframes glow-ring-pulse {
  0% { box-shadow: 0 0 0 0 oklch(0.558 0.158 155 / 0.4); }
  100% { box-shadow: 0 0 0 20px oklch(0.558 0.158 155 / 0); }
}
.animate-glow-ring {
  animation: glow-ring-pulse 2s ease-out infinite;
}
.animate-glow-ring-delayed {
  animation: glow-ring-pulse 2s ease-out infinite 0.5s;
}

/* Dot pulse animation (for live indicators) */
@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
}
.animate-dot-pulse {
  animation: dot-pulse 2s ease-in-out infinite;
}

/* Bounce down animation (for scroll indicators) */
@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
.animate-bounce-down {
  animation: bounce-down 2s ease-in-out infinite;
}

/* Gentle scale pulse (for flame icons, badges) */
@keyframes gentle-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.animate-gentle-pulse {
  animation: gentle-pulse 1.5s ease-in-out infinite;
}

/* Badge scale pulse */
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.animate-badge-pulse {
  animation: badge-pulse 2s ease-in-out infinite;
}

/* Gentle rock animation (for CTA shield) */
@keyframes gentle-rock {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(5deg); }
  75% { transform: rotate(-5deg); }
}
.animate-gentle-rock {
  animation: gentle-rock 6s ease-in-out infinite;
}

/* ─── Entrance animations (replacing framer-motion) ─────────────────────────── */

/* Fade in up animation for section entries */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
  opacity: 0;
}

/* Fade in up animation (larger offset) */
@keyframes fadeInUpLarge {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up-lg {
  animation: fadeInUpLarge 0.6s ease-out forwards;
  opacity: 0;
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
  opacity: 0;
}

/* Scale in animation */
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
.animate-scale-in {
  animation: scaleIn 0.4s ease-out forwards;
  opacity: 0;
}

/* Fade in from left */
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
.animate-fade-in-left {
  animation: fadeInLeft 0.4s ease-out forwards;
  opacity: 0;
}

/* Stagger delay utilities */
.delay-0 { animation-delay: 0s; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* Width grow animation (for progress bars) */
@keyframes widthGrow {
  from { width: 0; }
}
.animate-width-grow {
  animation: widthGrow 1.2s ease-out 0.3s forwards;
  width: 0;
}

/* Icon hover wiggle (replaces whileHover rotate) */
.hover-wiggle:hover {
  animation: wiggle 0.5s ease-in-out;
}
@keyframes wiggle {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-10deg) scale(1.1); }
  50% { transform: rotate(10deg) scale(1.1); }
  75% { transform: rotate(-5deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}

/* Card hover lift (replaces whileHover y) */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px oklch(0.558 0.158 155 / 0.08);
}

/* CTA button hover/tap scale (replaces whileHover/whileTap) */
.hover-scale {
  transition: transform 0.15s ease;
}
.hover-scale:hover {
  transform: scale(1.03);
}
.hover-scale:active {
  transform: scale(0.98);
}
