/* 
 * Dizajnira Luce - Animations CSS
 * This file contains animations and transitions
 */

/* Global animation definitions */
@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 rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: rotate(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* Animation classes */
.animated {
  animation-duration: 1s;
  animation-fill-mode: both;
}

.animated.infinite {
  animation-iteration-count: infinite;
}

.animated.delay-1s {
  animation-delay: 1s;
}

.animated.delay-2s {
  animation-delay: 2s;
}

.animated.delay-3s {
  animation-delay: 3s;
}

.animated.fast {
  animation-duration: 0.6s;
}

.animated.faster {
  animation-duration: 0.3s;
}

.animated.slow {
  animation-duration: 1.5s;
}

.animated.slower {
  animation-duration: 2s;
}

/* Animation classes with keyframes */
.fade-in {
  animation-name: fadeIn;
}

.fade-in-up {
  animation-name: fadeInUp;
}

.fade-in-down {
  animation-name: fadeInDown;
}

.fade-in-left {
  animation-name: fadeInLeft;
}

.fade-in-right {
  animation-name: fadeInRight;
}

.scale-in {
  animation-name: scaleIn;
}

.rotate-in {
  animation-name: rotateIn;
}

.pulse {
  animation-name: pulse;
}

.float {
  animation-name: float;
}

/* Scroll animation classes */
.fade-on-scroll,
.fade-up-on-scroll,
.fade-down-on-scroll,
.fade-left-on-scroll,
.fade-right-on-scroll {
  opacity: 0;
  transition: all 0.8s ease;
}

.fade-on-scroll.appear {
  opacity: 1;
}

.fade-up-on-scroll {
  transform: translateY(30px);
}

.fade-up-on-scroll.appear {
  opacity: 1;
  transform: translateY(0);
}

.fade-down-on-scroll {
  transform: translateY(-30px);
}

.fade-down-on-scroll.appear {
  opacity: 1;
  transform: translateY(0);
}

.fade-left-on-scroll {
  transform: translateX(-30px);
}

.fade-left-on-scroll.appear {
  opacity: 1;
  transform: translateX(0);
}

.fade-right-on-scroll {
  transform: translateX(30px);
}

.fade-right-on-scroll.appear {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered animations */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.stagger-item.appear {
  opacity: 1;
  transform: translateY(0);
}

.stagger-item:nth-child(1) {
  transition-delay: 0.1s;
}

.stagger-item:nth-child(2) {
  transition-delay: 0.2s;
}

.stagger-item:nth-child(3) {
  transition-delay: 0.3s;
}

.stagger-item:nth-child(4) {
  transition-delay: 0.4s;
}

.stagger-item:nth-child(5) {
  transition-delay: 0.5s;
}

.stagger-item:nth-child(6) {
  transition-delay: 0.6s;
}

/* Hover animations */
.hover-lift {
  transition: transform 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-rotate {
  transition: transform 0.3s ease;
}

.hover-rotate:hover {
  transform: rotate(3deg);
}

/* Text animations */
.text-reveal {
  position: relative;
  overflow: hidden;
}

.text-reveal span {
  display: block;
  transform: translateY(100%);
  transition: transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.text-reveal.revealed span {
  transform: translateY(0);
}

/* Hero image animations */
.hero-slide {
  transform: scale(1.1);
  transition: transform 10s ease, opacity 1s ease;
}

.hero-slide.active {
  transform: scale(1);
}

/* Service card animations */
.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease,
    background-color 0.3s ease;
}

.service-icon {
  transition: transform 0.3s ease, color 0.3s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.1);
}

/* Portfolio item animations */
.portfolio-item {
  transition: all 0.3s ease;
}

.portfolio-item.hidden {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

/* Testimonial animations */
@keyframes testimonialFadeIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.testimonial-slide {
  animation: testimonialFadeIn 0.5s ease forwards;
}

/* Button animations */
.btn {
  overflow: hidden;
  position: relative;
}

.btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::after {
  width: 200%;
  height: 200%;
}

/* Logo animations */
.logo-shape {
  transition: transform 0.3s ease;
}

.logo:hover .logo-shape {
  transform: translate(-50%, -50%) rotate(45deg) scale(1.1);
}

/* Process step animations */
.process-number {
  transition: all 0.3s ease;
}

.process-step:hover .process-number {
  transform: scale(1.1);
  color: var(--color-accent-dark);
  box-shadow: var(--shadow-md);
}

/* Logo Styling and Animation */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-text);
  transition: color var(--transition-fast);
}

.logo:hover {
  color: var(--color-accent);
}

.logo-icon {
  position: relative;
  width: 40px;
  height: 40px;
  margin-right: 12px;
}

.logo-house {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.logo-house-line {
  fill: none;
  stroke: var(--color-text);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawLine 1.5s forwards;
}

.logo-text {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  letter-spacing: 0.03em;
  opacity: 0;
  animation: fadeIn 0.5s forwards 1s;
}

.logo-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px);
}

.logo-text span:nth-child(1) {
  animation: fadeUpChar 0.3s forwards 1.1s;
}
.logo-text span:nth-child(2) {
  animation: fadeUpChar 0.3s forwards 1.15s;
}
.logo-text span:nth-child(3) {
  animation: fadeUpChar 0.3s forwards 1.2s;
}
.logo-text span:nth-child(4) {
  animation: fadeUpChar 0.3s forwards 1.25s;
}
.logo-text span:nth-child(5) {
  animation: fadeUpChar 0.3s forwards 1.3s;
}
.logo-text span:nth-child(6) {
  animation: fadeUpChar 0.3s forwards 1.35s;
}
.logo-text span:nth-child(7) {
  animation: fadeUpChar 0.3s forwards 1.4s;
}
.logo-text span:nth-child(8) {
  animation: fadeUpChar 0.3s forwards 1.45s;
}
.logo-text span:nth-child(9) {
  animation: fadeUpChar 0.3s forwards 1.5s;
}
.logo-text span:nth-child(10) {
  animation: fadeUpChar 0.3s forwards 1.55s;
}
.logo-text span:nth-child(11) {
  animation: fadeUpChar 0.3s forwards 1.6s;
}
.logo-text span:nth-child(12) {
  animation: fadeUpChar 0.3s forwards 1.65s;
}
.logo-text span:nth-child(13) {
  animation: fadeUpChar 0.3s forwards 1.7s;
}

.logo-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  letter-spacing: 0.05em;
  margin-left: 5px;
  opacity: 0;
  animation: fadeIn 0.5s forwards 1.8s;
}

/* Logo animations */
@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes fadeUpChar {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dark theme adjustments */
[data-theme="dark"] .logo-house-line {
  stroke: var(--color-white);
}

/* Footer logo adjustments */
.footer-logo .logo-house-line {
  stroke: var(--color-white);
}

.footer-logo .logo-text,
.footer-logo .logo-subtitle {
  color: var(--color-white);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .logo-icon {
    width: 32px;
    height: 32px;
    margin-right: 8px;
  }

  .logo-text {
    font-size: var(--font-size-lg);
  }

  .logo-subtitle {
    font-size: var(--font-size-xs);
  }
}
