/**
 * Feed & Gameplay FX Enhancements
 * Behavioral Science-Driven Visual Feedback System
 * 
 * Principles Applied:
 * - Immediate feedback on all actions
 * - Variable reward effects
 * - Progress visibility
 * - Loss aversion (critical states)
 * - Dopamine hits (celebrations)
 */

/* ============================================
   TERMINAL FEED CONTAINER
   ============================================ */

.terminal-feed-container {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  scroll-behavior: smooth;
  font-family: "Courier New", "Consolas", monospace;
  background: rgba(0, 0, 0, 0.3);
}

.terminal-feed-container::-webkit-scrollbar {
  width: 6px;
}

.terminal-feed-container::-webkit-scrollbar-track {
  background: rgba(0, 20, 0, 0.3);
}

.terminal-feed-container::-webkit-scrollbar-thumb {
  background: rgba(57, 255, 20, 0.5);
  border-radius: 3px;
}

.terminal-feed-container::-webkit-scrollbar-thumb:hover {
  background: rgba(57, 255, 20, 0.8);
}

/* ============================================
   MESSAGE ENTRY ANIMATIONS
   ============================================ */

.log-entry {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border-left: 4px solid transparent;
  background: rgba(0, 20, 0, 0.25);
  border-radius: 6px;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  line-height: 1.6;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Unread message indicator */
.log-entry.unread {
  border-left-width: 6px;
  background: rgba(0, 20, 0, 0.35);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
}

.log-entry.unread::after {
  content: "";
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 8px;
  height: 8px;
  background: #39ff14;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.8);
  animation: unreadPulse 2s ease-in-out infinite;
}

@keyframes unreadPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* Pinned message */
.log-entry.pinned {
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.3);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
}

.log-entry.pinned::before {
  content: "📌";
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

.log-entry.animate-in {
  opacity: 1;
  transform: translateX(0);
  animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Message slide-in animation */
@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   NARRATIVE MESSAGES - Typewriter Effect
   ============================================ */

.log-entry.log-narrative {
  border-left-color: #39ff14;
  background: rgba(0, 255, 0, 0.05);
}

.log-entry.log-narrative.animate-in {
  animation:
    narrativeFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    narrativeGlow 2s ease-in-out infinite;
}

@keyframes narrativeFadeIn {
  from {
    opacity: 0;
    transform: translateX(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes narrativeGlow {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(57, 255, 20, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.6);
  }
}

.log-entry.log-narrative .message-text {
  color: #88cc88;
  line-height: 1.6;
}

/* Typewriter effect for narrative text */
.log-entry.log-narrative.typewriter .message-text {
  overflow: hidden;
  white-space: nowrap;
  animation: typewriter 0.1s steps(1, end);
}

/* ============================================
   SYSTEM MESSAGES - Cyan Slide
   ============================================ */

.log-entry.log-system {
  border-left-color: #00ffff;
  background: rgba(0, 255, 255, 0.05);
}

.log-entry.log-system.animate-in {
  animation:
    systemSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    systemPulse 2s ease-in-out infinite;
}

@keyframes systemSlideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
    border-left-color: transparent;
  }
  to {
    opacity: 1;
    transform: translateX(0);
    border-left-color: #00ffff;
  }
}

@keyframes systemPulse {
  0%,
  100% {
    border-left-color: #00ffff;
  }
  50% {
    border-left-color: #00ccff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
  }
}

.log-entry.log-system .message-text {
  color: #88dddd;
}

.log-entry.log-system .sender-tag {
  color: #00ffff;
  font-weight: bold;
}

/* ============================================
   COMBAT MESSAGES - Red Flash & Shake
   ============================================ */

.log-entry.log-combat {
  border-left-color: #ff0033;
  background: rgba(255, 0, 51, 0.1);
}

.log-entry.log-combat.animate-in {
  animation:
    combatShake 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    combatFlash 0.3s ease-out;
}

@keyframes combatShake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-3px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(3px);
  }
}

@keyframes combatFlash {
  0% {
    background: rgba(255, 0, 51, 0.3);
    box-shadow: 0 0 20px rgba(255, 0, 51, 0.6);
  }
  100% {
    background: rgba(255, 0, 51, 0.1);
    box-shadow: 0 0 5px rgba(255, 0, 51, 0.3);
  }
}

.log-entry.log-combat .message-text {
  color: #ff6666;
  font-weight: 500;
}

.log-entry.log-combat .sender-tag {
  color: #ff0033;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(255, 0, 51, 0.8);
}

/* Critical combat message */
.log-entry.log-combat.critical {
  border-left-width: 5px;
  animation:
    combatShake 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    combatFlash 0.3s ease-out,
    criticalPulse 1s ease-in-out infinite;
}

