/* ==========================================================================
   SAFA BUILDERS — Animations & Transitions
   ========================================================================== */

/* ── Keyframe Definitions ── */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); animation-timing-function: ease-in; }
  50%       { transform: translateY(-10px); animation-timing-function: ease-out; }
}

@keyframes ringPulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0;   }
}

/* ── Animation Utility Classes ── */

.animate-fade-in       { animation: fadeIn      0.6s ease forwards; }
.animate-fade-in-up    { animation: fadeInUp    0.6s ease forwards; }
.animate-fade-in-down  { animation: fadeInDown  0.6s ease forwards; }
.animate-fade-in-left  { animation: fadeInLeft  0.6s ease forwards; }
.animate-fade-in-right { animation: fadeInRight 0.6s ease forwards; }
.animate-scale-in      { animation: scaleIn     0.4s ease forwards; }
.animate-bounce        { animation: bounce      1.2s ease infinite; }
.animate-spin          { animation: spin        1s linear infinite; }

/* Delay helpers */
.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; }

/* ── Hover Lift ── */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* ── Hover Scale ── */
.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.03);
}

/* ── Hover Glow ── */
.hover-glow:hover {
  box-shadow: 0 0 24px rgba(200,169,110,0.4);
}

/* ── Image Zoom on Card Hover ── */
.img-zoom-wrap {
  overflow: hidden;
  border-radius: inherit;
}

.img-zoom {
  transition: transform 0.5s ease;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-zoom-wrap:hover .img-zoom {
  transform: scale(1.06);
}

/* ── Gradient Text Animation ── */
.gradient-text {
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary), var(--clr-primary-light));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

/* ── Skeleton Loader ── */
.skeleton {
  background: linear-gradient(90deg, var(--clr-bg) 25%, var(--clr-bg-alt) 50%, var(--clr-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

/* ── Ripple Effect on Buttons ── */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 60%);
  transform: scale(0);
  transition: transform 0.5s ease;
  border-radius: inherit;
}

.btn:active::before {
  transform: scale(2.5);
  transition: none;
}

/* ── Ring Pulse (for call to action) ── */
.ring-pulse {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ring-pulse::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: var(--radius-full);
  border: 2px solid var(--clr-secondary);
  animation: ringPulse 2s ease-out infinite;
}

/* ── Counter Number Animation ── */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ── Testimonial Slider Transition ── */
.slider-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Fade Slider ── */
.fade-slider {
  position: relative;
}

.fade-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.fade-slide.active {
  opacity: 1;
  position: relative;
  pointer-events: all;
}

/* ── Page Transition Overlay ── */
.page-loader {
  position: fixed;
  inset: 0;
  background-color: var(--clr-primary);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.page-loader-logo {
  animation: scaleIn 0.5s ease forwards;
}
