/* ======================================
   WORKBRIDGE — ANIMATIONS & ENHANCEMENTS
   ====================================== */

/* ---- Keyframes ---- */
@keyframes fadeInUp    { from { opacity:0; transform:translateY(32px); } 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.88); } to { opacity:1; transform:scale(1); } }
@keyframes slideUp     { from { transform:translateY(100%); opacity:0; } to { transform:translateY(0); opacity:1; } }
@keyframes blurIn      { from { opacity:0; filter:blur(8px); } to { opacity:1; filter:blur(0); } }

@keyframes float {
  0%,100% { transform:translateY(0px) rotate(0deg); }
  33%      { transform:translateY(-14px) rotate(1deg); }
  66%      { transform:translateY(-8px) rotate(-1deg); }
}

@keyframes floatSlow {
  0%,100% { transform:translateY(0) scale(1); }
  50%     { transform:translateY(-18px) scale(1.02); }
}

@keyframes rotateSlow {
  from { transform:rotate(0deg); }
  to   { transform:rotate(360deg); }
}

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

@keyframes pulseGlow {
  0%,100% { box-shadow: 0 0 0 0 rgba(200,169,110,0); }
  50%      { box-shadow: 0 0 0 12px rgba(200,169,110,0.18); }
}

@keyframes borderDraw {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

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

@keyframes wave {
  0%,100% { transform:scaleY(1); }
  50%     { transform:scaleY(1.4); }
}

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

@keyframes blink {
  0%,100% { opacity:1; }
  50%     { opacity:0; }
}

/* ---- Animation utility classes ---- */
.anim-fade-in-up    { animation: fadeInUp    0.7s cubic-bezier(.4,0,.2,1) both; }
.anim-fade-in-down  { animation: fadeInDown  0.7s cubic-bezier(.4,0,.2,1) both; }
.anim-fade-in-left  { animation: fadeInLeft  0.7s cubic-bezier(.4,0,.2,1) both; }
.anim-fade-in-right { animation: fadeInRight 0.7s cubic-bezier(.4,0,.2,1) both; }
.anim-scale-in      { animation: scaleIn     0.6s cubic-bezier(.4,0,.2,1) both; }
.anim-blur-in       { animation: blurIn      0.8s ease both; }
.anim-float         { animation: float       6s ease-in-out infinite; }
.anim-float-slow    { animation: floatSlow   9s ease-in-out infinite; }
.anim-pulse-glow    { animation: pulseGlow   2.5s ease-in-out infinite; }
.anim-gradient      { background-size:200% 200%; animation:gradientShift 5s ease 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; }
.delay-600 { animation-delay:0.6s; }
.delay-700 { animation-delay:0.7s; }
.delay-800 { animation-delay:0.8s; }

/* ---- Hero entrance sequence ---- */
.hero-sequence > *:nth-child(1) { animation:fadeInUp 0.65s ease 0.05s both; }
.hero-sequence > *:nth-child(2) { animation:fadeInUp 0.65s ease 0.15s both; }
.hero-sequence > *:nth-child(3) { animation:fadeInUp 0.65s ease 0.25s both; }
.hero-sequence > *:nth-child(4) { animation:fadeInUp 0.65s ease 0.35s both; }
.hero-sequence > *:nth-child(5) { animation:fadeInUp 0.65s ease 0.45s both; }

/* ---- Shimmer loading skeleton ---- */
.skeleton {
  background: linear-gradient(90deg, var(--light-gray) 25%, var(--off-white) 50%, var(--light-gray) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

/* ---- Hover lift card ---- */
.hover-lift {
  transition: transform 0.32s cubic-bezier(.4,0,.2,1), box-shadow 0.32s ease;
}
.hover-lift:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 24px 64px rgba(26,60,94,0.16);
}

/* ---- Gradient text ---- */
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Accent underline animation ---- */
.underline-anim {
  position: relative;
  display: inline-block;
}
.underline-anim::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.35s ease;
}
.underline-anim:hover::after { width: 100%; }

/* ---- Spotlight card hover ---- */
.spotlight-card {
  position: relative;
  overflow: hidden;
}
.spotlight-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at var(--mouse-x,50%) var(--mouse-y,50%), rgba(200,169,110,0.12) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 0;
}
.spotlight-card:hover::before { opacity: 1; }