@keyframes criticalPulse {
  0%,
  100% {
    box-shadow: 0 0 15px rgba(255, 0, 51, 0.6);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 0, 51, 1);
  }
}

/* ============================================
   REWARD MESSAGES - Gold Sparkle
   ============================================ */

.log-entry.log-reward {
  border-left-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  position: relative;
  overflow: visible;
}

.log-entry.log-reward.animate-in {
  animation:
    rewardPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55),
    rewardSparkle 2s ease-in-out infinite;
}

@keyframes rewardPop {
  0% {
    opacity: 0;
    transform: scale(0.8) translateX(20px);
  }
  50% {
    transform: scale(1.1) translateX(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
}

@keyframes rewardSparkle {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
  }
}

.log-entry.log-reward .message-text {
  color: #ffd700;
  font-weight: bold;
}

.log-entry.log-reward .sender-tag {
  color: #ffd700;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

/* Reward sparkle particles */
.log-entry.log-reward::before {
  content: "✨";
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 1.2rem;
  animation: sparkleFloat 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sparkleFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-10px) rotate(180deg);
    opacity: 1;
  }
}

/* ============================================
   ERROR MESSAGES - Red Pulse
   ============================================ */

.log-entry.log-error {
  border-left-color: #ff0033;
  background: rgba(255, 0, 51, 0.15);
}

.log-entry.log-error.animate-in {
  animation:
    errorPulse 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    errorShake 0.3s ease-out;
}

.log-entry.log-error.animate-in.persistent {
  animation:
    errorPulse 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    errorShake 0.3s ease-out,
    errorPersistentGlow 2s ease-in-out infinite;
}

@keyframes errorPulse {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes errorPersistentGlow {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 0, 51, 0.5);
    border-left-color: #ff0033;
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 0, 51, 0.8);
    border-left-color: #ff3366;
  }
}

.log-entry.log-error .message-text {
  color: #ff6666;
  font-weight: 500;
}

.log-entry.log-error .sender-tag {
  color: #ff0033;
  font-weight: bold;
}

/* ============================================
   USER MESSAGES - Green Fade
   ============================================ */

.log-entry.log-user {
  border-left-color: #39ff14;
  background: rgba(57, 255, 20, 0.05);
}

.log-entry.log-user.animate-in {
  animation: userFadeIn 0.3s ease-out;
}

@keyframes userFadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.log-entry.log-user .message-text {
  color: #39ff14;
}

.log-entry.log-user .prompt-char {
  color: #39ff14;
  font-weight: bold;
}

/* ============================================
   MESSAGE GROUPING
   ============================================ */

.message-group {
  margin-bottom: 16px;
  border: 1px solid rgba(57, 255, 20, 0.2);
  border-radius: 4px;
  background: rgba(0, 20, 0, 0.3);
  padding: 8px;
}

.message-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: rgba(0, 20, 0, 0.5);
  border-bottom: 1px solid rgba(57, 255, 20, 0.2);
  cursor: pointer;
  user-select: none;
}

.message-group-header:hover {
  background: rgba(0, 20, 0, 0.7);
}

.message-group-title {
  color: #39ff14;
  font-weight: bold;
  font-size: 0.85rem;
}

.message-group-count {
  color: #88cc88;
  font-size: 0.75rem;
}

.message-group-content {
  padding: 8px 0;
}

.message-group.collapsed .message-group-content {
  display: none;
}

/* Combat round grouping */
.message-group.combat-round {
  border-color: rgba(255, 0, 51, 0.3);
  background: rgba(255, 0, 51, 0.05);
}

.message-group.combat-round .message-group-title {
  color: #ff0033;
}

/* Mission update grouping */
.message-group.mission-update {
  border-color: rgba(57, 255, 20, 0.3);
  background: rgba(57, 255, 20, 0.05);
}

/* ============================================
   PROGRESS INDICATORS
   ============================================ */

.message-progress {
  margin-top: 8px;
  padding: 8px;
  background: rgba(0, 20, 0, 0.5);
  border-radius: 4px;
}

.progress-label {
  color: #557755;
  font-size: 0.7rem;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.progress-bar {
  height: 6px;
  background: rgba(0, 50, 0, 0.5);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #39ff14, #00ff88);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
  animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
  }
  50% {
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.8);
  }
}

/* ============================================
   INTERACTIVE ELEMENTS
   ============================================ */

.log-entry.interactive {
  cursor: pointer;
  transition: all 0.2s ease;
}

.log-entry.interactive:hover {
  background: rgba(0, 20, 0, 0.4);
  transform: translateX(5px);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
}

.log-entry.interactive:active {
  transform: translateX(3px) scale(0.98);
}

