/* ========================================
   Fulabco — Custom CSS
   Animations, Glassmorphism, Utilities
   ======================================== */

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ---------- Smooth Scroll ---------- */
html {
  scroll-behavior: smooth;
}

/* ---------- Selection ---------- */
::selection {
  background: #2563eb;
  color: #fff;
}

/* ---------- Glassmorphism ---------- */
.glass {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.glass-dark {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ---------- Gradient Text ---------- */
.gradient-text {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-warm {
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Gradient Backgrounds ---------- */
.gradient-primary {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
}
.gradient-dark {
  background: linear-gradient(135deg, #0f172a, #1e293b);
}
.gradient-mesh {
  background: 
    radial-gradient(at 20% 20%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
    radial-gradient(at 80% 80%, rgba(6, 182, 212, 0.12) 0%, transparent 50%),
    radial-gradient(at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
}

/* ---------- Keyframe Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(37, 99, 235, 0.3); }
  50% { box-shadow: 0 0 40px rgba(37, 99, 235, 0.6); }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes blob {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}
@keyframes bounce-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---------- Animation Classes ---------- */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}
.animate-fade-in-down {
  animation: fadeInDown 0.5s ease-out forwards;
}
.animate-fade-in-left {
  animation: fadeInLeft 0.6s ease-out forwards;
}
.animate-fade-in-right {
  animation: fadeInRight 0.6s ease-out forwards;
}
.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}
.animate-float {
  animation: float 3s ease-in-out infinite;
}
.animate-float-slow {
  animation: floatSlow 4s ease-in-out infinite;
}
.animate-float-delay-1 {
  animation: float 3s ease-in-out infinite 0.5s;
}
.animate-float-delay-2 {
  animation: float 3s ease-in-out infinite 1s;
}
.animate-float-delay-3 {
  animation: float 3s ease-in-out infinite 1.5s;
}
.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}
.animate-scale-in {
  animation: scale-in 0.5s ease-out forwards;
}
.animate-blob {
  animation: blob 8s ease-in-out infinite;
}
.animate-bounce-gentle {
  animation: bounce-gentle 2s ease-in-out infinite;
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.15s; }
.reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.2s; }
.reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.25s; }
.reveal-stagger.revealed > *:nth-child(6) { transition-delay: 0.3s; }
.reveal-stagger.revealed > *:nth-child(7) { transition-delay: 0.35s; }
.reveal-stagger.revealed > *:nth-child(8) { transition-delay: 0.4s; }
.reveal-stagger.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Skeleton Loaders ---------- */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}
.skeleton-title {
  height: 22px;
  width: 70%;
  margin-bottom: 12px;
}
.skeleton-image {
  width: 100%;
  aspect-ratio: 4/3;
}
.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

/* ---------- Card Hover Effects ---------- */
.card-hover {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.12);
}
.card-lift {
  transition: all 0.3s ease;
}
.card-lift:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 24px -8px rgba(37, 99, 235, 0.15);
}

/* ---------- Button Effects ---------- */
.btn-shine {
  position: relative;
  overflow: hidden;
}
.btn-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}
.btn-shine:hover::before {
  left: 125%;
}

/* ---------- Custom Utilities ---------- */
.text-balance {
  text-wrap: balance;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Dot Pattern ---------- */
.dot-pattern {
  background-image: radial-gradient(circle, #cbd5e1 1px, transparent 1px);
  background-size: 20px 20px;
}

/* ---------- Image Overlay ---------- */
.img-overlay {
  position: relative;
}
.img-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.7) 0%, transparent 60%);
  border-radius: inherit;
}

/* ---------- Navbar Active State ---------- */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 2px;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ---------- Product Badge ---------- */
.badge-new {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
}
.badge-sale {
  background: linear-gradient(135deg, #ef4444, #f97316);
}
.badge-hot {
  background: linear-gradient(135deg, #f97316, #eab308);
}

/* ---------- Star Rating ---------- */
.star-rating .fa-star {
  color: #fbbf24;
}
.star-rating .fa-star-half-stroke {
  color: #fbbf24;
}
.star-rating .fa-star.empty {
  color: #e2e8f0;
}

/* ---------- Timeline ---------- */
.timeline-line {
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}
.timeline-line-active {
  background: linear-gradient(to bottom, #2563eb, #06b6d4);
}

/* ---------- Price Range Slider ---------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 4px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* ---------- Mobile Bottom Nav ---------- */
.bottom-nav {
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

/* ---------- Search Overlay ---------- */
.search-overlay {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---------- Back to Top ---------- */
#backToTop {
  transition: all 0.3s ease;
  opacity: 0;
  pointer-events: none;
}
#backToTop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Tab Active ---------- */
.tab-btn {
  position: relative;
  transition: all 0.3s ease;
}
.tab-btn.active {
  color: #2563eb;
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #2563eb;
  border-radius: 2px;
}

/* ---------- Blob Shape ---------- */
.blob-shape {
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: blob 8s ease-in-out infinite;
}

/* ---------- Hero Image Placeholder ---------- */
.hero-image-placeholder {
  background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 50%, #cffafe 100%);
  border-radius: 24px;
}

/* ---------- Responsive Fixes ---------- */
@media (max-width: 768px) {
  .reveal,
  .reveal-left,
  .reveal-right {
    transform: translateY(20px) !important;
    transition-duration: 0.5s;
  }
  .reveal.revealed,
  .reveal-left.revealed,
  .reveal-right.revealed {
    transform: translateY(0) !important;
  }
}
