/* Critical CSS for Social Feed - Above the fold content */

/* Container structure */
.social-feed-section {
  display: none;
  min-height: 600px;
  background: #36393f;
}

.discord-container {
  display: flex;
  height: 100%;
  background: #36393f;
}

/* Sidebar skeleton */
.discord-sidebar {
  width: 240px;
  background: #2f3136;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid #202225;
  color: #fff;
}

/* Main content skeleton */
.discord-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #36393f;
}

.channel-header-bar {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #202225;
  color: #fff;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Message skeleton */
.discord-message {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
}

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

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #40444b;
  flex-shrink: 0;
}

.message-content-wrapper {
  flex: 1;
  min-width: 0;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.message-author {
  font-weight: 600;
  color: #fff;
}

.message-timestamp {
  font-size: 12px;
  color: #72767d;
}

.message-text {
  color: #dcddde;
  line-height: 1.375;
  word-wrap: break-word;
}

/* Input area */
.message-input-container {
  padding: 16px;
  border-top: 1px solid #202225;
}

.message-input-wrapper {
  background: #40444b;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 11px 16px;
}

.message-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #dcddde;
  font-size: 15px;
  outline: none;
}

/* Loading states */
.loading-skeleton {
  background: linear-gradient(90deg, #40444b 25%, #4a4d52 50%, #40444b 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Virtual scroll viewport */
.virtual-scroll-viewport {
  height: 100%;
  overflow-y: auto;
  position: relative;
}

.virtual-scroll-content {
  position: relative;
}

/* Lazy loaded images */
[data-lazy] {
  background: #40444b;
  transition: opacity 0.3s;
}

[data-lazy].loaded {
  animation: imageLoad 0.3s ease-out;
}

@keyframes imageLoad {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Optimistic message states */
.discord-message[data-status="pending"] {
  opacity: 0.7;
}

.discord-message[data-status="failed"] {
  opacity: 0.5;
  position: relative;
}

.discord-message[data-status="failed"]::after {
  content: "⚠️ Failed to send";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 12px;
  color: #f44336;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .discord-sidebar {
    display: none;
  }
  
  .discord-users-sidebar {
    display: none;
  }
  
  .messages-container {
    padding: 8px;
  }
  
  .discord-message {
    padding: 4px 0;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}