/* Action buttons in messages */
.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(57, 255, 20, 0.1);
}

.message-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin: 0;
  background: rgba(57, 255, 20, 0.15);
  border: 1.5px solid #39ff14;
  color: #39ff14;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-height: 36px;
  position: relative;
  overflow: hidden;
}

.message-action::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(57, 255, 20, 0.3);
  transform: translate(-50%, -50%);
  transition:
    width 0.3s,
    height 0.3s;
}

.message-action:hover {
  background: rgba(57, 255, 20, 0.3);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.6);
  transform: translateY(-2px);
  border-color: #5aff2e;
}

.message-action:hover::before {
  width: 200px;
  height: 200px;
}

.message-action:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
}

.message-action:focus {
  outline: 2px solid #39ff14;
  outline-offset: 2px;
}

/* Action button icons */
.message-action .action-icon {
  font-size: 0.9rem;
  line-height: 1;
}

/* Priority action buttons */
.message-action.priority {
  background: rgba(255, 215, 0, 0.2);
  border-color: #ffd700;
  color: #ffd700;
  animation: priorityPulse 2s ease-in-out infinite;
}

@keyframes priorityPulse {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
  }
}

/* ============================================
   SEARCH HIGHLIGHTING
   ============================================ */

.log-entry mark {
  background: #ffd700;
  color: #000;
  padding: 2px 4px;
  border-radius: 2px;
  font-weight: bold;
  animation: highlightPulse 1s ease-in-out infinite;
}

@keyframes highlightPulse {
  0%,
  100% {
    background: #ffd700;
  }
  50% {
    background: #ffff00;
  }
}

/* ============================================
   MESSAGE METADATA
   ============================================ */

.log-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.7rem;
  opacity: 0.65;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(57, 255, 20, 0.1);
  align-items: center;
}

.timestamp {
  color: #557755;
  font-family: "Courier New", monospace;
  font-size: 0.65rem;
  min-width: 80px;
}

.sender-tag {
  color: #88cc88;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sender-tag::before {
  content: "▶";
  font-size: 0.6rem;
  opacity: 0.6;
}

.log-body {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.prompt-char {
  color: #557755;
  font-weight: bold;
  flex-shrink: 0;
}

.message-text {
  flex: 1;
  color: #88cc88;
  line-height: 1.5;
  word-wrap: break-word;
}

/* ============================================
   SCREEN EFFECTS (Combat/Events)
   ============================================ */

.screen-shake {
  animation: screenShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes screenShake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translate(-2px, -2px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translate(2px, 2px);
  }
}

.screen-flash {
  animation: screenFlash 0.3s ease-out;
}

@keyframes screenFlash {
  0% {
    background: rgba(255, 0, 51, 0);
  }
  50% {
    background: rgba(255, 0, 51, 0.3);
  }
  100% {
    background: rgba(255, 0, 51, 0);
  }
}

.screen-flash-success {
  animation: screenFlashSuccess 0.3s ease-out;
}

@keyframes screenFlashSuccess {
  0% {
    background: rgba(57, 255, 20, 0);
  }
  50% {
    background: rgba(57, 255, 20, 0.2);
  }
  100% {
    background: rgba(57, 255, 20, 0);
  }
}

/* ============================================
   CELEBRATION EFFECTS
   ============================================ */

.celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.celebration-text {
  font-size: 3rem;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
  animation: celebrationPop 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes celebrationPop {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(360deg);
    opacity: 0.8;
  }
}

/* Confetti particles */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: #ffd700;
  pointer-events: none;
  animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
  .log-entry,
  .log-entry.animate-in,
  .message-group,
  .progress-fill {
    animation: none !important;
    transition: none !important;
  }
}

/* GPU acceleration for smooth animations */
.log-entry,
.message-group,
.progress-fill {
  will-change: transform, opacity;
  transform: translateZ(0);
}

/* ============================================
   MESSAGE CONTEXT MENU
   ============================================ */

.message-context-menu {
  position: fixed;
  background: rgba(0, 20, 0, 0.95);
  border: 1px solid #39ff14;
  border-radius: 4px;
  padding: 4px 0;
  z-index: 10000;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  display: none;
}

.message-context-menu.show {
  display: block;
  animation: contextMenuSlideIn 0.2s ease-out;
}

@keyframes contextMenuSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.context-menu-item {
  padding: 10px 16px;
  color: #88cc88;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.context-menu-item:hover {
  background: rgba(57, 255, 20, 0.2);
  color: #39ff14;
  border-left-color: #39ff14;
}

.context-menu-item:active {
  background: rgba(57, 255, 20, 0.3);
}

.context-menu-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.context-menu-item.disabled:hover {
  background: transparent;
  color: #88cc88;
  border-left-color: transparent;
}

