/* ═══════════════════════════════════════════════════════════════
   L8AB TOOLS — VISUAL ENHANCEMENTS v2.0
   Reversible: Remove the <link> tag in base.html to revert
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Font upgrade ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables (cyber palette) ──────────────────────────── */
:root {
  --cyber-blue:    #00f5ff;
  --cyber-purple:  #7c3aed;
  --cyber-indigo:  #6366f1;
  --cyber-pink:    #ec4899;
  --cyber-green:   #10b981;
  --cyber-dark:    #020817;
  --cyber-card:    rgba(11, 17, 40, 0.85);
  --cyber-border:  rgba(99, 102, 241, 0.18);
  --cyber-glow:    rgba(99, 102, 241, 0.35);
  --grid-color:    rgba(99, 102, 241, 0.04);
  --font-main: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Global font upgrade ────────────────────────────────────── */
body, h1, h2, h3, h4, p, button, input, select, textarea, a {
  font-family: var(--font-main) !important;
}
code, pre, .mono { font-family: var(--font-mono) !important; }

/* ── Animated dot-grid background ──────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    radial-gradient(rgba(99,102,241,0.06) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

/* ── Ambient glow orbs ──────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  width: 600px; height: 600px;
  top: -200px; right: -150px;
  background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 65%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  animation: orb-drift 12s ease-in-out infinite;
}
@keyframes orb-drift {
  0%,100% { transform: translate(0, 0); }
  50%      { transform: translate(-40px, 40px); }
}

/* ── HERO section ───────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 6rem 0 4rem !important;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.14) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(14,165,233,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.5rem) !important;
  font-weight: 900 !important;
  letter-spacing: -0.04em !important;
  line-height: 1.1 !important;
}
.gradient-text {
  background: linear-gradient(135deg, #818cf8 0%, #22d3ee 50%, #a78bfa 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  animation: gradient-shift 4s ease infinite;
  background-size: 200% 200%;
}
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-subtitle {
  font-size: 1.2rem !important;
  color: #94a3b8 !important;
  font-weight: 400 !important;
  max-width: 560px;
}

/* ── Feature badges in hero ─────────────────────────────────── */
.feature-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  background: rgba(99,102,241,0.1) !important;
  border: 1px solid rgba(99,102,241,0.25) !important;
  border-radius: 20px !important;
  padding: 0.4rem 0.9rem !important;
  font-size: 0.85rem !important;
  color: #a5b4fc !important;
  font-weight: 500 !important;
  transition: all 0.25s !important;
  backdrop-filter: blur(8px) !important;
}
.feature-badge:hover {
  background: rgba(99,102,241,0.2) !important;
  border-color: rgba(99,102,241,0.5) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 16px rgba(99,102,241,0.2) !important;
}

/* ── Hero stat numbers ──────────────────────────────────────── */
.stat-number {
  font-size: 2.2rem !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, #818cf8, #22d3ee) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  letter-spacing: -0.02em !important;
}
.stat-label {
  color: #64748b !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
}

/* ── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  background: rgba(2, 8, 23, 0.85) !important;
  border-bottom: 1px solid var(--cyber-border) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
}
.logo-text {
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  font-size: 1.2rem !important;
  background: linear-gradient(135deg, #818cf8, #22d3ee) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
.nav-menu a {
  position: relative !important;
  color: #94a3b8 !important;
  font-weight: 500 !important;
  transition: color 0.2s !important;
}
.nav-menu a::after {
  content: '' !important;
  position: absolute !important;
  bottom: -4px !important; left: 0 !important; right: 0 !important;
  height: 2px !important;
  background: linear-gradient(90deg, #818cf8, #22d3ee) !important;
  border-radius: 2px !important;
  transform: scaleX(0) !important;
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1) !important;
}
.nav-menu a:hover { color: #e2e8f0 !important; }
.nav-menu a:hover::after { transform: scaleX(1) !important; }

/* ── TOOL CARDS ─────────────────────────────────────────────── */
.tool-card, [class*="tool-card"], .card {
  border: 1px solid var(--cyber-border) !important;
  border-radius: 16px !important;
  background: var(--cyber-card) !important;
  backdrop-filter: blur(12px) !important;
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.25s, border-color 0.25s !important;
  position: relative !important;
  overflow: hidden !important;
}
.tool-card::before, [class*="tool-card"]::before {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(135deg, rgba(99,102,241,0.05), transparent 50%) !important;
  opacity: 0 !important;
  transition: opacity 0.3s !important;
  pointer-events: none !important;
}
.tool-card:hover, [class*="tool-card"]:hover {
  transform: translateY(-6px) !important;
  border-color: rgba(99,102,241,0.4) !important;
  box-shadow: 0 16px 40px rgba(99,102,241,0.18), 0 0 0 1px rgba(99,102,241,0.1) !important;
}
.tool-card:hover::before, [class*="tool-card"]:hover::before {
  opacity: 1 !important;
}

