/* Advanced Micro-Animations for The Aesthetic Touch */

/* ========================================
   7. SCROLL-TRIGGERED ANIMATIONS
======================================== */

/* Progress Ring Indicators */
.progress-ring {
  transition: stroke-dashoffset 0.5s ease-in-out;
  transform-origin: 50% 50%;
}

.progress-ring-circle {
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-ring.animate {
  animation: rotateProgress 2s ease-in-out;
}

@keyframes rotateProgress {
  0% {
    transform: rotate(-90deg);
  }
  100% {
    transform: rotate(270deg);
  }
}

/* Floating Elements */
.float-element {
  animation: float 6s ease-in-out infinite;
}

.float-element-delayed {
  animation: float 6s ease-in-out infinite;
  animation-delay: -2s;
}

.float-element-slow {
  animation: floatSlow 8s ease-in-out infinite;
  animation-delay: -1s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-15px) rotate(1deg);
  }
  66% {
    transform: translateY(-5px) rotate(-1deg);
  }
}

@keyframes floatSlow {
  0%,
  100% {
    transform: translateY(0px) translateX(0px);
  }
  50% {
    transform: translateY(-20px) translateX(5px);
  }
}

/* Parallax Scroll Elements */
.parallax-element {
  transform: translateY(var(--scroll-offset, 0));
  transition: transform 0.1s ease-out;
}

/* Scroll Fade In */
.scroll-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Reveals */
.stagger-item {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.stagger-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   8. ADVANCED BUTTON STATES
======================================== */

/* Ripple Effect Buttons */
.ripple-btn {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ripple-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  pointer-events: none;
}

.ripple-btn:active::before {
  width: 300px;
  height: 300px;
}

/* Magnetic Hover Effect */
.magnetic-btn {
  transition: transform 0.2s ease-out;
  cursor: pointer;
  position: relative;
  display: inline-block;
}

.magnetic-btn:hover {
  transform: scale(1.05);
}

/* 3D Button Effect */
.btn-3d {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.15s ease;
}

.btn-3d:hover {
  transform: translateY(-2px) rotateX(15deg);
}

.btn-3d::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: inherit;
  transform: rotateX(90deg) translateZ(2px);
  transform-origin: top;
  transition: opacity 0.15s ease;
}

.btn-3d:hover::after {
  opacity: 0.8;
}

/* Glowing Button */
.glow-btn {
  position: relative;
  background: linear-gradient(45deg, #ff6b9d, #4ecdc4);
  border: none;
  border-radius: 25px;
  color: white;
  transition: all 0.3s ease;
}

.glow-btn::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #ff6b9d, #4ecdc4, #ff6b9d);
  border-radius: inherit;
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.3s ease;
  z-index: -1;
}

.glow-btn:hover::before {
  opacity: 0.7;
}

/* ========================================
   6. NAVIGATION ENHANCEMENTS
======================================== */

/* Morphing Hamburger Menu */
.menu-toggle {
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  transform: rotate(0deg);
  transition: 0.3s ease-in-out;
}

.menu-toggle span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: #333;
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: 0.25s ease-in-out;
}

.menu-toggle span:nth-child(1) {
  top: 0px;
}

.menu-toggle span:nth-child(2) {
  top: 10px;
}

.menu-toggle span:nth-child(3) {
  top: 20px;
}

