/* ===========================
   CUSTOM ANIMATIONS & STYLES
   =========================== */

/* Blob Animation */
@keyframes blob {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

.animate-blob {
  animation: blob 7s infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

/* Glassmorphism Effect */
.glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(10px);
}

/* Shake Effect for Login */
.shake {
  animation: shake 0.5s ease-in-out !important;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-12px);
  }
  75% {
    transform: translateX(12px);
  }
}

/* Toast Slide Animation */
@keyframes toast-slide {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-enter {
  animation: toast-slide 0.3s ease-out;
}

/* Loading Spinner */
.spinner {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top: 3px solid #06b6d4;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

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

/* Chat Bubble Styles */
.message-bubble {
  word-wrap: break-word;
  word-break: break-word;
  max-width: 85%;
}

.message-sent {
  background: linear-gradient(to right, #14b8a6, #06b6d4);
  border-radius: 18px 18px 4px 18px;
}

.message-received {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 18px 18px 18px 4px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Chat Item Hover */
.chat-item {
  transition: all 0.2s ease;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  border: 1px solid transparent;
}

.chat-item:hover {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.chat-item.active {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(20, 184, 166, 0.3);
}

/* Status Indicator Pulse */
.status-online {
  width: 12px;
  height: 12px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

.status-offline {
  width: 12px;
  height: 12px;
  background-color: #ef4444;
  border-radius: 50%;
  display: inline-block;
}

.status-connecting {
  width: 12px;
  height: 12px;
  background-color: #f59e0b;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

/* Smooth Transitions */
button, input, a {
  transition: all 0.2s ease;
}

/* Input Focus Ring */
input:focus {
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(71, 85, 105, 0.5);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 85, 105, 0.8);
}

/* Loading State Button */
.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

/* Responsive layout tweaks */
@media (max-width: 1024px) {
  #inboxSection {
    flex-direction: column;
    height: auto;
  }

  #inboxSection > div {
    width: 100%;
  }

  #messageInput {
    position: sticky;
    bottom: 0;
  }
}

/* Text Ellipsis */
.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Smooth Page Transitions */
.section-content {
  animation: fade-in 0.3s ease-in-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Avatar */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 14px;
}

.avatar-sm {
  width: 32px;
  height: 32px;
}

.avatar-md {
  width: 40px;
  height: 40px;
}

.avatar-lg {
  width: 48px;
  height: 48px;
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(to right, #14b8a6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Cards */
.card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(71, 85, 105, 0.3);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
}

.card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(20, 184, 166, 0.3);
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.1);
}
