/**
 * Animations for Sonat Game Website
 * Replicates Next.js animations from original build
 */

/* ============================================
   SLIDE-IN ANIMATIONS
   ============================================ */

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

/* CRITICAL: Ensure animation maintains final state */
@keyframes slideInUpFinished {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

/* Slide-in class application */
.slide__in {
  transform: translateY(100%);
  opacity: 0;
}

.slide__in.animate {
  animation: slideInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Staggered delays for sequential animations */
.slide__in.animate:nth-child(1) { animation-delay: 0s; }
.slide__in.animate:nth-child(2) { animation-delay: 0.1s; }
.slide__in.animate:nth-child(3) { animation-delay: 0.2s; }
.slide__in.animate:nth-child(4) { animation-delay: 0.3s; }
.slide__in.animate:nth-child(5) { animation-delay: 0.4s; }

/* ============================================
   FADE ANIMATIONS
   ============================================ */

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

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

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

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

/* ============================================
   HERO ORBIT ANIMATIONS
   ============================================ */

@keyframes orbitScale {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

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

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

/* Orbit animation classes */
.snt__orbit {
  transform: scale(0);
  opacity: 0;
}

.snt__orbit.animate {
  animation: orbitScale 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Ring rotations */
.ring-0.animate {
  animation: rotateClockwise 60s linear infinite;
}

.ring-1.animate {
  animation: rotateCounterClockwise 80s linear infinite;
}

/* ============================================
   BUTTON WRAPPER ANIMATION
   ============================================ */

.snt__button-wrapper {
  transform: translateY(3.125rem);
  opacity: 0;
}

.snt__button-wrapper.animate {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

.snt__bubble {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.snt__bubble:hover {
  transform: translate3d(var(--tx, 0), var(--ty, 0), 0) scale(1.1) !important;
}

.snt__button:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.snt__button {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   SCROLL TRIGGERED ANIMATIONS
   ============================================ */

[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll animations with slide-in class */
[data-animate].slide__in {
  transform: translateY(100%);
}

[data-animate].slide__in.is-visible {
  transform: translateY(0);
}

/* Generic scroll-animate class */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for scroll animations */
[data-animate]:nth-child(1) { transition-delay: 0s; }
[data-animate]:nth-child(2) { transition-delay: 0.1s; }
[data-animate]:nth-child(3) { transition-delay: 0.2s; }
[data-animate]:nth-child(4) { transition-delay: 0.3s; }

/* ============================================
   STAGGERED ANIMATIONS
   ============================================ */

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

.stagger-in > * {
  opacity: 0;
  animation: staggerIn 0.6s ease-out forwards;
}

.stagger-in > *:nth-child(1) { animation-delay: 0s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.3s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.4s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.5s; }

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

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

.spinner {
  animation: spin 1s linear infinite;
}

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

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   UTILITY ANIMATION CLASSES
   ============================================ */

.animate-on-load {
  opacity: 0;
}

.animate-on-load.loaded {
  animation: fadeIn 0.6s ease-out forwards;
}

.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; }

/* ============================================
   RESPONSIVE ANIMATIONS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Pause animations on hover */
.snt__orbit:hover .ring-0.animate,
.snt__orbit:hover .ring-1.animate {
  animation-play-state: paused;
}

/* ============================================
   LANGUAGE PICKER DROPDOWN
   ============================================ */

/* Dropdown positioning and visibility */
.snt__language-picker {
  position: relative;
}

/* Higher specificity to override base CSS */
div.snt__dropdown {
  position: absolute !important;
  top: calc(100% + 0.5rem) !important;
  right: 0;
  min-width: 120px;
  background: #fff;
  z-index: 100;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Hidden state - CRITICAL: use !important to override all CSS */
div.snt__dropdown.snt__dropdown--hidden {
  opacity: 0 !important;
  transform: translateY(-10px) !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Visible state - CRITICAL: use !important to override all CSS */
div.snt__dropdown.snt__dropdown--visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

/* Dropdown options */
div.snt__dropdown .snt__dropdown-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  transition: background-color 0.2s ease, color 0.2s ease;
  background-color: transparent;
  color: #000624;
}

/* Hover state */
div.snt__dropdown .snt__dropdown-option:hover {
  background-color: #f4f4f4;
}

/* Active state - blue background like Next.js */
div.snt__dropdown .snt__dropdown-option.option__active {
  background-color: #000624 !important;
  color: #fff !important;
}

/* Icon rotation when dropdown open */
div.snt__language-picker.open .input_icon--right svg,
div.snt__language-picker.open .input_icon--right__B4FXr svg {
  transform: rotate(180deg) !important;
  transition: transform 0.2s ease;
}

/* Arrow icon transition */
div.snt__language-picker .input_icon--right svg,
div.snt__language-picker .input_icon--right__B4FXr svg {
  transition: transform 0.2s ease;
}

/* ============================================
   ACTIVITIES PAGINATION BUTTONS
   ============================================ */

/* Ensure pagination buttons are visible on all devices */
.activities_pagination___2AWl {
  display: flex !important;
  opacity: 1 !important;
}

.activities_navigation__T0qq_ {
  display: flex !important;
  gap: 0.75rem;
}

.activities_navigation__T0qq_ button {
  cursor: pointer;
  color: #f35b04;
  transition: 0.5s var(--ease-transition-2);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.5rem;
  background: transparent;
  border: none;
}

.activities_navigation__T0qq_ button:disabled {
  pointer-events: none;
  color: #a5a2a2a !important;
  cursor: not-allowed;
}

.activities_navigation__T0qq_ button svg {
  --icon-size: 1.125rem;
  width: var(--icon-size);
  height: var(--icon-size);
}

/* Hide Swiper's default navigation if it gets auto-generated */
.swiper-button-prev,
.swiper-button-next {
  display: none !important;
}

/* But show our custom buttons */
#activities-prev,
#activities-next {
  display: flex !important;
}

/* Responsive: Always show navigation on desktop and mobile */
@media (min-width: 48rem) {
  .activities_wrapper__LXo1e .activities_pagination___2AWl {
    border-top: 1px solid #a5a2a2;
    padding-top: 2.75rem;
  }
}

/* ============================================
   PARTNERS PAGINATION BUTTONS
   ============================================ */

/* Ensure pagination buttons are visible on all devices */
.partners_pagination__jCJOO {
  display: flex !important;
  opacity: 1 !important;
}

.partners_navigation__J5lQd {
  display: flex !important;
  gap: 0.75rem;
}

.partners_navigation__J5lQd button {
  cursor: pointer;
  color: #f35b04;
  transition: 0.5s var(--ease-transition-2);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.5rem;
  background: transparent;
  border: none;
}

.partners_navigation__J5lQd button:disabled {
  pointer-events: none;
  color: #a5a2a2a !important;
  cursor: not-allowed;
}

.partners_navigation__J5lQd button svg {
  --icon-size: 1.125rem;
  width: var(--icon-size);
  height: var(--icon-size);
}

/* But show our custom buttons */
#partners-prev,
#partners-next {
  display: flex !important;
}

/* Responsive: Always show navigation on desktop and mobile */
@media (min-width: 48rem) {
  .partners_wrapper__GcxdS .partners_pagination__jCJOO {
    border-top: 1px solid #a5a2a2;
    padding-top: 2.75rem;
  }
}

/* ============================================
   PRODUCTS PAGINATION BUTTONS
   ============================================ */

/* Ensure pagination buttons are visible on all devices */
.products_pagination__8CMtf {
  display: flex !important;
  opacity: 1 !important;
}

.products_navigation__2V1UW {
  display: flex !important;
  gap: 0.75rem;
}

.products_navigation__2V1UW button {
  cursor: pointer;
  color: #f35b04;
  transition: 0.5s var(--ease-transition-2);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.5rem;
  background: transparent;
  border: none;
}

.products_navigation__2V1UW button:disabled {
  pointer-events: none;
  color: #a5a2a2a !important;
  cursor: not-allowed;
}

.products_navigation__2V1UW button svg {
  --icon-size: 1.125rem;
  width: var(--icon-size);
  height: var(--icon-size);
}

/* But show our custom buttons */
#products-prev,
#products-next {
  display: flex !important;
}

/* Responsive: Always show navigation on desktop and mobile */
@media (min-width: 48rem) {
  .products_wrapper__M8Yfi .products_pagination__8CMtf {
    border-top: 1px solid #a5a2a2;
    padding-top: 2.75rem;
  }
}

/* ============================================
   MISSION PAGINATION BUTTONS
   ============================================ */

/* Ensure pagination buttons are visible on all devices */
.mission_pagination__5OxJS {
  display: flex !important;
  opacity: 1 !important;
}

.mission_navigation__M0eAC {
  display: flex !important;
  gap: 0.75rem;
}

.mission_navigation__M0eAC button {
  cursor: pointer;
  color: #f35b04;
  transition: 0.5s var(--ease-transition-2);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.5rem;
  background: transparent;
  border: none;
}

.mission_navigation__M0eAC button:disabled {
  pointer-events: none;
  color: #a5a2a2a !important;
  cursor: not-allowed;
}

.mission_navigation__M0eAC button svg {
  --icon-size: 1.125rem;
  width: var(--icon-size);
  height: var(--icon-size);
}

/* But show our custom buttons */
#mission-prev,
#mission-next {
  display: flex !important;
}

/* Responsive: Always show navigation on desktop and mobile */
@media (min-width: 48rem) {
  .mission_wrapper__HX9Ak .mission_pagination__5OxJS {
    border-top: 1px solid #a5a2a2;
    padding-top: 2.75rem;
  }
}

/* ============================================
   CULTURE IMAGES PARALLAX ANIMATION
   ============================================ */

/* Culture image floating animation */
@keyframes floatLeft {
  0%, 100% {
    transform: translateX(0px);
  }
  50% {
    transform: translateX(-20px);
  }
}

@keyframes floatRight {
  0%, 100% {
    transform: translateX(0px);
  }
  50% {
    transform: translateX(20px);
  }
}

@keyframes floatLeftSlow {
  0%, 100% {
    transform: translateX(0px);
  }
  50% {
    transform: translateX(-10px);
  }
}

@keyframes floatRightSlow {
  0%, 100% {
    transform: translateX(0px);
  }
  50% {
    transform: translateX(10px);
  }
}

/* Apply animations to culture images */
.culture_image__grid__wvkJU img:nth-child(1) {
  animation: floatLeft 6s ease-in-out infinite;
}

.culture_image__grid__wvkJU img:nth-child(2) {
  animation: floatRight 7s ease-in-out infinite;
}

.culture_image__grid__wvkJU img:nth-child(3) {
  animation: floatLeftSlow 8s ease-in-out infinite;
}

.culture_image__grid__wvkJU img:nth-child(4) {
  animation: floatRightSlow 5s ease-in-out infinite;
}

/* Desktop only - smoother animation */
@media (min-width: 48rem) {
  .culture_image__grid__wvkJU img:nth-child(1) {
    animation: floatLeft 8s ease-in-out infinite;
  }

  .culture_image__grid__wvkJU img:nth-child(2) {
    animation: floatRight 9s ease-in-out infinite;
  }

  .culture_image__grid__wvkJU img:nth-child(3) {
    animation: floatLeftSlow 10s ease-in-out infinite;
  }

  .culture_image__grid__wvkJU img:nth-child(4) {
    animation: floatRightSlow 7s ease-in-out infinite;
  }
}

/* ============================================
   MOBILE MENU ANIMATION
   ============================================ */

/* Base state - hidden above viewport */
.snt__mobile-menu {
  transition: transform 0.4s var(--ease-transition-2), opacity 0.4s var(--ease-transition-2);
  opacity: 0;
}

/* Active state - slide down into view */
.snt__mobile-menu.snt__mobile-menu--active {
  transform: translateY(0) !important;
  opacity: 1 !important;
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
  overflow: hidden !important;
}
