/* ===================================
   Beezle TW — Tailwind CSS Companion
   Minimal custom styles for animations,
   scrollbar, HTMX states, and utilities.
   =================================== */

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* HTMX loading state */
.htmx-request { opacity: 0.7; pointer-events: none; transition: opacity 200ms ease; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0);  }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-8px) translateX(3px); }
  75% { transform: translateY(4px) translateX(-3px); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.04); }
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}
@keyframes scoreRing {
  from { stroke-dashoffset: 283; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes auraPulse {
  0%   { box-shadow: 0 0 0 0 rgba(23, 63, 95, 0.4); }
  70%  { box-shadow: 0 0 0 12px rgba(23, 63, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(23, 63, 95, 0); }
}

/* Animation utility classes */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out both;
}
.animate-fade-in {
  animation: fadeIn 0.4s ease-out both;
}
.animate-float {
  animation: float 6s ease-in-out infinite;
}
.animate-shimmer {
  background-size: 200% auto;
  animation: shimmer 4s ease infinite;
}
.animate-pulse-glow {
  animation: pulse 2s infinite;
}
.animate-spin {
  animation: spin 0.8s linear infinite;
}

/* Staggered animation delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* Card hover utility */
.card-hover {
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(23, 63, 95, 0.12);
}

/* Gradient text */
.gradient-text-beezle {
  background: linear-gradient(135deg, #3CAEA3, #F6D55C, #F9E589);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Progress bar fill */
.progress-fill {
  transition: width 600ms ease-out;
}

/* Toast container */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast-item {
  animation: slideInRight 300ms ease-out;
}
.toast-item.removing {
  animation: slideOutRight 300ms ease-out forwards;
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Hide until Alpine.js initializes */
[x-cloak] { display: none !important; }

/* Glass morphism utility */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.glass-dark {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ========= MICRO-INTERACTIONS ========= */

/* Scroll-reveal: elements start invisible, JS adds .revealed */
.bzl-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(.4,0,.2,1), transform 0.6s cubic-bezier(.4,0,.2,1);
}
.bzl-reveal.bzl-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hover glow ring */
.hover-glow {
  transition: box-shadow 0.3s ease;
}
.hover-glow:hover {
  box-shadow: 0 0 0 4px rgba(60, 174, 163, 0.18), 0 8px 24px rgba(23, 63, 95, 0.1);
}

/* Button press effect */
.btn-press {
  transition: transform 0.1s ease;
}
.btn-press:active {
  transform: scale(0.96);
}

/* Skeleton loader */
@keyframes skeletonPulse {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s ease-in-out infinite;
  border-radius: 6px;
}

/* Counter animation (used with JS) */
.counter-value {
  transition: opacity 0.2s;
}

/* Badge pulse for notifications */
@keyframes badgePing {
  0%   { transform: scale(1); opacity: 1; }
  75%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}
.badge-ping::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  animation: badgePing 1.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Smooth focus ring for accessibility */
.focus-ring:focus-visible {
  outline: 2px solid #20639B;
  outline-offset: 2px;
  border-radius: 4px;
}
