/* ============================================
   Saf Foil — Animacije i tranzicije
   ============================================ */

/* Animacije prilikom učitavanja */
@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(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Klase za JS animacije */
.animate {
  opacity: 0;
}

.animate.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.animate.fade-up {
  animation: fadeInUp 0.6s ease forwards;
}

.animate.fade-down {
  animation: fadeInDown 0.6s ease forwards;
}

.animate.scale-in {
  animation: scaleIn 0.5s ease forwards;
}

/* Kašnjenja za stagger efekte */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

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

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

/* Hero animacije */
.hero-content > * {
  opacity: 0;
  transform: translateY(18px);
  animation: fadeInUp 0.7s ease forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.15s; }
.hero-content > *:nth-child(2) { animation-delay: 0.35s; }
.hero-content > *:nth-child(3) { animation-delay: 0.55s; }
.hero-content > *:nth-child(4) { animation-delay: 0.75s; }

.hero-image-wrapper {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease 0.3s forwards;
}

@media (prefers-reduced-motion: reduce) {
  .hero-content > *,
  .hero-image-wrapper {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Header scroll efekat */
.site-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Fokus stilovi za pristupačnost */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Smooth reveal sekcija */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Kartice zadržavaju hover tranziciju uz reveal */
.category-card.reveal {
  transition: transform 0.35s ease, box-shadow 0.35s ease, opacity 0.6s ease;
}

@media (prefers-reduced-motion: reduce) {
  .category-card.reveal {
    transition: none;
  }
}

/* Loader za formu */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
