@import "tailwindcss";

:root {
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --accent-foreground: #ffffff;

  --purple-glow: rgba(168, 85, 247, 1);
  --cyan-glow: rgba(34, 211, 238, 1);
  --cyan-soft: #06b6d4;
  --arc-blue-soft: #60a5fa;

  /* Default theme is dark */
  --bg-primary: #0A0A0F;
  --bg-surface: #12121A;
  --text-primary: #FFFFFF;
  --text-secondary: #A0AEC0;
  --text-muted: #718096;
  --border: #1A1A26;
  --accent-purple: #7C3AED;
  --accent-blue: #3B82F6;

  --background: var(--bg-primary);
  --foreground: var(--text-primary);
  --card: var(--bg-surface);
  --card-border: var(--border);
  --muted: var(--text-muted);
  --accent: var(--accent-purple);
  --surface: var(--bg-surface);
  --surface-elevated: rgba(20, 20, 32, 0.6);
  
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-thin: var(--border);
  
  --text-tertiary: var(--text-muted);

  --purple-deep: var(--accent-purple);
  --arc-blue: var(--accent-blue);

  --glow-purple: rgba(168, 85, 247, 0.15);
  --glow-blue: rgba(59, 130, 246, 0.08);
}

.dark {
  --bg-primary: #0A0A0F;
  --bg-surface: #12121A;
  --text-primary: #FFFFFF;
  --text-secondary: #A0AEC0;
  --text-muted: #718096;
  --border: #1A1A26;
  --accent-purple: #7C3AED;
  --accent-blue: #3B82F6;

  --background: var(--bg-primary);
  --foreground: var(--text-primary);
  --card: var(--bg-surface);
  --card-border: var(--border);
  --muted: var(--text-muted);
  --accent: var(--accent-purple);
  --surface: var(--bg-surface);
  --surface-elevated: rgba(20, 20, 32, 0.6);
  
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-thin: var(--border);
  
  --text-tertiary: var(--text-muted);

  --purple-deep: var(--accent-purple);
  --arc-blue: var(--accent-blue);

  --glow-purple: rgba(168, 85, 247, 0.15);
  --glow-blue: rgba(59, 130, 246, 0.08);
}

.light {
  --bg-primary: #F4F6FA;
  --bg-surface: #FFFFFF;
  --text-primary: #0B0B16;
  --text-secondary: #2D3748;
  --text-muted: #4A5568;
  --border: #E2E8F0;
  --accent-purple: #7C3AED;
  --accent-blue: #2563EB;
  
  --background: var(--bg-primary);
  --foreground: var(--text-primary);
  --card: var(--bg-surface);
  --card-border: var(--border);
  --muted: var(--text-muted);
  --accent: var(--accent-purple);
  --surface: var(--bg-surface);
  --surface-elevated: rgba(255, 255, 255, 0.85);
  
  --border-subtle: var(--border);
  --border-thin: var(--border);
  
  --text-tertiary: var(--text-muted);

  --purple-deep: var(--accent-purple);
  --arc-blue: var(--accent-blue);

  --glow-purple: rgba(124, 58, 237, 0.03);
  --glow-blue: rgba(37, 99, 235, 0.02);
}

@theme {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-border: var(--card-border);
  --color-muted: var(--muted);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-success: var(--success);
  --color-warning: var(--warning);
  --color-danger: var(--danger);
  --color-glass: var(--glass);
  --color-glass-border: var(--glass-border);

  /* Premium Design System — SynArc */
  --color-purple-glow: var(--purple-glow);
  --color-purple-deep: var(--purple-deep);
  --color-cyan-glow: var(--cyan-glow);
  --color-cyan-soft: var(--cyan-soft);
  --color-arc-blue: var(--accent-blue);
  --color-arc-blue-soft: var(--arc-blue-soft);
  --color-surface: var(--surface);
  --color-surface-elevated: var(--surface-elevated);
  --color-border-subtle: var(--border-subtle);
  --color-border-thin: var(--border-thin);
  
  /* Semantic Variables from tailwind.config mapping */
  --color-background-primary: var(--bg-primary);
  --color-background-surface: var(--bg-surface);
  --color-text-primary: var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-text-muted: var(--text-muted);
  --color-border: var(--border);
  --color-accent-purple: var(--accent-purple);
  --color-accent-blue: var(--accent-blue);
  
  /* Legacy alias compatibility */
  --color-text-tertiary: var(--text-tertiary);
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-inter), ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-sora), ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
}

.font-body {
  font-family: var(--font-inter), ui-sans-serif, system-ui, sans-serif;
}

