/*
 * Dr. Rakesh Pannu - Premium Medical Website
 * Animations & Effects
 * Version: 1.0.0
 */

/* ========================================
   KEYFRAME ANIMATIONS
   ======================================== */

/* Fade In */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Zoom In */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* Pulse */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Subtle Pulse */
@keyframes subtlePulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

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

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

/* Gradient Shift */
@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Bounce */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

/* Shake */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* ========================================
   SCROLL REVEAL CLASSES
   ======================================== */

/* Base reveal class */
[data-reveal] {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].revealed {
  opacity: 1;
  transform: none !important;
}

/* Reveal Fade Up */
[data-reveal="fade-up"] {
  transform: translateY(40px);
}

/* Reveal Fade Down */
[data-reveal="fade-down"] {
  transform: translateY(-40px);
}

/* Reveal Fade Left */
[data-reveal="fade-left"] {
  transform: translateX(-40px);
}

/* Reveal Fade Right */
[data-reveal="fade-right"] {
  transform: translateX(40px);
}

/* Reveal Zoom */
[data-reveal="zoom"] {
  transform: scale(0.9);
}

/* Reveal Delay Classes */
[data-reveal-delay="100"] {
  transition-delay: 100ms;
}

[data-reveal-delay="200"] {
  transition-delay: 200ms;
}

[data-reveal-delay="300"] {
  transition-delay: 300ms;
}

[data-reveal-delay="400"] {
  transition-delay: 400ms;
}

[data-reveal-delay="500"] {
  transition-delay: 500ms;
}

[data-reveal-delay="600"] {
  transition-delay: 600ms;
}

/* ========================================
   HOVER ANIMATIONS
   ======================================== */

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

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Hover Scale */
.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.03);
}

/* Hover Shine */
.hover-shine {
  position: relative;
  overflow: hidden;
}

.hover-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.hover-shine:hover::before {
  left: 100%;
}

/* Hover Glow */
.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

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

/* Button Ripple Effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

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

/* Arrow Animation */
.arrow-animate svg {
  transition: transform 0.3s ease;
}

.arrow-animate:hover svg {
  transform: translateX(5px);
}

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

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-200) 25%,
    var(--gray-100) 50%,
    var(--gray-200) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-text {
  height: 1em;
  border-radius: var(--rounded);
  margin-bottom: 0.5em;
}

.skeleton-heading {
  height: 2em;
  width: 60%;
  border-radius: var(--rounded);
  margin-bottom: 1em;
}

.skeleton-image {
  padding-top: 60%;
  border-radius: var(--rounded-lg);
}

/* Dots Loading */
.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background-color: var(--gold-500);
  border-radius: 50%;
  animation: loadingDots 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
  animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes loadingDots {
  0%, 80%, 100% {
    transform: scale(0.5);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========================================
   PARALLAX EFFECTS
   ======================================== */

.parallax-bg {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* For mobile - disable parallax */
@media (max-width: 768px) {
  .parallax-bg {
    background-attachment: scroll;
  }
}

/* Parallax Container */
.parallax-container {
  overflow: hidden;
  position: relative;
}

.parallax-element {
  will-change: transform;
}

/* ========================================
   COUNTER ANIMATION
   ======================================== */

.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.counter[data-target] {
  opacity: 1;
}

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

/* Image Zoom on Hover */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 0.5s ease;
}

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

/* Image Reveal */
.img-reveal {
  position: relative;
  overflow: hidden;
}

.img-reveal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--navy-900);
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.img-reveal.revealed::after {
  transform: scaleX(0);
}

/* ========================================
   TEXT ANIMATIONS
   ======================================== */

/* Text Slide Up */
.text-slide-up {
  overflow: hidden;
}

.text-slide-up span {
  display: inline-block;
  transform: translateY(100%);
  animation: slideUp 0.6s ease forwards;
}

/* Typewriter Effect */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--gold-500);
  white-space: nowrap;
  animation:
    typing 3.5s steps(40, end),
    blinkCaret 0.75s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blinkCaret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--gold-500);
  }
}

/* ========================================
   NOTIFICATION ANIMATIONS
   ======================================== */

/* Toast Slide In */
.toast-enter {
  animation: toastEnter 0.3s ease forwards;
}

.toast-exit {
  animation: toastExit 0.3s ease forwards;
}

@keyframes toastEnter {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastExit {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ========================================
   MODAL ANIMATIONS
   ======================================== */

/* Modal Backdrop */
.modal-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-backdrop.show {
  opacity: 1;
}

/* Modal Content */
.modal-content {
  opacity: 0;
  transform: scale(0.95) translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal-backdrop.show .modal-content {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ========================================
   MENU ANIMATIONS
   ======================================== */

/* Mobile Menu Slide */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-menu.open {
  transform: translateX(0);
}

/* Menu Item Stagger */
.mobile-menu .nav-link {
  opacity: 0;
  transform: translateX(20px);
}

.mobile-menu.open .nav-link {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu.open .nav-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.open .nav-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.open .nav-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.open .nav-link:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.open .nav-link:nth-child(5) { transition-delay: 0.3s; }
.mobile-menu.open .nav-link:nth-child(6) { transition-delay: 0.35s; }

/* ========================================
   ACCORDION ANIMATIONS
   ======================================== */

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-content {
  max-height: 500px;
}

.accordion-icon {
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

/* ========================================
   PROGRESS ANIMATIONS
   ======================================== */

.progress-bar {
  width: 0;
  transition: width 1s ease;
}

.progress-bar.animated {
  width: var(--progress);
}

/* Circular Progress */
.circular-progress {
  transform: rotate(-90deg);
}

.circular-progress circle {
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 1s ease;
}

.circular-progress.animated circle {
  stroke-dashoffset: calc(283 - (283 * var(--progress)) / 100);
}

/* ========================================
   DECORATIVE ELEMENTS
   ======================================== */

/* Floating Shapes */
.floating-shape {
  position: absolute;
  animation: float 6s ease-in-out infinite;
}

.floating-shape:nth-child(2) {
  animation-delay: -2s;
}

.floating-shape:nth-child(3) {
  animation-delay: -4s;
}

/* Gradient Background Animation */
.animated-gradient {
  background: linear-gradient(
    -45deg,
    var(--navy-900),
    var(--navy-700),
    var(--navy-800),
    var(--navy-900)
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

/* Gold Shimmer Text */
.gold-shimmer {
  background: linear-gradient(
    90deg,
    var(--gold-600),
    var(--gold-400),
    var(--gold-600)
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

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

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

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .parallax-bg {
    background-attachment: scroll;
  }
}