.context-menu-separator {
  height: 1px;
  background: rgba(57, 255, 20, 0.2);
  margin: 4px 0;
}

/* ============================================
   ADVANCED FILTERS
   ============================================ */

.feed-controls-bar {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 20, 0, 0.4);
  border-bottom: 1px solid rgba(57, 255, 20, 0.2);
  flex-wrap: wrap;
  align-items: center;
}

.feed-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.feed-filter-btn {
  padding: 6px 12px;
  background: rgba(0, 20, 0, 0.5);
  border: 1px solid rgba(57, 255, 20, 0.3);
  color: #88cc88;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.feed-filter-btn:hover {
  background: rgba(57, 255, 20, 0.2);
  border-color: #39ff14;
  color: #39ff14;
}

.feed-filter-btn.active {
  background: rgba(57, 255, 20, 0.3);
  border-color: #39ff14;
  color: #39ff14;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}

.feed-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.feed-search-input {
  width: 100%;
  padding: 8px 32px 8px 12px;
  background: rgba(0, 20, 0, 0.6);
  border: 1px solid rgba(57, 255, 20, 0.3);
  color: #39ff14;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.feed-search-input:focus {
  outline: none;
  border-color: #39ff14;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
  background: rgba(0, 20, 0, 0.8);
}

.feed-clear-search {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #557755;
  cursor: pointer;
  padding: 4px;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.feed-clear-search:hover {
  color: #39ff14;
}

/* Time range filter */
.feed-time-filter {
  display: flex;
  gap: 6px;
  align-items: center;
}

.feed-time-filter select {
  padding: 6px 10px;
  background: rgba(0, 20, 0, 0.6);
  border: 1px solid rgba(57, 255, 20, 0.3);
  color: #39ff14;
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}

/* ============================================
   MESSAGE GROUPING ENHANCEMENTS
   ============================================ */

.message-group {
  margin-bottom: 20px;
  border: 2px solid rgba(57, 255, 20, 0.25);
  border-radius: 6px;
  background: rgba(0, 20, 0, 0.3);
  padding: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.message-group:hover {
  border-color: rgba(57, 255, 20, 0.4);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.2);
}

.message-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 20, 0, 0.5);
  border-bottom: 1px solid rgba(57, 255, 20, 0.2);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.message-group-header:hover {
  background: rgba(0, 20, 0, 0.7);
}

.message-group-header::after {
  content: "▼";
  color: #557755;
  font-size: 0.7rem;
  transition: transform 0.3s ease;
}

.message-group.collapsed .message-group-header::after {
  transform: rotate(-90deg);
}

.message-group-title {
  color: #39ff14;
  font-weight: bold;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-group-count {
  color: #88cc88;
  font-size: 0.75rem;
  background: rgba(57, 255, 20, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
}

.message-group-content {
  padding: 12px;
  max-height: 800px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
}

.message-group.collapsed .message-group-content {
  max-height: 0;
  padding: 0 12px;
  overflow: hidden;
}

/* ============================================
   KEYBOARD NAVIGATION
   ============================================ */

.log-entry:focus {
  outline: 2px solid #39ff14;
  outline-offset: 2px;
  background: rgba(57, 255, 20, 0.15);
}

.log-entry.keyboard-navigating {
  outline: 2px solid #39ff14;
  outline-offset: 2px;
}

/* ============================================
   CONNECTION STATUS
   ============================================ */

.feed-connection-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 20, 0, 0.5);
  border: 1px solid rgba(57, 255, 20, 0.3);
  border-radius: 12px;
  font-size: 0.7rem;
  color: #88cc88;
}

.feed-connection-status.connected {
  border-color: #39ff14;
  color: #39ff14;
}

.feed-connection-status.connected::before {
  content: "●";
  color: #39ff14;
  animation: connectionPulse 2s ease-in-out infinite;
}

.feed-connection-status.disconnected {
  border-color: #ff0033;
  color: #ff6666;
}

.feed-connection-status.disconnected::before {
  content: "●";
  color: #ff0033;
}

@keyframes connectionPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ============================================
   MESSAGE STATISTICS
   ============================================ */

.feed-stats {
  display: flex;
  gap: 16px;
  padding: 8px 12px;
  background: rgba(0, 20, 0, 0.3);
  border-top: 1px solid rgba(57, 255, 20, 0.2);
  font-size: 0.7rem;
  color: #557755;
}

.feed-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.feed-stat-value {
  color: #39ff14;
  font-weight: bold;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .log-entry {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
  }

  .message-actions {
    flex-direction: column;
  }

  .message-action {
    width: 100%;
    justify-content: center;
  }

  .feed-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .feed-search-wrapper {
    max-width: 100%;
  }
}
