/* ⚡ ANIMATIONS & TRANSITIONS */

/* Page transitions - fade with blur */
.page-transition-enter {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(20px);
}

.page-transition-enter-active {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition-exit {
  opacity: 1;
  filter: blur(0);
}

.page-transition-exit-active {
  opacity: 0;
  filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fade in with scale */
@keyframes fadeInScaleUp {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    filter: blur(5px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

.animate-fade-in-scale-up {
  animation: fadeInScaleUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Button hover animations */
.btn-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-hover::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-hover:hover::before {
  width: 300px;
  height: 300px;
}

.btn-hover:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 10px 40px rgba(239, 68, 68, 0.4);
}

.btn-hover:active {
  transform: scale(0.98) translateY(0);
}

/* Pulse animation for important buttons */
@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }

  50% {
    box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
  }
}

.btn-pulse {
  animation: pulse-glow 2s infinite;
}

/* Icon hover effects */
.icon-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-hover:hover {
  transform: scale(1.2) rotate(5deg);
  filter: brightness(1.2);
}

/* Card hover effects */
.card-hover {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(239, 68, 68, 0.3);
}

/* Loading skeleton shimmer */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  animation: shimmer 2s infinite linear;
  background: linear-gradient(90deg,
      rgba(24, 24, 27, 1) 0%,
      rgba(39, 39, 42, 1) 50%,
      rgba(24, 24, 27, 1) 100%);
  background-size: 1000px 100%;
}

/* Skeleton components */
.skeleton-text {
  height: 1rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  height: 1.5rem;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
  width: 60%;
}

.skeleton-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.skeleton-card {
  border-radius: 0.75rem;
  padding: 1.5rem;
  background: rgba(24, 24, 27, 1);
}

/* Parallax effect */
.parallax-bg {
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Modal animations */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

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

.modal-enter {
  animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Backdrop blur animation */
@keyframes backdropFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0);
  }

  to {
    opacity: 1;
    backdrop-filter: blur(10px);
  }
}

.backdrop-enter {
  animation: backdropFadeIn 0.3s ease-out;
}

/* Notification slide in */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-enter {
  animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  width: 20px;
  height: 20px;
  pointer-events: none;
  animation: ripple 0.6s ease-out;
}

/* Swipe card animations */
@keyframes swipeRight {
  to {
    transform: translateX(150%) rotate(20deg);
    opacity: 0;
  }
}

@keyframes swipeLeft {
  to {
    transform: translateX(-150%) rotate(-20deg);
    opacity: 0;
  }
}

@keyframes swipeUp {
  to {
    transform: translateY(-150%) scale(1.1);
    opacity: 0;
  }
}

.swipe-right {
  animation: swipeRight 0.4s cubic-bezier(0.4, 0, 0.6, 1);
}

.swipe-left {
  animation: swipeLeft 0.4s cubic-bezier(0.4, 0, 0.6, 1);
}

.swipe-up {
  animation: swipeUp 0.5s cubic-bezier(0.4, 0, 0.6, 1);
}

/* Bounce animation */
@keyframes bounce {

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

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

.animate-bounce-slow {
  animation: bounce 2s infinite;
}

/* Glow effect on hover */
.glow-on-hover {
  position: relative;
  transition: all 0.3s;
}

.glow-on-hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
}

.glow-on-hover:hover::after {
  opacity: 1;
}

/* Blood drip effect */
@keyframes drip {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

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

.blood-drip {
  animation: drip 3s ease-in infinite;
}

/* Fade in from different directions */
@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);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fade-in-down {
  animation: fadeInDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fade-in-left {
  animation: fadeInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fade-in-right {
  animation: fadeInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Staggered animation delays */
.stagger-1 {
  animation-delay: 0.1s;
}

.stagger-2 {
  animation-delay: 0.2s;
}

.stagger-3 {
  animation-delay: 0.3s;
}

.stagger-4 {
  animation-delay: 0.4s;
}

.stagger-5 {
  animation-delay: 0.5s;
}

/* Spinner with glow */
@keyframes spin-glow {
  0% {
    transform: rotate(0deg);
    filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.5));
  }

  50% {
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.8));
  }

  100% {
    transform: rotate(360deg);
    filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.5));
  }
}

