/* Interactive Animations for MTK Investment Website
   Enhanced body animations for improved interactivity
   Author: Cline
   Version: 1.0 */

/* CSS Custom Properties for Animation Control */
:root {
  --primary-color: #a6c03a;
  --secondary-color: #ad1f24;
  --text-color: #777;
  --heading-color: #a6c03a;
  --transition-speed: 0.3s;
  --bounce-height: 5px;
  --glow-intensity: 0 0 15px rgba(166, 192, 58, 0.4);
}

/* Skip animations if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Enhanced Body Animations */

/* 1. Enhanced Section Transitions */
section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

section.animated {
  opacity: 1;
  transform: translateY(0);
}

/* 2. Parallax Scrolling Effects */
.parallax-layer {
  will-change: transform;
  transition: transform 0.1s ease-out;
}

/* 3. Enhanced Typography Animations */
h1, h2, h3, h4, h5, h6 {
  position: relative;
  overflow: hidden;
}

h1 span, h2 span, h3 span, h4 span, h5 span, h6 span {
  display: inline-block;
  transform: translateY(100%);
  animation: slideInUp 0.8s ease forwards;
}

h1 span:nth-child(1) { animation-delay: 0.1s; }
h1 span:nth-child(2) { animation-delay: 0.2s; }
h1 span:nth-child(3) { animation-delay: 0.3s; }
h1 span:nth-child(4) { animation-delay: 0.4s; }
h1 span:nth-child(5) { animation-delay: 0.5s; }

/* 4. Enhanced Button Interactions */
.btn, .button, .wprt-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn:hover, .button:hover, .wprt-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.2);
  filter: brightness(1.05);
}

.btn:active, .button:active, .wprt-button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Button Ripple Effect */
.btn::after, .button::after, .wprt-button::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  width: 100px;
  height: 100px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0);
  transition: transform 0.6s, opacity 0.6s;
}

.btn:active::after, .button:active::after, .wprt-button:active::after {
  transform: scale(2.5);
  opacity: 0;
  transition: 0s;
}

/* 5. Enhanced Card Animations */
.card, .service-box, .client-card, .team-member, .portfolio-item {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateY(0) scale(1);
  will-change: transform;
}

.card:hover, .service-box:hover, .client-card:hover, .team-member:hover, .portfolio-item:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

/* 6. Image Hover Effects */
img {
  transition: all 0.3s ease;
  transform: scale(1);
}

img:hover {
  transform: scale(1.05);
  filter: brightness(1.1) saturate(1.1);
}

/* 7. Text Highlight Animations */
.highlight, .accent-text {
  position: relative;
  display: inline-block;
}

.highlight::after, .accent-text::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.highlight:hover::after, .accent-text:hover::after {
  width: 100%;
}

/* 8. Floating Animations */
.floating {
  animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

/* 9. Pulse Animations */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* 10. Typewriter Effect */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--primary-color);
  white-space: nowrap;
  margin: 0 auto;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--primary-color); }
}

/* 11. Staggered Animations */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-item.animated {
  animation: staggerFadeIn 0.6s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }
.stagger-item:nth-child(7) { animation-delay: 0.7s; }
.stagger-item:nth-child(8) { animation-delay: 0.8s; }
.stagger-item:nth-child(9) { animation-delay: 0.9s; }
.stagger-item:nth-child(10) { animation-delay: 1.0s; }

@keyframes staggerFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 12. Enhanced Form Interactions */
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, textarea:focus, select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(166, 192, 58, 0.1);
  transform: translateY(-2px);
}

/* 13. Social Media Hover Effects */
.social-icons a, .social-links a {
  transition: all 0.3s ease;
  transform: translateY(0);
}

.social-icons a:hover, .social-links a:hover {
  transform: translateY(-3px) scale(1.1);
  filter: brightness(1.2);
}


/* 15. Progress Bar Animations */
.progress-bar {
  width: 0%;
  transition: width 2s ease-in-out;
}

.progress-bar.animated {
  width: var(--progress-width);
}

/* 16. Counter Animations */
.counter-value {
  font-size: 2.5em;
  font-weight: bold;
  color: var(--primary-color);
  display: inline-block;
  transition: transform 0.3s ease;
}

.counter-value:hover {
  transform: scale(1.1) rotate(5deg);
}

/* 17. Modal Animations */
.modal {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.3s ease;
}

.modal.show {
  opacity: 1;
  transform: scale(1);
}

/* 18. Tooltip Animations */
.tooltip {
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

/* 19. Enhanced Background Effects */
.bg-gradient-hover {
  transition: background 0.5s ease;
}

.bg-gradient-hover:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
}

/* 20. Scroll Progress Indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: var(--primary-color);
  z-index: 9999;
  transition: width 0.1s ease;
}

/* 21. Enhanced Gallery Effects */
.gallery-item {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover {
  transform: scale(1.05) rotate(2deg);
  z-index: 10;
}

/* 22. Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}

.loading-overlay.hide {
  opacity: 0;
  pointer-events: none;
}

/* 23. Enhanced Scroll Reveal */
.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* 24. Enhanced Feature Box Animations */
.feature-box {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateY(0);
}

.feature-box:hover {
  transform: translateY(-15px) scale(1.03);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* 25. Enhanced Statistics Animations */
.statistic-item {
  transition: all 0.3s ease;
}

.statistic-item:hover {
  transform: scale(1.1);
  color: var(--primary-color);
}

/* 26. Enhanced Timeline Animations */
.timeline-item {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.6s ease;
}

.timeline-item.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* 27. Enhanced Pricing Table Animations */
.pricing-table {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pricing-table:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* 28. Enhanced Testimonial Animations */
.testimonial-item {
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.4s ease;
}

.testimonial-item.active {
  opacity: 1;
  transform: scale(1);
}

/* 29. Enhanced Map Interactions */
.map-container {
  transition: transform 0.3s ease;
}

.map-container:hover {
  transform: scale(1.02);
}

/* 30. Enhanced Footer Animations */
.footer-widget {
  transition: all 0.3s ease;
}

.footer-widget:hover {
  transform: translateY(-5px);
  filter: brightness(1.1);
}

/* Utility Classes for Easy Implementation */

/* Animation Triggers */
.fade-in { animation: fadeIn 0.8s ease forwards; }
.slide-up { animation: slideInUp 0.8s ease forwards; }
.slide-left { animation: slideInLeft 0.8s ease forwards; }
.slide-right { animation: slideInRight 0.8s ease forwards; }
.zoom-in { animation: zoomIn 0.8s ease forwards; }
.bounce { animation: bounce 0.6s ease; }
.shake { animation: shake 0.5s ease; }
.rotate { animation: rotateIn 0.8s ease forwards; }

/* Animation Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-var(--bounce-height)); }
  60% { transform: translateY(-var(--bounce-height) * 0.5); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
  20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .floating {
    animation: floating 4s ease-in-out infinite;
  }
  
  .card:hover, .service-box:hover, .client-card:hover {
    transform: translateY(-5px) scale(1.01);
  }
  
  .feature-box:hover {
    transform: translateY(-8px) scale(1.02);
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .btn:hover, .button:hover, .wprt-button:hover {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
  }
  
  .card:hover, .service-box:hover {
    outline: 2px solid var(--secondary-color);
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #ddd;
    --glow-intensity: 0 0 15px rgba(166, 192, 58, 0.6);
  }
  
  .btn:hover {
    box-shadow: var(--glow-intensity);
  }
}