.menu-toggle.active span:nth-child(1) {
  top: 10px;
  transform: rotate(135deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.menu-toggle.active span:nth-child(3) {
  top: 10px;
  transform: rotate(-135deg);
}

/* Sliding Underline Navigation */
.nav-underline {
  position: relative;
  display: inline-block;
  padding: 10px 0;
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-underline::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background: #a1886d;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
}

.nav-underline:hover::after {
  width: 100%;
}

/* Active state */
.nav-underline.active::after {
  width: 100%;
  background: #c9b18c;
}

/* Breadcrumb Animation */
.breadcrumb-item {
  position: relative;
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInBreadcrumb 0.5s ease forwards;
}

.breadcrumb-item:nth-child(1) {
  animation-delay: 0.1s;
}
.breadcrumb-item:nth-child(2) {
  animation-delay: 0.2s;
}
.breadcrumb-item:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes slideInBreadcrumb {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========================================
   4. ADVANCED HOVER STATES
======================================== */

/* Liquid Fill Effect */
.liquid-fill {
  position: relative;
  overflow: hidden;
  color: #333;
  transition: color 0.5s ease;
  z-index: 1;
}

.liquid-fill::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #ff6b9d, #4ecdc4);
  transition: top 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: -1;
}

.liquid-fill:hover {
  color: white;
}

.liquid-fill:hover::before {
  top: 0;
}

/* 3D Card Flip */
.flip-card {
  background-color: transparent;
  perspective: 1000px;
  height: 300px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.flip-card-back {
  transform: rotateY(180deg);
  background: linear-gradient(45deg, #ff6b9d, #4ecdc4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Image Zoom with Mask */
.image-zoom-mask {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.image-zoom-mask img {
  transition: transform 0.5s ease;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-zoom-mask:hover img {
  transform: scale(1.1);
}

.image-zoom-mask::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    transparent 100px,
    rgba(201, 177, 140, 0.3) 120px
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.image-zoom-mask:hover::after {
  opacity: 1;
}

/* Tilt Effect */
.tilt-element {
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

.tilt-element:hover {
  transform: perspective(1000px) rotateX(var(--rotate-x, 0deg))
    rotateY(var(--rotate-y, 0deg)) scale(1.05);
}

/* Morphing Shapes */
.morph-shape {
  width: 100px;
  height: 100px;
  background: linear-gradient(45deg, #ff6b9d, #4ecdc4);
  border-radius: 20px;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: pointer;
}

.morph-shape:hover {
  border-radius: 50px;
  transform: rotate(45deg) scale(1.1);
  background: linear-gradient(45deg, #4ecdc4, #ff6b9d);
}

/* Glitch Effect */
.glitch-text {
  position: relative;
  color: #333;
  font-weight: bold;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.glitch-text::before {
  color: #ff6b9d;
  animation: glitch-1 0.3s ease-in-out;
}

.glitch-text::after {
  color: #4ecdc4;
  animation: glitch-2 0.3s ease-in-out;
}

.glitch-text:hover::before,
.glitch-text:hover::after {
  opacity: 1;
}

@keyframes glitch-1 {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
  100% {
    transform: translate(0);
  }
}

@keyframes glitch-2 {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(2px, -2px);
  }
  40% {
    transform: translate(2px, 2px);
  }
  60% {
    transform: translate(-2px, -2px);
  }
  80% {
    transform: translate(-2px, 2px);
  }
  100% {
    transform: translate(0);
  }
}

/* ========================================
   FLOATING BACKGROUND ANIMATIONS
======================================== */

/* Floating shapes for different sections */
.floating-bg {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.floating-bg::before,
.floating-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.25;
  pointer-events: none;
}

/* Treatments Section - Medical/Clinical theme */
.floating-bg-treatments::before {
  width: 280px;
  height: 280px;
  background: linear-gradient(135deg, #c9b18c, #a1886d);
  top: 5%;
  left: -8%;
  animation: floatTreatments 12s ease-in-out infinite;
}

.floating-bg-treatments::after {
  width: 220px;
  height: 220px;
  background: linear-gradient(45deg, #d8c9b5, #c9b18c);
  top: 55%;
  right: -6%;
  animation: floatTreatments 15s ease-in-out infinite reverse;
}

@keyframes floatTreatments {
  0%,
  100% {
    transform: translateY(0px) translateX(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-50px) translateX(35px) rotate(8deg);
  }
  66% {
    transform: translateY(-25px) translateX(-20px) rotate(-5deg);
  }
}

/* Gallery Section - Creative/Artistic theme */
.floating-bg-gallery::before {
  width: 250px;
  height: 250px;
  background: linear-gradient(60deg, #e8dfd1, #c9b18c);
  top: 10%;
  right: -7%;
  animation: floatGallery 10s ease-in-out infinite;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.floating-bg-gallery::after {
  width: 180px;
  height: 180px;
  background: linear-gradient(120deg, #f9f2ec, #e8dfd1);
  bottom: 15%;
  left: -5%;
  animation: floatGallery 14s ease-in-out infinite reverse;
  border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
}

@keyframes floatGallery {
  0%,
  100% {
    transform: translateY(0px) translateX(0px) rotate(0deg);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
  50% {
    transform: translateY(-40px) translateX(25px) rotate(15deg);
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
  }
}

/* Blog Section - Knowledge/Content theme */
.floating-bg-blog::before {
  width: 230px;
  height: 230px;
  background: linear-gradient(90deg, #c9b18c, #d8c9b5);
  top: 15%;
  left: -6%;
  animation: floatBlog 11s ease-in-out infinite;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.floating-bg-blog::after {
  width: 200px;
  height: 200px;
  background: linear-gradient(180deg, #e8dfd1, #f9f2ec);
  bottom: 10%;
  right: -7%;
  animation: floatBlog 13s ease-in-out infinite reverse;
  clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
}

@keyframes floatBlog {
  0%,
  100% {
    transform: translateY(0px) translateX(0px) rotate(0deg);
  }
  40% {
    transform: translateY(-35px) translateX(-25px) rotate(-8deg);
  }
  80% {
    transform: translateY(-20px) translateX(40px) rotate(12deg);
  }
}

/* Contact Section - Communication theme */
.floating-bg-contact::before {
  width: 300px;
  height: 300px;
  background: linear-gradient(
    45deg,
    rgba(201, 177, 140, 0.3),
    rgba(161, 136, 109, 0.3)
  );
  top: 5%;
  right: -8%;
  animation: floatContact 16s ease-in-out infinite;
  border-radius: 50% 20% 50% 20%;
}

.floating-bg-contact::after {
  width: 240px;
  height: 240px;
  background: linear-gradient(
    135deg,
    rgba(216, 201, 181, 0.25),
    rgba(232, 223, 209, 0.25)
  );
  bottom: 5%;
  left: -7%;
  animation: floatContact 12s ease-in-out infinite reverse;
  border-radius: 20% 50% 20% 50%;
}

@keyframes floatContact {
  0%,
  100% {
    transform: translateY(0px) translateX(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-25px) translateX(20px) rotate(5deg);
  }
  50% {
    transform: translateY(-45px) translateX(-15px) rotate(-4deg);
  }
  75% {
    transform: translateY(-20px) translateX(35px) rotate(7deg);
  }
}

/* Additional floating elements for variety */
.floating-dots {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.floating-dots::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  background: rgba(201, 177, 140, 0.5);
  border-radius: 50%;
  top: 25%;
  left: 15%;
  animation: floatDots 8s ease-in-out infinite;
}

.floating-dots::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: rgba(161, 136, 109, 0.4);
  border-radius: 50%;
  top: 65%;
  right: 25%;
  animation: floatDots 10s ease-in-out infinite reverse;
}

@keyframes floatDots {
  0%,
  100% {
    transform: translateY(0px) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-60px) scale(1.4);
    opacity: 0.8;
  }
}

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

/* Animation States */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease;
}

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

/* Hover Disable on Touch Devices */
@media (hover: none) and (pointer: coarse) {
  .liquid-fill:hover::before,
  .flip-card:hover .flip-card-inner,
  .image-zoom-mask:hover img,
  .tilt-element:hover,
  .morph-shape:hover {
    transform: none;
    background: inherit;
    top: inherit;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .float-element,
  .float-element-delayed,
  .float-element-slow,
  .progress-ring,
  .stagger-item,
  .ripple-btn,
  .magnetic-btn,
  .btn-3d,
  .menu-toggle,
  .nav-underline,
  .liquid-fill,
  .flip-card-inner,
  .image-zoom-mask img,
  .tilt-element,
  .morph-shape {
    animation: none !important;
    transition: none !important;
  }
}
