/* ScriptVisualizer Pro — custom styles */

:root {
  --primary: #8B5CF6;
  --accent: #06B6D4;
}

* { scrollbar-width: thin; scrollbar-color: #2A2A35 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #2A2A35; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #3a3a48; }

body { overflow-x: hidden; }

/* ── Animated gradient mesh background ── */
.gradient-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.mesh-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.35;
  will-change: transform;
}
.blob-1 { width: 600px; height: 600px; background: #8B5CF6; top: -10%; left: -5%; animation: drift1 22s ease-in-out infinite; }
.blob-2 { width: 520px; height: 520px; background: #06B6D4; bottom: -15%; right: -5%; animation: drift2 26s ease-in-out infinite; }
.blob-3 { width: 420px; height: 420px; background: #6366F1; top: 40%; left: 45%; animation: drift3 30s ease-in-out infinite; }

@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(120px,80px) scale(1.15); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-100px,-60px) scale(1.1); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-80px,90px) scale(1.2); } }

.light body, body.light { background: #f4f4f8; color: #16161d; }

/* ── Glassmorphism ── */
.glass {
  background: rgba(19, 19, 26, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(42, 42, 53, 0.7);
}
.glass-strong {
  background: rgba(10, 10, 15, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(42, 42, 53, 0.9);
}

/* ── Gradient text & buttons ── */
.gradient-text {
  background: linear-gradient(90deg, #8B5CF6, #06B6D4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gradient-anim {
  background: linear-gradient(90deg, #8B5CF6, #06B6D4, #8B5CF6);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

.btn-gradient {
  background: linear-gradient(90deg, #8B5CF6, #06B6D4);
  background-size: 180% auto;
  transition: all 0.25s ease;
}
.btn-gradient:hover {
  background-position: right center;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.55);
  transform: translateY(-1px);
}
.btn-gradient:active { transform: translateY(0); }
.btn-gradient:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }

.pulse-cta { animation: pulseGlow 2s ease-in-out infinite; }
@keyframes pulseGlow {
  0%,100% { box-shadow: 0 0 0 0 rgba(139,92,246,0.5); }
  50% { box-shadow: 0 0 28px 6px rgba(6,182,212,0.45); }
}

/* ── Skeleton loader ── */
.skeleton {
  background: linear-gradient(90deg, #1A1A24 25%, #23232f 50%, #1A1A24 75%);
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
}
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Card entrance animation ── */
.card-enter { animation: cardIn 0.45s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ── Spinner ── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast {
  animation: toastIn 0.3s cubic-bezier(0.16,1,0.3,1) both;
}
.toast.out { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { opacity:0; transform: translateX(40px); } to { opacity:1; transform:none; } }
@keyframes toastOut { to { opacity:0; transform: translateX(40px); } }

/* ── Range slider ── */
input[type="range"] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 6px; background: #2A2A35; outline: none; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(90deg,#8B5CF6,#06B6D4);
  cursor: pointer; box-shadow: 0 0 8px rgba(139,92,246,0.6);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border:none; border-radius: 50%;
  background: linear-gradient(90deg,#8B5CF6,#06B6D4); cursor: pointer;
}

/* ── Keyword chips ── */
.chip {
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.35);
  color: #c4b5fd;
}

.fade-in { animation: fadeIn 0.3s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* status dot pulse */
.dot-live { box-shadow: 0 0 0 0 rgba(16,185,129,0.7); animation: dotPulse 2s infinite; }
@keyframes dotPulse { 0%,100% { box-shadow:0 0 0 0 rgba(16,185,129,0.6); } 50% { box-shadow:0 0 0 5px rgba(16,185,129,0); } }

textarea { resize: none; }
.line-clamp-2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