/* ── Glassmorphism Utilities ── */
.glass {
  background: var(--color-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--color-glass-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(124, 58, 237, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}


/* De-intensify home screen lighting effects in light mode */
.light .hero-glow-effect {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, rgba(255, 255, 255, 0) 70%) !important;
  mix-blend-mode: multiply;
}

.glass-surface {
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.dark .glass-surface {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
}

.light .glass-surface {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
}

.glass-elevated {
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}

.dark .glass-elevated {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border-thin);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

.light .glass-elevated {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

/* ── Gradient Text ── */
.gradient-text {
  background: linear-gradient(135deg, #7C3AED 0%, #3B82F6 50%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-subtle {
  background: linear-gradient(135deg, #c084fc 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-border {
  border: 1px solid transparent;
  background: 
    linear-gradient(#0A0A0F, #0A0A0F) padding-box,
    linear-gradient(135deg, #7C3AED, #3B82F6) border-box;
}

.gradient-glow {
  box-shadow: 
    0 0 40px rgba(124, 58, 237, 0.15),
    0 0 80px rgba(59, 130, 246, 0.08);
}


/* ── Glow Effects ── */
.glow-purple {
  box-shadow: 0 0 40px -10px rgba(168, 85, 247, 0.4),
    0 0 80px -20px rgba(168, 85, 247, 0.2);
}

.glow-cyan {
  box-shadow: 0 0 40px -10px rgba(34, 211, 238, 0.4),
    0 0 80px -20px rgba(34, 211, 238, 0.2);
}

.glow-ambient {
  box-shadow: 0 0 120px -40px rgba(168, 85, 247, 0.15),
    0 0 80px -30px rgba(34, 211, 238, 0.1);
}

.text-glow-purple {
  text-shadow: 0 0 20px rgba(168, 85, 247, 0.5),
    0 0 40px rgba(168, 85, 247, 0.3);
}

.text-glow-cyan {
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.5),
    0 0 40px rgba(34, 211, 238, 0.3);
}

/* ── Grid Overlay ── */
.grid-overlay {
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    black 0%,
    transparent 70%
  );
}

.dark .grid-overlay {
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

.light .grid-overlay {
  background-image: linear-gradient(
      rgba(0, 0, 0, 0.02) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
}

/* ── Animated Underline ── */
.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, #a855f7, #22d3ee);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.link-underline:hover::after {
  width: 100%;
}

/* ── Shimmer Animation ── */
.animate-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.04) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

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

/* ── Pulse Glow ── */
@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

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

/* ── Fade In Up ── */
@keyframes fade-in-up {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.5);
}

/* ── Selection ── */
::selection {
  background: rgba(168, 85, 247, 0.3);
  color: #f1f5f9;
}

/* ── Recharts Theme Adapters ── */
.recharts-default-tooltip {
  border-radius: 12px !important;
  font-size: 13px !important;
  padding: 8px 12px !important;
}

.dark .recharts-default-tooltip {
  background-color: #111118 !important;
  border: 1px solid #1F2937 !important;
  color: #FFFFFF !important;
}

.dark .recharts-tooltip-item,
.dark .recharts-default-tooltip span {
  color: #9CA3AF !important;
}

.dark .recharts-cartesian-grid-horizontal line,
.dark .recharts-cartesian-grid-vertical line {
  stroke: #1F2937 !important;
  stroke-opacity: 0.8 !important;
}

.dark .recharts-cartesian-axis-line {
  stroke: #1F2937 !important;
}

.dark .recharts-cartesian-axis-tick-value,
.dark .recharts-text {
  fill: #9CA3AF !important;
  color: #9CA3AF !important;
}

.light .recharts-default-tooltip {
  background-color: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  color: #0A0A1A !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05) !important;
}

.light .recharts-tooltip-item,
.light .recharts-default-tooltip span {
  color: #374151 !important;
}

.light .recharts-cartesian-grid-horizontal line,
.light .recharts-cartesian-grid-vertical line {
  stroke: #E5E7EB !important;
  stroke-opacity: 0.8 !important;
}

.light .recharts-cartesian-axis-line {
  stroke: #E5E7EB !important;
}

.light .recharts-cartesian-axis-tick-value,
.light .recharts-text {
  fill: #374151 !important;
  color: #374151 !important;
}

/* ── Light Mode Overrides (SynArc Premium) ── */

/* Glass cards override */
.light .glass-card {
  background: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* Diagnostics log terminal box override */
.light .diagnostics-log {
  background: #F3F4F6 !important;
  color: #111827 !important;
  border: 1px solid #E5E7EB !important;
}

/* Global text contrast fix: maps hardcoded text-white to readable dark gray/black,
   excluding elements on purple/accent/dark banners, gradients, and custom keeping rules. */
.light .text-white:not(.bg-primary):not(.bg-accent):not(.bg-danger):not(.bg-success):not(.bg-purple-deep):not([class*="bg-gradient"]):not(a.bg-primary):not(.text-white-keep) {
  color: var(--text-primary) !important;
}

/* Map hardcoded dark-mode translucencies to light mode alternatives */
.light .bg-white\/5,
.light .bg-white\/10,
.light .bg-white\/20 {
  background-color: rgba(0, 0, 0, 0.05) !important;
}
.light .bg-white\/\[0\.01\] {
  background-color: rgba(0, 0, 0, 0.01) !important;
}
.light .bg-white\/\[0\.03\] {
  background-color: rgba(0, 0, 0, 0.03) !important;
}
.light .bg-white\/\[0\.05\] {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

/* Resolve text purple-300 / purple-400 / emerald-400 contrast in light mode */
.light .text-purple-300 {
  color: var(--accent-purple) !important;
}
.light .text-purple-400 {
  color: var(--accent-purple) !important;
}
.light .text-emerald-400 {
  color: var(--success) !important;
}

/* Make card borders fully visible in light mode */
.light .border-white\/10 {
  border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Override glass header navigation wrapper to keep links visible */
.light .glass {
  background: rgba(255, 255, 255, 0.8) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}


