/* Collaboration Real-time Styles */

/* Presence Animations */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slide-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(124, 58, 237, 0.3); }
  50% { box-shadow: 0 0 20px rgba(124, 58, 237, 0.6); }
}

.animate-fade-in {
  animation: fade-in 0.3s ease-out forwards;
}

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

.animate-slide-in-up {
  animation: slide-in-up 0.4s ease-out forwards;
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* Editing Lock Overlay */
.editing-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(251, 191, 36, 0.1);
  backdrop-filter: blur(1px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  border-radius: inherit;
  border: 2px dashed #f59e0b;
}

.editing-locked {
  position: relative;
  overflow: hidden;
}

.editing-locked::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 2px solid #f59e0b;
  border-radius: inherit;
  animation: pulse-ring 2s ease-in-out infinite;
}

/* Collaboration Connected State */
.collaboration-connected {
  position: relative;
}

.collaboration-disconnected::before {
  content: 'Reconnecting...';
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1rem;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  color: #92400e;
  z-index: 50;
  animation: fade-in 0.3s ease-out;
}

/* Presence Indicator Styles */
.presence-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-radius: 1rem;
  border: 1px solid #ddd6fe;
  transition: all 0.3s ease;
}

.presence-indicator:hover {
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

.presence-avatar {
  position: relative;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.presence-avatar--online {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  ring: 2px;
  ring-color: #10b981;
}

.presence-avatar--editing {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  animation: pulse-ring 1.5s ease-in-out infinite;
}

.presence-avatar--away {
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  color: #854d0e;
  opacity: 0.8;
}

.presence-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid white;
}

.presence-dot--online { background: #10b981; }
.presence-dot--editing { background: #f59e0b; animation: pulse 2s infinite; }
.presence-dot--away { background: #eab308; }
.presence-dot--offline { background: #9ca3af; }

/* Collaborative Cursor */
.collaboration-cursor {
  transition: transform 0.075s ease-out;
}

/* Section Highlighting */
.section-being-viewed {
  position: relative;
  border-left: 3px solid #8b5cf6;
  padding-left: 0.5rem;
  transition: border-color 0.3s ease;
}

.section-being-edited {
  position: relative;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.1) 0%, transparent 100%);
  border-left: 3px solid #f59e0b;
  padding-left: 0.5rem;
}

/* User Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: #f3f4f6;
  border-radius: 1rem;
}

.typing-indicator__dot {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typing-bounce 1.4s ease-in-out infinite;
}

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

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Live Update Flash */
.live-update {
  animation: live-update-flash 1s ease-out;
}

@keyframes live-update-flash {
  0% { background-color: rgba(124, 58, 237, 0.2); }
  100% { background-color: transparent; }
}

/* Collaboration Banner */
.collaboration-banner {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: white;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.collaboration-banner__users {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.collaboration-banner__text {
  font-size: 0.875rem;
  opacity: 0.9;
}
