/* ========================================
   GoldenAge Compass - Animations
   ======================================== */

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease;
}

.fade-in-up {
  animation: fadeInUp 0.8s ease;
}

.fade-in-down {
  animation: fadeInDown 0.8s ease;
}

/* Slide Animations */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.8s ease;
}

.slide-in-right {
  animation: slideInRight 0.8s ease;
}

/* Pulse Animation */
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(212, 175, 55, 0);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

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

.scale-in {
  animation: scaleIn 0.5s ease;
}

/* Ticker Animation */
@keyframes ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

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

.bounce {
  animation: bounce 2s infinite;
}

/* Rotate Animation */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rotate {
  animation: rotate 2s linear infinite;
}

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

.shake {
  animation: shake 0.5s ease;
}

/* Glow Animation */
@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(26, 77, 122, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(26, 77, 122, 0.8);
  }
}

.glow {
  animation: glow 2s ease-in-out infinite;
}

/* Progress Bar Animation */
@keyframes progressBar {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.progress-bar {
  animation: progressBar 2s ease-out;
}

/* Typing Animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.typing {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 3s steps(40, end);
}

/* Attention Animations */
@keyframes flash {
  0%,
  50%,
  100% {
    opacity: 1;
  }
  25%,
  75% {
    opacity: 0;
  }
}

.flash {
  animation: flash 2s ease infinite;
}

/* Service Card Hover Effects */
.service-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover .service-icon svg {
  animation: bounce 1s ease;
}

/* Deal Card Animation */
.deal-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.deal-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* Button Hover Effects */
.btn-primary,
.btn-secondary,
.btn-deal {
  position: relative;
  overflow: hidden;
}

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

.btn-primary:hover::before,
.btn-secondary:hover::before,
.btn-deal:hover::before {
  width: 300px;
  height: 300px;
}

/* Loading Spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  border: 3px solid rgba(26, 77, 122, 0.1);
  border-top-color: #1a4d7a;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

/* Smooth Scroll Indicator */
@keyframes scrollDown {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

.scroll-indicator {
  animation: scrollDown 2s ease-in-out infinite;
}

/* Card Flip Animation */
@keyframes flipIn {
  from {
    transform: perspective(1000px) rotateY(-90deg);
    opacity: 0;
  }
  to {
    transform: perspective(1000px) rotateY(0);
    opacity: 1;
  }
}

.flip-in {
  animation: flipIn 0.6s ease;
}

/* Staggered Animation for Lists */
.service-card:nth-child(1) {
  animation-delay: 0.1s;
}

.service-card:nth-child(2) {
  animation-delay: 0.2s;
}

.service-card:nth-child(3) {
  animation-delay: 0.3s;
}

.service-card:nth-child(4) {
  animation-delay: 0.4s;
}

/* Parallax Effect */
.parallax {
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Form Focus Animation */
input:focus,
select:focus,
textarea:focus {
  animation: focusGlow 0.5s ease;
}

@keyframes focusGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 77, 122, 0.4);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(26, 77, 122, 0);
  }
}

/* Notification Toast Animation */
@keyframes toastSlideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast {
  animation: toastSlideIn 0.5s ease;
}

/* Modal Animation */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal {
  animation: modalFadeIn 0.3s ease;
}

/* Ripple Effect */
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 0.6s ease-out;
}

/* Intersection Observer Animations */
.fade-in-on-scroll {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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