/**
 * Favania Block Theme - Animations
 * انیمیشن‌های CSS برای تمام بخش‌ها
 */

/* ==========================================
   KEYFRAMES
   ========================================== */

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

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  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 scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

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

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

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

/* ==========================================
   HERO SLIDER ANIMATIONS
   ========================================== */

.favania-hero-slider-wrapper {
  overflow: hidden;
}

.favania-slide-fallback {
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.favania-slide-fallback.animating {
  animation: fadeIn 0.8s ease-out;
}

/* Slide content animations */
.favania-slide-fallback > div:last-child {
  animation: fadeInUp 1s ease-out 0.3s both;
}

.favania-slide-fallback h1 {
  animation: fadeInUp 1s ease-out 0.5s both;
}

.favania-slide-fallback p {
  animation: fadeInUp 1s ease-out 0.7s both;
}

.favania-slide-fallback a {
  animation: fadeInUp 1s ease-out 0.9s both;
  transition: all 0.3s ease;
}

.favania-slide-fallback a:hover {
  transform: scale(1.05);
  background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Slider arrows */
.slider-arrow {
  transition: all 0.3s ease !important;
}

.slider-arrow:hover {
  transform: translateY(-50%) scale(1.1) !important;
  background: rgba(255, 255, 255, 0.3) !important;
}

/* Slider dots */
.slider-dot {
  transition: all 0.3s ease !important;
}

.slider-dot:hover {
  transform: scale(1.2);
}

.slider-dot.active {
  transform: scale(1.2);
}

/* ==========================================
   APPLICATIONS SECTION ANIMATIONS
   ========================================== */

.favania-applications-wrapper {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.favania-applications-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.application-card-static {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transform-origin: center;
}

.application-card-static:hover {
  transform: scale(1.03) translateY(-5px) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.application-card-static.active {
  animation: pulse 2s infinite;
}

.large-preview-static {
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.large-preview-static img {
  transition: all 0.8s ease-out;
}

/* ==========================================
   COLLECTIONS SECTION ANIMATIONS
   ========================================== */

.favania-collections-wrapper {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.favania-collections-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.collection-card-static {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow: hidden;
}

.collection-card-static:hover {
  transform: scale(1.02) translateY(-8px) !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.collection-card-static img {
  transition: transform 0.6s ease-out;
}

.collection-card-static:hover img {
  transform: scale(1.1);
}

.collection-card-static .card-content {
  transition: all 0.3s ease;
}

.collection-card-static:hover .card-content {
  background: rgba(0, 0, 0, 0.7);
}

/* ==========================================
   STATS SECTION ANIMATIONS
   ========================================== */

.favania-stats-wrapper {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.favania-stats-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.stat-item-static {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.favania-stats-wrapper.visible .stat-item-static {
  opacity: 1;
  transform: translateY(0);
}

.favania-stats-wrapper.visible .stat-item-static:nth-child(1) {
  transition-delay: 0.1s;
}
.favania-stats-wrapper.visible .stat-item-static:nth-child(2) {
  transition-delay: 0.2s;
}
.favania-stats-wrapper.visible .stat-item-static:nth-child(3) {
  transition-delay: 0.3s;
}
.favania-stats-wrapper.visible .stat-item-static:nth-child(4) {
  transition-delay: 0.4s;
}

.stat-value-static {
  transition: all 0.3s ease;
}

/* ==========================================
   EVENTS SECTION ANIMATIONS
   ========================================== */

.favania-events-wrapper {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.favania-events-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.event-card-static {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow: hidden;
}

.event-card-static:hover {
  transform: translateY(-10px) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.event-card-static img {
  transition: transform 0.6s ease-out !important;
}

.event-card-static:hover img {
  transform: scale(1.08) !important;
}

/* ==========================================
   MAGAZINE SECTION ANIMATIONS
   ========================================== */

.favania-magazine-wrapper {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.favania-magazine-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.magazine-card-static {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow: hidden;
}

.magazine-card-static:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.magazine-card-static img {
  transition: transform 0.5s ease-out;
}

.magazine-card-static:hover img {
  transform: scale(1.05);
}

/* ==========================================
   FAQ SECTION ANIMATIONS
   ========================================== */

.favania-faq-wrapper {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.favania-faq-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.faq-item-static {
  transition: all 0.3s ease;
}

.faq-item-static:hover {
  background: rgba(255, 255, 255, 0.05);
}

.faq-question-static {
  transition: all 0.3s ease;
  cursor: pointer;
}

.faq-question-static:hover {
  color: #ccfff3;
}

.faq-answer-static {
  transition:
    max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease-out,
    padding 0.3s ease;
  overflow: hidden;
}

/* ==========================================
   ABOUT SECTION ANIMATIONS
   ========================================== */

.favania-about-wrapper {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.favania-about-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.favania-about-wrapper button,
.favania-about-wrapper a {
  transition: all 0.3s ease !important;
}

.favania-about-wrapper button:hover,
.favania-about-wrapper a:hover {
  transform: scale(1.05) !important;
}

/* ==========================================
   SCROLL REVEAL ANIMATIONS
   ========================================== */

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

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

[data-animate="fade-left"] {
  transform: translateX(-30px);
}

[data-animate="fade-left"].visible {
  transform: translateX(0);
}

[data-animate="fade-right"] {
  transform: translateX(30px);
}

[data-animate="fade-right"].visible {
  transform: translateX(0);
}

[data-animate="scale"] {
  transform: scale(0.9);
}

[data-animate="scale"].visible {
  transform: scale(1);
}

/* ==========================================
   BUTTON ANIMATIONS
   ========================================== */

button,
a.btn,
.btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:active,
a.btn:active,
.btn:active {
  transform: scale(0.95);
}

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

img {
  transition: opacity 0.3s ease;
}

img[loading="lazy"] {
  opacity: 0;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* ==========================================
   REDUCED MOTION
   ========================================== */

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

/* ==========================================
   ICON WRAPPER STYLES
   ========================================== */

.icon-wrapper {
  transition: all 0.3s ease;
}

.icon-wrapper:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.2);
}

.icon-wrapper svg {
  stroke: currentColor;
}

/* Collection arrow icon hover effect */
.collection-icon-circle {
  transition: all 0.3s ease;
}

.collection-card-static:hover .collection-icon-circle {
  transform: scale(1.15) rotate(-45deg);
  background: rgba(255, 255, 255, 0.3);
}

/* Header icon animation on section visible */
.favania-collections-wrapper.visible .icon-wrapper,
.favania-applications-wrapper.visible .icon-wrapper,
.favania-stats-wrapper.visible .icon-wrapper,
.favania-events-wrapper.visible .icon-wrapper,
.favania-magazine-wrapper.visible .icon-wrapper,
.favania-faq-wrapper.visible .icon-wrapper {
  animation: scaleIn 0.6s ease-out 0.2s both;
}

/* ==========================================
   LINE CLAMP UTILITY
   ========================================== */

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

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

.group:hover .group-hover\:scale-110 {
  transform: scale(1.1);
}

.group:hover .group-hover\:text-white\/90 {
  color: rgba(255, 255, 255, 0.9);
}

.group:hover .group-hover\:bg-white\/20 {
  background: rgba(255, 255, 255, 0.2);
}

.group:hover .group-hover\:scale-110 {
  transform: scale(1.1);
}
