/* 
 * Maxwell Consultancy Ltd - Animations Stylesheet
 * Author: Maxwell Web Team
 * Version: 1.0
 */

/* ========== 1. Keyframes ========== */

/* 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(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Pulse */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Bounce */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

/* Typing Cursor */
@keyframes typingCursor {
  from {
    border-right-color: var(--primary-blue);
  }
  to {
    border-right-color: transparent;
  }
}

/* Rotate */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Float */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* ========== 2. Animation Classes ========== */

/* Fade In Animations */
.fade-in {
  animation: fadeIn 1s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 1s ease forwards;
}

.fade-in-down {
  animation: fadeInDown 1s ease forwards;
}

.fade-in-left {
  animation: fadeInLeft 1s ease forwards;
}

.fade-in-right {
  animation: fadeInRight 1s ease forwards;
}

.scale-in {
  animation: scaleIn 1s ease forwards;
}

/* Animation Delays */
.delay-100 {
  animation-delay: 100ms;
}

.delay-200 {
  animation-delay: 200ms;
}

.delay-300 {
  animation-delay: 300ms;
}

.delay-400 {
  animation-delay: 400ms;
}

.delay-500 {
  animation-delay: 500ms;
}

.delay-600 {
  animation-delay: 600ms;
}

.delay-700 {
  animation-delay: 700ms;
}

.delay-800 {
  animation-delay: 800ms;
}

.delay-900 {
  animation-delay: 900ms;
}

.delay-1000 {
  animation-delay: 1000ms;
}

/* Animation Durations */
.duration-300 {
  animation-duration: 300ms;
}

.duration-500 {
  animation-duration: 500ms;
}

.duration-700 {
  animation-duration: 700ms;
}

.duration-1000 {
  animation-duration: 1000ms;
}

.duration-1500 {
  animation-duration: 1500ms;
}

.duration-2000 {
  animation-duration: 2000ms;
}

/* ========== 3. Scroll-Triggered Animations ========== */

/* These classes are added via JavaScript when elements enter viewport */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
}

.animate-fade-up {
  transform: translateY(30px);
}

.animate-fade-up.visible {
  transform: translateY(0);
}

.animate-fade-down {
  transform: translateY(-30px);
}

.animate-fade-down.visible {
  transform: translateY(0);
}

.animate-fade-left {
  transform: translateX(-50px);
}

.animate-fade-left.visible {
  transform: translateX(0);
}

.animate-fade-right {
  transform: translateX(50px);
}

.animate-fade-right.visible {
  transform: translateX(0);
}

.animate-scale {
  transform: scale(0.9);
}

.animate-scale.visible {
  transform: scale(1);
}

/* ========== 4. Loading Animations ========== */

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-blue);
  animation: rotate 1s linear infinite;
  margin: 0 auto;
}

.spinner--sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner--lg {
  width: 60px;
  height: 60px;
  border-width: 6px;
}

.spinner--dark {
  border-color: rgba(0, 0, 0, 0.1);
  border-top-color: var(--text-dark);
}

/* Loading Dots */
.loading-dots {
  display: inline-flex;
  align-items: center;
  height: 20px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  margin: 0 2px;
  background-color: var(--primary-blue);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

/* ========== 5. Hover Effects ========== */

/* Hover Scale */
.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* Hover Lift */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

/* Hover Glow */
.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

/* Hover Underline */
.hover-underline {
  position: relative;
}

.hover-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: currentColor;
  transition: width 0.3s ease;
}

.hover-underline:hover::after {
  width: 100%;
}

/* Hover Rotate */
.hover-rotate {
  transition: transform 0.3s ease;
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

/* ========== 6. Continuous Animations ========== */

/* Floating Animation */
.floating {
  animation: float 3s ease-in-out infinite;
}

/* Pulse Animation */
.pulsing {
  animation: pulse 2s ease-in-out infinite;
}

/* Bounce Animation */
.bouncing {
  animation: bounce 2s ease infinite;
}

/* Typing Animation */
.typing {
  border-right: 2px solid var(--primary-blue);
  white-space: nowrap;
  overflow: hidden;
  animation: typingCursor 0.7s step-end infinite;
}

/* ========== 7. Prefers-reduced-motion ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .animate-on-scroll {
    opacity: 1;
    transform: none !important;
  }
  
  .floating,
  .pulsing,
  .bouncing,
  .typing {
    animation: none !important;
  }
  
  .hover-scale:hover,
  .hover-lift:hover,
  .hover-rotate:hover {
    transform: none !important;
  }
}

/* ========== 8. Team Diagram Animation ========== */
.team-diagram {
  position: relative;
  margin: 50px auto;
  max-width: 900px;
}

.team-diagram__center {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 50px;
  z-index: 10;
  animation: pulse 3s infinite ease-in-out;
}

.team-diagram__center-content {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-align: center;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.team-diagram__branches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
}

.team-diagram__branch {
  position: relative;
  width: 150px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.team-diagram__branch.visible {
  opacity: 1;
  transform: translateY(0);
}

.team-diagram__branch::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  width: 2px;
  height: 40px;
  background-color: var(--primary-blue);
  transform: translateX(-50%);
}

.team-diagram__branch-content {
  width: 100%;
  height: 150px;
  border-radius: 10px;
  background-color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 15px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-diagram__branch-content:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.team-diagram__branch-image {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 10px;
  border: 3px solid var(--primary-blue);
}

.team-diagram__branch-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-diagram__branch-name {
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.team-diagram__branch-position {
  color: var(--text-light);
  font-size: 0.8rem;
} 