.spinner-glow {
  animation: spin-glow 1s linear infinite;
}

/* Text gradient animation */
@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.text-gradient-animated {
  background: linear-gradient(90deg, #ef4444, #dc2626, #b91c1c, #ef4444);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

/* Number counter animation */
@keyframes countUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.count-up {
  animation: countUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Typewriter effect */
@keyframes typing {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

.typewriter {
  overflow: hidden;
  border-right: 2px solid #ef4444;
  white-space: nowrap;
  animation: typing 3s steps(40) 1s, blink 0.75s step-end infinite;
}

/* Floating animation */
@keyframes float {

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

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

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* Soft pulse glow (breathing effect) - Renamed from pulse-glow to avoid conflict */
@keyframes pulse-glow-soft {

  0%,
  100% {
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.2);
  }

  50% {
    box-shadow: 0 0 25px rgba(220, 38, 38, 0.5);
  }
}

.animate-pulse-glow-soft {
  animation: pulse-glow-soft 3s infinite;
}

/* Existing Animations preserved/refined */
@keyframes swipe-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

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

.animate-swipe-in {
  animation: swipe-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ========================================
   CHAT ANIMATIONS - Smooth & Interactive
   ======================================== */

/* Message bubble pop-in animation */
@keyframes messageBubbleIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
  }

  60% {
    transform: scale(1.03) translateY(-2px);
  }

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

.chat-message-enter {
  animation: messageBubbleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Sent message specific (slides from right) */
@keyframes messageSent {
  0% {
    opacity: 0;
    transform: translateX(20px) scale(0.95);
  }

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

.chat-message-sent {
  animation: messageSent 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Received message specific (slides from left) */
@keyframes messageReceived {
  0% {
    opacity: 0;
    transform: translateX(-20px) scale(0.95);
  }

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

.chat-message-received {
  animation: messageReceived 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reaction pop animation */
@keyframes reactionPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.4);
  }

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

.reaction-pop {
  animation: reactionPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Emoji picker fade in */
@keyframes emojiPickerIn {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }

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

.emoji-picker-enter {
  animation: emojiPickerIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Read receipt animation */
@keyframes checkmarkAppear {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }

  50% {
    transform: scale(1.2);
  }

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

.checkmark-animate {
  animation: checkmarkAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Typing indicator enhanced bounce */
@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

.typing-dot {
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

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

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Send button pulse when ready */
@keyframes sendReady {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

.send-btn-ready {
  animation: sendReady 1.5s infinite;
}

/* Conversation list item hover glow */
.conversation-item-glow {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.conversation-item-glow:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, transparent 50%);
  box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.1);
}

/* Chat header slide down */
@keyframes headerSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }

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

.chat-header-enter {
  animation: headerSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Input focus glow */
.chat-input-focus {
  transition: all 0.3s ease;
}

.chat-input-focus:focus-within {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3), 0 0 20px rgba(239, 68, 68, 0.15);
}

/* Smooth scroll for chat container */
.chat-scroll-smooth {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* New message indicator pulse */
@keyframes newMessagePulse {

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

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.new-message-indicator {
  animation: newMessagePulse 1s infinite;
}

/* Attachment preview hover */
.attachment-preview {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.attachment-preview:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Quick reply chip animation */
@keyframes chipSlideUp {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

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

.quick-reply-chip {
  animation: chipSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: both;
}

.quick-reply-chip:nth-child(1) {
  animation-delay: 0.05s;
}

.quick-reply-chip:nth-child(2) {
  animation-delay: 0.1s;
}

.quick-reply-chip:nth-child(3) {
  animation-delay: 0.15s;
}

.quick-reply-chip:nth-child(4) {
  animation-delay: 0.2s;
}

/* Message action buttons slide */
@keyframes actionsSlideIn {
  0% {
    opacity: 0;
    transform: translateX(10px);
  }

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

.message-actions-enter {
  animation: actionsSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Online status breathing dot */
@keyframes onlineBreathing {

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

  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

.online-dot {
  animation: onlineBreathing 2s infinite ease-in-out;
}