/* LocalDiff.dev - Modern Design System */
/* Custom CSS: glassmorphism, animations, and design tokens */

/* ─── CSS Variables ──────────────────────────────────────────────── */
:root {
  --brand-primary: #3b82f6;
  --brand-secondary: #10b981;
  --brand-accent: #8b5cf6;

  /* Glass effects */
  --glass-blur: 12px;
  --glass-light: rgba(255, 255, 255, 0.72);
  --glass-dark: rgba(15, 23, 42, 0.82);

  /* Glass (semantic names used by .glass-panel/.glass-button) */
  --glass-bg-light: rgba(255, 255, 255, 0.7);
  --glass-border-light: rgba(255, 255, 255, 0.2);
  --glass-shadow-light: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  --glass-bg-dark: rgba(15, 23, 42, 0.8);
  --glass-border-dark: rgba(255, 255, 255, 0.1);
  --glass-shadow-dark: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

  /* Shadows */
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.35);
  --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.35);
  --shadow-glow-purple: 0 0 20px rgba(139, 92, 246, 0.25);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.12);
  --shadow-card-dark: 0 4px 32px rgba(0, 0, 0, 0.5);

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  --gradient-aurora: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #3b82f6 100%);

  /* Timing */
  --duration-fast: 0.15s;
  --duration-base: 0.3s;
  --duration-slow: 0.5s;
}

/* ─── Global Base ────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

::selection { background: #3b82f6; color: white; }

/* ─── Glassmorphism Classes ──────────────────────────────────────── */
.glass {
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  background: var(--glass-light);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.dark .glass {
  background: var(--glass-dark);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-header {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-panel {
  background: var(--glass-bg-light);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border-light);
  box-shadow: var(--glass-shadow-light);
  border-radius: 0.75rem;
}

.dark .glass-panel {
  background: var(--glass-bg-dark);
  border-color: var(--glass-border-dark);
  box-shadow: var(--glass-shadow-dark);
}

/* ─── Gradient Text ──────────────────────────────────────────────── */
.gradient-brand {
  background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-aurora, .gradient-text {
  background: var(--gradient-aurora);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Glow Effects ───────────────────────────────────────────────── */
.glow-blue   { box-shadow: var(--shadow-glow-blue); }
.glow-green  { box-shadow: var(--shadow-glow-green); }
.glow-purple { box-shadow: var(--shadow-glow-purple); }

/* ─── Animated Gradient Button ───────────────────────────────────── */
.btn-gradient {
  background: var(--gradient-brand);
  background-size: 200% 200%;
  transition: all var(--duration-base) ease;
  position: relative;
  overflow: hidden;
}

.btn-gradient:hover {
  background-position: right center;
  box-shadow: var(--shadow-glow-blue);
  transform: translateY(-1px);
}

.btn-gradient::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--duration-base);
}

.btn-gradient:hover::after { opacity: 1; }

/* ─── Compare Button Pulse ───────────────────────────────────────── */
.btn-compare {
  animation: compareGlow 2.5s ease-in-out infinite;
}

@keyframes compareGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4); }
  50%       { box-shadow: 0 8px 32px rgba(59, 130, 246, 0.7), 0 0 0 4px rgba(59, 130, 246, 0.15); }
}