/* ---- Progress bar ---- */
.progress-bar-wrap {
  height: 6px;
  background: var(--light-gray);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s cubic-bezier(.4,0,.2,1);
}
.progress-bar-fill.animated { transform: scaleX(1); }

/* ---- Typing cursor ---- */
.typing-cursor::after {
  content: '|';
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

/* ---- Tag cloud hover ---- */
.tag {
  display: inline-block;
  background: var(--light-gray);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 40px;
  letter-spacing: 0.5px;
  transition: var(--transition);
  cursor: default;
  border: 1.5px solid transparent;
}
.tag:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ---- Notification toast ---- */
.toast {
  position: fixed;
  bottom: 88px;
  right: 28px;
  background: var(--primary-dark);
  color: var(--white);
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.35s ease;
  z-index: 1100;
  border-left: 4px solid var(--accent);
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left-color: #2d7a4f; }
.toast.error   { border-left-color: #c0392b; }

/* ---- Section divider waves ---- */
.wave-divider {
  width: 100%;
  overflow: hidden;
  line-height: 0;
  margin-bottom: -1px;
}
.wave-divider svg {
  display: block;
  width: 100%;
}

/* ---- Animated number counter ---- */
[data-counter] { animation: countUp 0.5s ease both; }

/* ---- Icon bounce on hover ---- */
.icon-bounce { transition: transform 0.3s cubic-bezier(.4,0,.2,1); }
.icon-bounce:hover { transform: translateY(-4px) scale(1.15); }

/* ---- Back-to-top pulse ring ---- */
.scroll-top::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  animation: pulseGlow 2.5s ease-in-out infinite;
}

/* ---- Page transition overlay ---- */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--primary-dark);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(.77,0,.18,1);
  pointer-events: none;
}
.page-transition.active { transform: translateY(0); }

/* ---- Sticky CTA bar (mobile) ---- */
.sticky-cta-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 1px solid var(--light-gray);
  padding: 12px 20px;
  z-index: 990;
  box-shadow: 0 -4px 20px rgba(26,60,94,0.1);
  gap: 10px;
}
@media (max-width:768px) {
  .sticky-cta-bar { display: flex; }
  .sticky-cta-bar .btn { flex: 1; justify-content: center; font-size: 14px; padding: 13px 16px; }
}

/* ---- Marquee / ticker strip ---- */
.marquee-wrap {
  overflow: hidden;
  white-space: nowrap;
  background: var(--primary-dark);
  padding: 6px 0;
}
.marquee-track {
  display: inline-flex;
  gap: 48px;
  animation: marqueeScroll 30s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
  letter-spacing: 0.5px;
}
.marquee-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Accordion extra styles ---- */
.faq-item { transition: box-shadow 0.3s ease; }
.faq-item.open { box-shadow: var(--shadow-md); }

/* ---- Image overlay hover ---- */
.img-hover-zoom {
  overflow: hidden;
  border-radius: var(--radius-md);
}
.img-hover-zoom img {
  transition: transform 0.5s cubic-bezier(.4,0,.2,1);
}
.img-hover-zoom:hover img { transform: scale(1.06); }

/* ---- Testimonial star fill animation ---- */
.testimonial-stars svg {
  animation: scaleIn 0.4s ease both;
}
.testimonial-stars svg:nth-child(1) { animation-delay:0.05s; }
.testimonial-stars svg:nth-child(2) { animation-delay:0.10s; }
.testimonial-stars svg:nth-child(3) { animation-delay:0.15s; }
.testimonial-stars svg:nth-child(4) { animation-delay:0.20s; }
.testimonial-stars svg:nth-child(5) { animation-delay:0.25s; }

/* ---- Mobile responsive tweaks ---- */
@media (max-width: 768px) {
  .anim-fade-in-left,
  .anim-fade-in-right { animation-name: fadeInUp; }
}

/* ============================
   PAGE LOAD FADE-IN
   ============================ */
body {
  opacity: 0;
  transition: opacity 0.4s ease;
}
body.loaded {
  opacity: 1;
}

/* Ensure the page is visible even if JS is slow */
body::after {
  content: '';
  animation: showBody 0.1s 0.8s forwards;
}
@keyframes showBody {
  to { opacity: 1; }
}

/* Force visible if no JS */
@media (scripting: none) {
  body { opacity: 1 !important; }
}
