/* ============================================================
   PERFECT MESSAGE & NOTIFICATION ANIMATIONS
   Special timing, smooth transitions, delightful feel
   ============================================================ */

/* ===== NOTIFICATION BANNER (Scheduling January) ===== */
.notification-banner,
.scheduling-banner,
[class*='notification'],
[class*='banner'][class*='schedule'] {
  /* Initial state - hidden */
  opacity: 0%;
  transform: translateY(-100%) scale(0.95);

  /* Perfect animation */
  animation:
    slideDownBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s forwards,
    pulse 2s ease-in-out 1.5s infinite;

  /* Beautiful styling */
  background: linear-gradient(135deg, rgb(0 163 92 / 95%) 0%, rgb(0 107 61 / 95%) 100%) !important;
  color: #ffffff !important;
  padding: 1rem 2rem !important;
  border-radius: 50px !important;
  border: 3px solid rgb(212 175 55 / 80%) !important;
  box-shadow:
    0 4px 20px rgb(0 163 92 / 40%),
    0 0 40px rgb(212 175 55 / 20%),
    inset 0 1px 0 rgb(255 255 255 / 20%) !important;
  font-weight: 900 !important;
  font-size: 0.95rem !important;
  letter-spacing: 0.02em !important;

  /* Positioning */
  position: fixed !important;
  top: 20px !important;
  left: 50% !important;
  transform-origin: center top !important;
  z-index: 10000 !important;
  backdrop-filter: blur(10px) !important;
}

/* Slide down with bounce */
@keyframes slideDownBounce {
  0% {
    opacity: 0%;
    transform: translateX(-50%) translateY(-100%) scale(0.95);
  }

  60% {
    opacity: 100%;
    transform: translateX(-50%) translateY(10px) scale(1.05);
  }

  80% {
    transform: translateX(-50%) translateY(-5px) scale(0.98);
  }

  100% {
    opacity: 100%;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* Gentle pulse for attention */
@keyframes pulse {
  0%,
  100% {
    box-shadow:
      0 4px 20px rgb(0 163 92 / 40%),
      0 0 40px rgb(212 175 55 / 20%),
      inset 0 1px 0 rgb(255 255 255 / 20%);
    transform: translateX(-50%) scale(1);
  }

  50% {
    box-shadow:
      0 6px 30px rgb(0 163 92 / 60%),
      0 0 60px rgb(212 175 55 / 40%),
      inset 0 1px 0 rgb(255 255 255 / 30%);
    transform: translateX(-50%) scale(1.02);
  }
}

/* Icon inside notification */
.notification-banner::before,
.scheduling-banner::before {
  content: '●';
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.75rem;
  color: #7fff7f;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 100%;
  }

  50% {
    opacity: 30%;
  }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast,
.message,
.alert,
[role='alert'],
[role='status'] {
  /* Initial state */
  opacity: 0%;
  transform: translateX(400px) scale(0.9);

  /* Entrance animation */
  animation:
    slideInRight 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    wiggle 0.5s ease-in-out 0.8s;

  /* Styling */
  background: rgb(255 255 255 / 98%) !important;
  color: #0a0a0a !important;
  padding: 1.25rem 1.5rem !important;
  border-radius: 16px !important;
  border-left: 6px solid #00a35c !important;
  box-shadow:
    0 10px 40px rgb(0 0 0 / 15%),
    0 0 0 1px rgb(0 0 0 / 5%) !important;
  font-weight: 700 !important;

  /* Positioning */
  position: fixed !important;
  bottom: 30px !important;
  right: 30px !important;
  max-width: 400px !important;
  z-index: 9999 !important;
}

/* Slide in from right with bounce */
@keyframes slideInRight {
  0% {
    opacity: 0%;
    transform: translateX(400px) scale(0.9);
  }

  60% {
    opacity: 100%;
    transform: translateX(-20px) scale(1.05);
  }

  80% {
    transform: translateX(10px) scale(0.98);
  }

  100% {
    opacity: 100%;
    transform: translateX(0) scale(1);
  }
}

/* Playful wiggle */
@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-3deg);
  }

  75% {
    transform: rotate(3deg);
  }
}

/* Success toast */
.toast--success,
.message--success {
  border-left-color: #00a35c !important;
  background: linear-gradient(
    135deg,
    rgb(255 255 255 / 98%) 0%,
    rgb(0 163 92 / 5%) 100%
  ) !important;
}

.toast--success::before {
  content: '✓';
  display: inline-block;
  margin-right: 0.75rem;
  font-size: 1.5rem;
  color: #00a35c;
  font-weight: 900;
  animation: checkmarkPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s backwards;
}

@keyframes checkmarkPop {
  0% {
    opacity: 0%;
    transform: scale(0) rotate(-180deg);
  }

  100% {
    opacity: 100%;
    transform: scale(1) rotate(0deg);
  }
}

/* Error toast */
.toast--error,
.message--error {
  border-left-color: #dc143c !important;
  background: linear-gradient(
    135deg,
    rgb(255 255 255 / 98%) 0%,
    rgb(220 20 60 / 5%) 100%
  ) !important;
}