/* ─── Animation Keyframes ────────────────────────────────────────── */
@keyframes fadeIn      { from { opacity: 0; }                            to { opacity: 1; } }
@keyframes slideInUp   { from { opacity: 0; transform: translateY(16px); }  to { opacity: 1; transform: translateY(0); } }
@keyframes slideInDown { 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 slideInRight{ from { opacity: 0; transform: translateX(20px); }  to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn     { from { opacity: 0; transform: scale(0.92); }       to { opacity: 1; transform: scale(1); } }
@keyframes pulse       { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes float       { 0%, 100% { transform: translateY(0px); }   50% { transform: translateY(-10px); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes spin        { from { transform: rotate(0deg); }                  to { transform: rotate(360deg); } }
@keyframes shimmer     { 0% { background-position: -600px 0; }              100% { background-position: 600px 0; } }
@keyframes skeleton-loading {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ─── Animation Utility Classes ──────────────────────────────────── */
.animate-fade-in        { animation: fadeIn       0.3s ease both; }
.animate-slide-up       { animation: slideInUp    0.35s cubic-bezier(0.16,1,0.3,1) both; }
.animate-slide-down     { animation: slideInDown  0.35s cubic-bezier(0.16,1,0.3,1) both; }
.animate-slide-left     { animation: slideInLeft  0.4s ease-out both; }
.animate-slide-right    { animation: slideInRight 0.4s ease-out both; }
.animate-scale-in       { animation: scaleIn      0.3s  cubic-bezier(0.16,1,0.3,1) both; }
.animate-pulse-glow     { animation: pulse        2s cubic-bezier(0.4,0,0.6,1) infinite; }
.animate-float          { animation: float        3s ease-in-out infinite; }
.animate-gradient-shift { animation: gradientShift 3s ease infinite; background-size: 200% 200%; }
.animate-spin           { animation: spin         1s linear infinite; }
.animate-shimmer        { animation: shimmer      1.6s ease-in-out infinite; background-size: 600px 100%; }
.skeleton-loading       { animation: skeleton-loading 1.5s infinite; background-size: 200% 100%;
                          background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%); }

/* ─── Prism Syntax Highlighting — Light ──────────────────────────── */
.token.keyword    { color: #6366f1; font-weight: 600; }
.token.string     { color: #059669; }
.token.comment    { color: #94a3b8; font-style: italic; }
.token.function   { color: #3b82f6; }
.token.number     { color: #f59e0b; }
.token.operator   { color: #ec4899; }
.token.class-name { color: #8b5cf6; font-weight: 600; }
.token.builtin    { color: #0ea5e9; }
.token.boolean    { color: #f97316; }

/* Dark theme Prism overrides */
.dark .token.keyword    { color: #818cf8; }
.dark .token.string     { color: #34d399; }
.dark .token.comment    { color: #64748b; }
.dark .token.function   { color: #60a5fa; }
.dark .token.number     { color: #fbbf24; }
.dark .token.operator   { color: #f472b6; }
.dark .token.class-name { color: #a78bfa; }
.dark .token.builtin    { color: #38bdf8; }
.dark .token.boolean    { color: #fb923c; }

/* ─── Scrollbars ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.7); }
/* Firefox */
* { scrollbar-color: rgba(100, 116, 139, 0.5) transparent; scrollbar-width: thin; }

/* ─── Focus Rings ────────────────────────────────────────────────── */
*:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Toast ──────────────────────────────────────────────────────── */
.toast { animation: slideInDown 0.3s cubic-bezier(0.16,1,0.3,1) both; }


/* ─── Glassmorphism ──────────────────────────────────────────────── */
.glass {
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  background: var(--glass-light);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.dark .glass {
  background: var(--glass-dark);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-header {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ─── Gradient Text ──────────────────────────────────────────────── */
.gradient-brand {
  background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-aurora {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Animated Gradient Button ───────────────────────────────────── */
.btn-gradient {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  background-size: 200% 200%;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-gradient:hover {
  background-position: right center;
  box-shadow: var(--shadow-glow-blue);
  transform: translateY(-1px);
}

.btn-gradient::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-gradient:hover::after {
  opacity: 1;
}

/* ─── Compare Button Pulse ───────────────────────────────────────── */
.btn-compare {
  animation: compareGlow 2.5s ease-in-out infinite;
  position: relative;
}

@keyframes compareGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4); }
  50%       { box-shadow: 0 8px 32px rgba(59, 130, 246, 0.7), 0 0 0 4px rgba(59, 130, 246, 0.15); }
}

/* ─── Slide-in Animations ────────────────────────────────────────── */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

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

.animate-slide-up   { animation: slideInUp   0.35s cubic-bezier(0.16,1,0.3,1) both; }
.animate-slide-down { animation: slideInDown 0.35s cubic-bezier(0.16,1,0.3,1) both; }
.animate-scale-in   { animation: scaleIn     0.3s  cubic-bezier(0.16,1,0.3,1) both; }
.animate-fade-in    { animation: fadeIn      0.3s  ease both; }

/* ─── Prism Syntax Highlighting ──────────────────────────────────── */
/* Light theme token colors */
.token.keyword   { color: #6366f1; font-weight: 600; }
.token.string    { color: #059669; }
.token.comment   { color: #94a3b8; font-style: italic; }
.token.function  { color: #3b82f6; }
.token.number    { color: #f59e0b; }
.token.operator  { color: #ec4899; }
.token.class-name { color: #8b5cf6; font-weight: 600; }
.token.builtin   { color: #0ea5e9; }
.token.boolean   { color: #f97316; }

/* Dark theme overrides */
.dark .token.keyword   { color: #818cf8; }
.dark .token.string    { color: #34d399; }
.dark .token.comment   { color: #64748b; }
.dark .token.function  { color: #60a5fa; }
.dark .token.number    { color: #fbbf24; }
.dark .token.operator  { color: #f472b6; }
.dark .token.class-name { color: #a78bfa; }
.dark .token.builtin   { color: #38bdf8; }
.dark .token.boolean   { color: #fb923c; }

/* ─── Scrollbar Styling ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.7); }

/* ─── Focus Rings ────────────────────────────────────────────────── */
*:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Diff line hover ────────────────────────────────────────────── */
.diff-row:hover {
  background: rgba(59, 130, 246, 0.06) !important;
}

/* ─── Toast ──────────────────────────────────────────────────────── */
.toast {
  animation: slideInDown 0.3s cubic-bezier(0.16,1,0.3,1) both;
}

/* ─── Loading shimmer ────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  background-size: 600px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
