/* ==========================================================================
   ANIMATIONS.CSS — GSAP Transitions, ScrollTriggers & Microinteractions
   Naty Carvalho Podóloga
   ========================================================================== */

/* 1. Scroll Progress Bar (Top of Screen) */
#scrollProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #b3862d, #e7c66e, #f8f6f0);
  z-index: 9999;
  pointer-events: none;
  transition: width 0.08s ease-out;
  box-shadow: 0 0 10px rgba(231, 198, 110, 0.7);
}

/* 2. Hero Headline Word-by-Word Split */
.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(32px) rotate(2deg);
  will-change: transform, opacity;
}

.hero-word-space {
  display: inline-block;
  width: 0.25em;
}

/* 3. Hero Image Clip-Path & Parallax */
.hero-clip-reveal {
  clip-path: inset(100% 0% 0% 0% round 24px);
  will-change: clip-path, transform;
}

/* 4. Animated Gold Lines */
.gold-line-draw {
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #b3862d 20%, #e7c66e 50%, #b3862d 80%, transparent);
  transform: scaleX(0);
  transform-origin: center;
  will-change: transform;
}

/* 5. 3D Card Tilt on Hover */
.tilt-card {
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.3, 1), box-shadow 0.3s ease;
}

.tilt-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 20px 40px rgba(23, 22, 21, 0.12), 0 0 0 1px rgba(179, 134, 45, 0.25);
}

.tilt-card-content {
  transform: translateZ(20px);
}

/* 6. Magnetic CTA Buttons */
.btn-magnetic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.25s ease;
  will-change: transform;
}

/* 7. Gold Navigation Underline Hover */
.site-header .nav-link-custom {
  position: relative;
  overflow: visible;
}

.site-header .nav-link-custom::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #b3862d, #e7c66e);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.site-header .nav-link-custom:hover::after,
.site-header .nav-link-custom.active::after {
  width: 80%;
}

/* 8. REELS SECTION & SWIPER STYLES */
.reels-section {
  position: relative;
  padding: 3.75rem 0 3.25rem 0;
  background: var(--color-ink, #171615);
  color: #ffffff;
  overflow: hidden;
}

.reels-bg-glow {
  position: absolute;
  top: 15%;
  left: 45%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(179, 134, 45, 0.15) 0%, rgba(23, 22, 21, 0) 70%);
  filter: blur(60px);
  pointer-events: none;
}

.reels-header-wrapper {
  margin-bottom: 2rem;
}

.reels-swiper-container {
  overflow: visible !important;
  padding: 0.75rem 0 1.5rem 0;
}

/* Reel Card 9:16 Aspect Ratio */
.reel-card {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  overflow: hidden;
  background: #242220;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(231, 198, 110, 0.18);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.reel-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: rgba(231, 198, 110, 0.65);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6), 0 0 25px rgba(179, 134, 45, 0.35);
}

.reel-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0, 0.2, 1);
}

.reel-card:hover .reel-thumbnail {
  transform: scale(1.08);
}

.reel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23, 22, 21, 0.15) 0%, rgba(23, 22, 21, 0.3) 40%, rgba(23, 22, 21, 0.95) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
  z-index: 2;
}

/* Category Badge Top Left */
.reel-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  padding: 0.35rem 0.75rem;
  background: rgba(23, 22, 21, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(231, 198, 110, 0.3);
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #e7c66e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Play Button in Center */
.reel-play-btn {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(231, 198, 110, 0.92);
  color: #171615;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1), background 0.3s ease;
  z-index: 3;
}

.reel-card:hover .reel-play-btn {
  transform: translate(-50%, -50%) scale(1.18);
  background: #ffffff;
  color: #b3862d;
}

/* Reel Content Bottom */
.reel-content {
  margin-top: auto;
  z-index: 3;
}

.reel-title {
  font-family: var(--font-serif, 'Playfair Display', serif);
  font-size: 1.12rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 0.4rem;
}

.reel-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
}

.reel-sample-badge {
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: #e7c66e;
}

/* Swiper Navigation & Pagination */
.reels-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.reels-nav-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(231, 198, 110, 0.35);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.reels-nav-btn:hover {
  background: #b3862d;
  border-color: #b3862d;
  color: #ffffff;
  transform: scale(1.08);
}

.reels-nav-btn.swiper-button-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.reels-pagination .swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.3);
  opacity: 1;
  width: 8px;
  height: 8px;
  transition: all 0.3s ease;
}

.reels-pagination .swiper-pagination-bullet-active {
  background: #e7c66e;
  width: 24px;
  border-radius: 4px;
}

