/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

/* ===== Navbar scroll effect ===== */
#navbar {
  background: transparent;
  backdrop-filter: blur(0px);
  transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
}
#navbar.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(34, 34, 47, 0.8);
}

/* ===== Buttons ===== */
.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e5e7eb;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

/* ===== Gradient text ===== */
.gradient-text {
  background: linear-gradient(135deg, #818cf8, #a78bfa, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Grid pattern ===== */
.grid-pattern {
  background-image:
    linear-gradient(rgba(99,102,241,0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.15) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ===== Input focus ring ===== */
.input-field:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ===== Flash messages auto-dismiss ===== */
.flash-msg {
  animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== Prose overrides ===== */
.prose-invert p { color: #d1d5db; }
.prose-invert h2, .prose-invert h3 { color: #f9fafb; }
.prose-invert a { color: #818cf8; }
.prose-invert code { color: #a78bfa; background: rgba(167,139,250,0.1); padding: 2px 6px; border-radius: 4px; }

/* ===== Line clamp ===== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #111118; }
::-webkit-scrollbar-thumb { background: #2d2d3d; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4f46e5; }

/* ===== Page transition ===== */
body { animation: pageFadeIn 0.4s ease-out; }
@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* ===== Loading spinner ===== */
.spinner {
  width: 20px; height: 20px;
  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); } }

/* ===== Responsive table ===== */
@media (max-width: 640px) {
  table { display: block; overflow-x: auto; }
}
