/* Message Animations */
@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Typing Indicator Animation */
@keyframes typingDot {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

.typing-indicator {
  animation: fadeIn 0.3s ease-in;
}

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

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

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

/* Message Entry Animation */
.message-enter {
  animation: slideInFromBottom 0.3s ease-out;
}

/* Hover Effects */
.message-hover {
  transition: background-color 0.15s ease;
}

.message-hover:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

/* Reaction Animation */
@keyframes reactionPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.reaction-pop {
  animation: reactionPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Modal Animations */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-enter {
  animation: modalSlideIn 0.3s ease-out;
}

/* Loading Pulse */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Channel Selection */
@keyframes channelSelect {
  from {
    background-color: transparent;
  }
  to {
    background-color: rgba(59, 130, 246, 0.1);
  }
}

.channel-selected {
  animation: channelSelect 0.2s ease-out;
}

/* Notification Badge Pulse */
@keyframes badgePulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.notification-badge {
  animation: badgePulse 2s infinite;
}

/* Smooth Scrolling */
.smooth-scroll {
  scroll-behavior: smooth;
}

/* Custom Scrollbar Styling */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Mention Highlight */
.mention {
  color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.1);
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 500;
}

/* Server Icon Hover */
@keyframes serverIconHover {
  from {
    border-radius: 50%;
  }
  to {
    border-radius: 30%;
  }
}

.server-icon-hover {
  transition: border-radius 0.2s ease, background-color 0.2s ease;
}

/* Voice Channel Indicator */
@keyframes voicePulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.voice-active {
  animation: voicePulse 2s ease-in-out infinite;
}

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

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

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

.toast-exit {
  animation: toastSlideOut 0.3s ease-in;
}

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

.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}
/* Instagram-inspired Message Animations */

/* Message slide-in animation */
@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Smooth message appear */
@keyframes messageFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bubble bounce effect */
@keyframes bubbleBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

/* Typing indicator animation */
@keyframes typingDot {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Reaction pop animation */
@keyframes reactionPop {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-15deg);
  }
  50% {
    transform: scale(1.2) rotate(5deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

/* Shimmer loading effect */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Pulse animation for new messages */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
  }
}

/* Image zoom on hover */
@keyframes imageZoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

/* Gradient shift animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Floating animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Glow effect */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.5),
                0 0 10px rgba(102, 126, 234, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.8),
                0 0 30px rgba(102, 126, 234, 0.5);
  }
}

/* Message bubble tail animation */
@keyframes tailSlide {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Message delete animation */
@keyframes messageDelete {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
    max-height: 500px;
  }
  50% {
    opacity: 0.5;
    transform: scale(0.95) translateX(-10px);
  }
  100% {
    opacity: 0;
    transform: scale(0.8) translateY(-20px);
    max-height: 0;
    margin: 0;
    padding: 0;
  }
}

/* Fade out animation */
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Smooth scroll animation */
@keyframes smoothScroll {
  from {
    scroll-behavior: smooth;
  }
}

/* Fade in up animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

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

/* Elastic scale */
@keyframes elasticScale {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.1);
  }
  75% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

/* Message action button appear */
@keyframes actionButtonSlide {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Utility classes */
.message-enter {
  animation: messageSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.message-delete {
  animation: messageDelete 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.message-fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

.message-new {
  animation: pulse 1s ease-out;
}

.message-hover {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.message-hover:hover {
  transform: translateY(-2px);
}

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

.gradient-animate {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

.shimmer-loading {
  background: linear-gradient(
    90deg,
    rgba(241, 245, 249, 1) 0%,
    rgba(248, 250, 252, 1) 50%,
    rgba(241, 245, 249, 1) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
}

/* Smooth transitions */
.smooth-transition {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-transition-fast {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effects */
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

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

/* Focus effects */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Stagger animation for multiple elements */
.stagger-enter:nth-child(1) { animation-delay: 0.05s; }
.stagger-enter:nth-child(2) { animation-delay: 0.1s; }
.stagger-enter:nth-child(3) { animation-delay: 0.15s; }
.stagger-enter:nth-child(4) { animation-delay: 0.2s; }
.stagger-enter:nth-child(5) { animation-delay: 0.25s; }
:root {
  color-scheme: dark;
  --ps-primary: #6d5dfc;
  --ps-secondary: #22d3ee;
  --ps-surface: rgba(15, 23, 42, 0.85);
  --ps-surface-muted: rgba(15, 23, 42, 0.65);
  --ps-border: rgba(148, 163, 184, 0.18);
  --ps-text-primary: #f8fafc;
  --ps-text-secondary: #94a3b8;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body, #root {
  height: 100%;
}

body {
  font-family: 'Inter', 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #050817;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(109, 93, 252, 0.25), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(34, 211, 238, 0.22), transparent 40%),
    linear-gradient(180deg, #030711 0%, #050817 60%, #050817 100%);
  color: var(--ps-text-primary);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

::selection {
  background-color: rgba(109, 93, 252, 0.35);
  color: #fff;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
}