/* ── LOADING SKELETON ───────────────────────────────────────── */
.skeleton {
  display: block;
  background: linear-gradient(90deg,
    rgba(30,41,59,0.8) 25%,
    rgba(51,65,85,0.6) 50%,
    rgba(30,41,59,0.8) 75%
  );
  background-size: 200% 100%;
  border-radius: 8px;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text  { height: 1rem; margin-bottom: 0.5rem; }
.skeleton-title { height: 1.5rem; width: 60%; margin-bottom: 1rem; }
.skeleton-box   { height: 200px; width: 100%; }

/* ── PROCESSING SPINNER ─────────────────────────────────────── */
.cyber-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(99,102,241,0.15);
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 1rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── BUTTONS ────────────────────────────────────────────────── */
button[type="submit"], .btn-primary, [class*="btn-convert"], [class*="btn-format"],
.btn, input[type="button"] {
  background: linear-gradient(135deg, #6366f1, #0ea5e9) !important;
  border: none !important;
  border-radius: 12px !important;
  color: #fff !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s !important;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3) !important;
  position: relative !important;
  overflow: hidden !important;
}
button[type="submit"]::after, .btn-primary::after {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(to bottom, rgba(255,255,255,0.08), transparent) !important;
  pointer-events: none !important;
}
button[type="submit"]:hover, .btn-primary:hover {
  opacity: 0.88 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 8px 24px rgba(99,102,241,0.45) !important;
}
button[type="submit"]:active { transform: scale(0.98) !important; }

/* ── INPUT / TEXTAREA ───────────────────────────────────────── */
input:not([type="button"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
textarea, select {
  background: rgba(15,23,42,0.8) !important;
  border: 1px solid rgba(71,85,105,0.4) !important;
  border-radius: 10px !important;
  color: #e2e8f0 !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
  font-family: var(--font-mono) !important;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(99,102,241,0.6) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
  outline: none !important;
}

/* ── SECTIONS / HEADINGS ────────────────────────────────────── */
section h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
}

/* ── SECTION DIVIDER (cyber line) ──────────────────────────── */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.5), rgba(14,165,233,0.5), transparent);
  margin: 3rem 0;
  border: none;
}

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #020817; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #6366f1, #0ea5e9);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: #818cf8; }

/* ── SELECTION ──────────────────────────────────────────────── */
::selection {
  background: rgba(99,102,241,0.35);
  color: #e2e8f0;
}

/* ── TOAST / NOTIFICATIONS ──────────────────────────────────── */
.toast, [class*="toast"], .notification {
  backdrop-filter: blur(16px) !important;
  background: rgba(11,17,40,0.92) !important;
  border: 1px solid var(--cyber-border) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-content {
  backdrop-filter: blur(20px) !important;
  background: rgba(11,17,40,0.92) !important;
  border: 1px solid var(--cyber-border) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5) !important;
}
.modal-header {
  border-bottom: 1px solid var(--cyber-border) !important;
}

/* ── PAGE LOAD ANIMATION ────────────────────────────────────── */
@keyframes page-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
main, .hero, section {
  animation: page-in 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
section { animation-delay: 0.1s; }
section + section { animation-delay: 0.15s; }

/* ── FOOTER ─────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--cyber-border) !important;
  background: rgba(2,8,23,0.95) !important;
  backdrop-filter: blur(12px) !important;
}

/* ── LOADING OVERLAY (tool processing) ─────────────────────── */
#l8ab-loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(2,8,23,0.8);
  backdrop-filter: blur(6px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
#l8ab-loading-overlay.active {
  opacity: 1; pointer-events: all;
}
#l8ab-loading-overlay .loader-ring {
  width: 64px; height: 64px;
  border: 4px solid rgba(99,102,241,0.15);
  border-top-color: #818cf8;
  border-right-color: #22d3ee;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
#l8ab-loading-overlay p {
  color: #94a3b8; font-size: 0.9rem; letter-spacing: 0.05em;
}

/* ── CARD ENTRY ANIMATIONS (intersection observer) ──────────── */
.card-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.22,1,0.36,1),
              transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.card-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── MOBILE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 4rem 0 3rem !important; }
  .hero-title { font-size: 2.2rem !important; }
}