.toast--error::before {
  content: '⚠';
  display: inline-block;
  margin-right: 0.75rem;
  font-size: 1.5rem;
  color: #dc143c;
  animation: shake 0.5s ease-in-out 0.6s;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-10px);
  }

  75% {
    transform: translateX(10px);
  }
}

/* Warning toast */
.toast--warning,
.message--warning {
  border-left-color: #ff8c00 !important;
  background: linear-gradient(
    135deg,
    rgb(255 255 255 / 98%) 0%,
    rgb(255 140 0 / 5%) 100%
  ) !important;
}

.toast--warning::before {
  content: '⚡';
  display: inline-block;
  margin-right: 0.75rem;
  font-size: 1.5rem;
  color: #ff8c00;
  animation: flash 1s ease-in-out infinite;
}

@keyframes flash {
  0%,
  100% {
    opacity: 100%;
  }

  50% {
    opacity: 50%;
  }
}

/* Info toast */
.toast--info,
.message--info {
  border-left-color: #0066cc !important;
  background: linear-gradient(
    135deg,
    rgb(255 255 255 / 98%) 0%,
    rgb(0 102 204 / 5%) 100%
  ) !important;
}

.toast--info::before {
  content: 'ℹ';
  display: inline-block;
  margin-right: 0.75rem;
  font-size: 1.5rem;
  color: #0066cc;
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* ===== BADGE ANIMATIONS ===== */
.badge,
.pill,
.tag,
[class*='badge'] {
  animation: badgeFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Stagger animation for multiple badges */
.badge:nth-child(1) {
  animation-delay: 0.1s;
}

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

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

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

.badge:nth-child(5) {
  animation-delay: 0.5s;
}

@keyframes badgeFadeIn {
  0% {
    opacity: 0%;
    transform: scale(0.5) rotate(-10deg);
  }

  100% {
    opacity: 100%;
    transform: scale(1) rotate(0deg);
  }
}

.badge:hover {
  transform: scale(1.1) rotate(2deg);
  box-shadow: 0 6px 20px rgb(0 163 92 / 30%);
}

/* ===== LOADING STATES ===== */
.loading-message,
[class*='loading'] {
  animation: fadeInScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fadeInScale {
  0% {
    opacity: 0%;
    transform: scale(0.8);
  }

  100% {
    opacity: 100%;
    transform: scale(1);
  }
}

/* Loading spinner */
.loading-spinner::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgb(0 163 92 / 20%);
  border-top-color: #00a35c;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== EXIT ANIMATIONS ===== */
.toast--exit,
.notification--exit,
.message--exit {
  animation: fadeOutRight 0.5s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

@keyframes fadeOutRight {
  0% {
    opacity: 100%;
    transform: translateX(0) scale(1);
  }

  100% {
    opacity: 0%;
    transform: translateX(400px) scale(0.8);
  }
}

.notification-banner--exit {
  animation: fadeOutUp 0.5s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

@keyframes fadeOutUp {
  0% {
    opacity: 100%;
    transform: translateX(-50%) translateY(0) scale(1);
  }

  100% {
    opacity: 0%;
    transform: translateX(-50%) translateY(-100%) scale(0.8);
  }
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .notification-banner,
  .scheduling-banner {
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    transform: none !important;
    font-size: 0.875rem !important;
    padding: 0.875rem 1.25rem !important;
  }

  @keyframes slideDownBounce {
    0% {
      opacity: 0%;
      transform: translateY(-100%) scale(0.95);
    }

    60% {
      opacity: 100%;
      transform: translateY(10px) scale(1.05);
    }

    80% {
      transform: translateY(-5px) scale(0.98);
    }

    100% {
      opacity: 100%;
      transform: translateY(0) scale(1);
    }
  }

  @keyframes pulse {
    0%,
    100% {
      transform: scale(1);
    }

    50% {
      transform: scale(1.02);
    }
  }

  .toast,
  .message {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    max-width: none !important;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  .notification-banner,
  .toast,
  .message,
  .badge {
    animation: simpleFadeIn 0.3s ease-in forwards !important;
  }

  @keyframes simpleFadeIn {
    from {
      opacity: 0%;
    }

    to {
      opacity: 100%;
    }
  }

  .toast--exit,
  .notification--exit {
    animation: simpleFadeOut 0.3s ease-out forwards !important;
  }

  @keyframes simpleFadeOut {
    from {
      opacity: 100%;
    }

    to {
      opacity: 0%;
    }
  }
}

/* ===== SPECIAL EFFECTS ===== */

/* Confetti on success */
.toast--success.with-confetti {
  overflow: visible !important;
}

.toast--success.with-confetti::after {
  content: '🎉';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  animation: confettiFall 1s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateX(-50%) translateY(-20px) rotate(0deg);
    opacity: 100%;
  }

  100% {
    transform: translateX(-50%) translateY(10px) rotate(180deg);
    opacity: 0%;
  }
}

/* Shimmer effect on notification */
.notification-banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 40%), transparent);
  animation: shimmer 3s ease-in-out 2s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

/* Slide up animation for closing scheduling bar */
@keyframes slideUpBar {
  from {
    transform: translateY(0);
    opacity: 100%;
  }

  to {
    transform: translateY(-100%);
    opacity: 0%;
  }
}