/* 9. Premium Social Reels Modal Player */
.reel-modal-dialog {
  max-width: 420px;
  margin: 1.25rem auto;
}

.reel-modal-content {
  background: #141312;
  border: 1px solid rgba(231, 198, 110, 0.35);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.75), 0 0 40px rgba(179, 134, 45, 0.15);
  position: relative;
}

/* Story Progress Bar */
.reel-story-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.reel-story-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b3862d, #e7c66e);
  transition: width 0.1s linear;
}

/* Modal Header Bar */
.reel-modal-header {
  padding: 0.75rem 1rem;
  background: rgba(20, 19, 18, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.reel-creator-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b3862d, #e7c66e);
  color: #171615;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  border: 1.5px solid #ffffff;
}

.reel-creator-name {
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
}

.reel-creator-sub {
  color: #e7c66e;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: block;
}

.reel-duration-badge {
  background: rgba(231, 198, 110, 0.15);
  color: #e7c66e;
  border: 1px solid rgba(231, 198, 110, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Full 9:16 Video Player Stage - Never cropped, never cut off */
.reel-player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  height: clamp(520px, 75vh, 676px);
  background: #000000;
  overflow: hidden;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel-player-poster,
.reel-player-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-player-poster {
  transition: transform 0.6s ease, opacity 0.4s ease;
  z-index: 1;
}

.reel-player-video {
  z-index: 2;
  opacity: 1;
}

.reel-player-fb-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  background: #000;
}

.reel-player-stage.is-fb-active .reel-player-fb-iframe {
  opacity: 1;
  pointer-events: auto;
}

/* When Facebook player is active, hide dummy overlay elements */
.reel-player-stage.is-fb-active .reel-player-poster,
.reel-player-stage.is-fb-active .reel-player-video,
.reel-player-stage.is-fb-active .reel-center-play-btn {
  display: none !important;
  pointer-events: none !important;
}

.reel-player-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 30%, rgba(0,0,0,0.55) 70%, rgba(0,0,0,0.92) 100%);
  pointer-events: none;
  z-index: 3;
}

/* Central Play/Pause Button */
.reel-center-play-btn {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(23, 22, 21, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid #e7c66e;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(231, 198, 110, 0.45);
  transition: transform 0.25s ease, background-color 0.25s ease, opacity 0.25s ease;
}

.reel-center-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(179, 134, 45, 0.9);
}

.reel-center-play-btn.playing {
  opacity: 0;
  pointer-events: none;
}

.reel-player-stage:hover .reel-center-play-btn.playing {
  opacity: 0.85;
  pointer-events: auto;
}

/* Playback Status Pill */
.reel-playback-status {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 500;
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e7c66e;
  box-shadow: 0 0 8px #e7c66e;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Floating Actions on Right Edge */
.reel-floating-actions {
  position: absolute;
  right: 12px;
  bottom: 120px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.reel-action-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.reel-action-circle:hover {
  transform: scale(1.12);
  border-color: #e7c66e;
  color: #e7c66e;
}

.reel-action-circle .action-count {
  font-size: 0.52rem;
  font-weight: 700;
  line-height: 1;
  color: #e7c66e;
  margin-top: -2px;
}

/* Compact Modal Footer */
.reel-modal-footer {
  padding: 0.65rem 1rem;
  background: rgba(20, 19, 18, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.reel-footer-title {
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
}

/* 10. Immersive Storytelling Section Upgrades */
.cinematic-story-section {
  position: relative;
  background: #0d0c0c;
  color: #ffffff;
  padding: 4.75rem 0;
  overflow: hidden;
}

.cinematic-story-img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: var(--radius-2xl, 24px);
  filter: contrast(1.05) brightness(0.92);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(231, 198, 110, 0.2);
}

/* 11. Staggered Service Card Animations */
.service-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #b3862d, #e7c66e);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1);
}

.service-card:hover::before {
  transform: scaleX(1);
}

/* 12. Floating Cursor Parallax on Ambient Ornaments */
.ambient-glow-circle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(50px);
  will-change: transform;
}

/* 13. Accessibility & Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  #scrollProgressBar {
    display: none;
  }
  .hero-word {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-clip-reveal {
    clip-path: none !important;
  }
  .gold-line-draw {
    transform: scaleX(1) !important;
  }
  .tilt-card {
    transition: none !important;
  }
  .tilt-card:hover {
    transform: none !important;
  }
  .reel-card:hover {
    transform: none !important;
  }
  .reel-thumbnail {
    transition: none !important;
  }
  .service-card:hover {
    transform: none !important;
  }
}
