/* 
 * ANIMATIONS & TRANSITIONS
 * Smooth, professional animations
 */

/* =============== KEYFRAME ANIMATIONS =============== */

/* Float animation for decorative elements */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(30px);
  }
}

/* Slide in from bottom */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from top */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade in */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Fade out */
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Zoom in */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Zoom out */
@keyframes zoomOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Zoom in large */
@keyframes zoomInLarge {
  from {
    opacity: 0;
    transform: scale(1.1);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Zoom out large */
@keyframes zoomOutLarge {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.1);
  }
}

/* Bounce */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Pulse */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Shake */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* Rotate */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Spin (for loading) */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Counter/number animation */
@keyframes countUp {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Glow effect */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px var(--primary-green);
  }
  50% {
    box-shadow: 0 0 20px var(--primary-green);
  }
}

/* Shimmer effect */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* =============== SCROLL REVEAL ANIMATIONS =============== */

.reveal {
  opacity: 0;
  animation: slideInUp 0.8s ease forwards;
}

.reveal.active {
  animation-play-state: running;
}

.reveal-left {
  opacity: 0;
  animation: slideInLeft 0.8s ease forwards;
}

.reveal-right {
  opacity: 0;
  animation: slideInRight 0.8s ease forwards;
}

.reveal-zoom {
  opacity: 0;
  animation: zoomIn 0.8s ease forwards;
}

/* Stagger animation for multiple elements */
.grid.reveal-stagger > .card:nth-child(1) {
  animation-delay: 0s;
}

.grid.reveal-stagger > .card:nth-child(2) {
  animation-delay: 0.2s;
}

.grid.reveal-stagger > .card:nth-child(3) {
  animation-delay: 0.4s;
}

.grid.reveal-stagger > .card:nth-child(4) {
  animation-delay: 0.6s;
}

.grid.reveal-stagger > .card:nth-child(5) {
  animation-delay: 0.8s;
}

.grid.reveal-stagger > .card:nth-child(6) {
  animation-delay: 1s;
}

/* =============== HOVER ANIMATIONS =============== */

/* Card hover lift */
.card-hover {
  transition: var(--transition);
}

.card-hover:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

/* Button animations */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

/* Link hover effect */
a.link-underline {
  position: relative;
  color: var(--primary-green);
}

a.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-green);
  transition: width 0.3s ease;
}

a.link-underline:hover::after {
  width: 100%;
}

/* =============== TEXT ANIMATIONS =============== */

/* Typewriter effect */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--primary-green);
  white-space: nowrap;
  animation: typewriter 3.5s steps(40, end);
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Blinking cursor */
.blink-cursor {
  animation: blink 0.7s infinite;
}

@keyframes blink {
  0%, 49% {
    border-right-color: var(--primary-green);
  }
  50%, 100% {
    border-right-color: transparent;
  }
}

/* =============== LOADING ANIMATIONS =============== */

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    #e0e0e0 25%,
    #f0f0f0 50%,
    #e0e0e0 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Dot animation (loading indicator) */
.dots {
  display: inline-flex;
  gap: 4px;
}

.dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-green);
  animation: bounce 1.4s infinite;
}

.dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* =============== SLIDER ANIMATIONS =============== */

.slider-fade {
  animation: fadeIn 0.5s ease;
}

.slider-slide-left {
  animation: slideInLeft 0.5s ease;
}

.slider-slide-right {
  animation: slideInRight 0.5s ease;
}

/* Slide pagination dots animation */
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: var(--transition);
  display: inline-block;
  margin: 0 6px;
}

.dot.active {
  background: var(--primary-green);
  transform: scale(1.3);
}

/* =============== FORM ANIMATIONS =============== */

/* Input focus animation */
input:focus,
textarea:focus,
select:focus {
  animation: pulse 0.6s ease-out;
}

/* Form shake on error */
.input-error {
  animation: shake 0.4s ease;
  border-color: #cc3333 !important;
}

/* Success checkmark animation */
.form-success::after {
  content: '✓';
  color: #33cc33;
  font-weight: bold;
  margin-left: 10px;
  animation: slideInRight 0.3s ease;
}

/* =============== SECTION ANIMATIONS =============== */

/* Section fade-in on load */
section.fade-in {
  animation: fadeIn 1s ease;
}

section.slide-in-up {
  animation: slideInUp 1s ease;
}

section.slide-in-left {
  animation: slideInLeft 1s ease;
}

section.slide-in-right {
  animation: slideInRight 1s ease;
}

/* =============== MODAL ANIMATIONS =============== */

.modal.fade-in {
  animation: fadeIn 0.3s ease;
}

.modal-content.slide-in {
  animation: slideInUp 0.3s ease;
}

/* =============== IMAGE ANIMATIONS =============== */

img.lazy-load {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

.image-zoom {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.image-zoom img {
  transition: var(--transition);
}

.image-zoom:hover img {
  transform: scale(1.1);
}

/* =============== BADGE & LABEL ANIMATIONS =============== */

.badge-pulse {
  animation: pulse 2s infinite;
}

.badge-glow {
  animation: glow 2s infinite;
}

/* =============== COUNTER ANIMATION =============== */

.counter {
  animation: countUp 1s ease;
}

/* =============== STAR RATING ANIMATION =============== */

.star {
  display: inline-block;
  color: var(--accent-orange);
  transition: var(--transition);
}

.star:hover {
  animation: bounce 0.6s ease;
}

/* =============== PROGRESS BAR ANIMATION =============== */

.progress-bar {
  animation: slideInLeft 1s ease;
}

.progress-bar-animated {
  background: linear-gradient(
    90deg,
    var(--primary-green),
    var(--accent-orange),
    var(--primary-green)
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* =============== NOTIFICATION ANIMATIONS =============== */

.notification {
  animation: slideInDown 0.4s ease;
}

.notification.fade-out {
  animation: fadeOut 0.4s ease forwards;
}

/* =============== DELAY UTILITIES =============== */

.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; }

/* =============== ANIMATION SPEED UTILITIES =============== */

.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.6s; }
.duration-slow { animation-duration: 1s; }
.duration-slower { animation-duration: 1.5s; }

/* =============== SCROLL-TRIGGERED ANIMATIONS =============== */

.animate-on-scroll {
  opacity: 0;
}

.animate-on-scroll.in-view {
  animation: slideInUp 0.8s ease forwards;
}

/* =============== SMOOTH SCROLL BEHAVIOR =============== */

html {
  scroll-behavior: smooth;
}

/* =============== PARALLAX EFFECT =============== */

.parallax {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* =============== TRANSITION UTILITIES =============== */

.transition-fast {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-normal {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-slow {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============== VISIBILITY ANIMATIONS =============== */

.fade-in-up {
  animation: slideInUp 0.8s ease forwards;
}

.fade-in-down {
  animation: slideInDown 0.8s ease forwards;
}

.fade-in-left {
  animation: slideInLeft 0.8s ease forwards;
}

.fade-in-right {
  animation: slideInRight 0.8s ease forwards;
}

.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.zoom-in {
  animation: zoomIn 0.8s ease forwards;
}
