/* ===========================
   Collaboration Styles
   Presence, Notifications, Activity, Comments
   =========================== */

/* ===========================
   Notification Toast
   =========================== */

.notification-toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  pointer-events: none;
}

.notification-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.2s, opacity 0.3s;
  pointer-events: auto;
}

.notification-toast:hover {
  transform: translateX(-4px);
}

.notification-toast.fade-out {
  opacity: 0;
  transform: translateX(100%);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary);
  color: white;
}

.toast-icon.mention {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.toast-icon.comment {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.toast-icon.deadline {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.toast-icon.update {
  background: linear-gradient(135deg, #10b981, #34d399);
}

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

.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  margin: -4px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.toast-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ===========================
   User Menu Dropdown
   =========================== */

.user-menu {
  position: relative;
  margin-left: auto;
}

.user-menu-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.5rem 0.375rem 0.375rem;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  height: 44px;
  width: auto;
}

.user-menu-toggle:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.user-menu-toggle .user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-primary); /* Fallback */
  color: white;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(34, 211, 238, 0.2);
}

.user-menu-toggle .user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-toggle i.fa-chevron-down {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  margin-right: 0.25rem;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  overflow: hidden;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-display-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.user-email {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  width: fit-content;
  border: 1px solid var(--border-color);
  margin-top: 0.25rem;
}

.user-role-badge.admin {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.user-role-badge.editor {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.2);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: calc(100% - 1rem);
  margin: 0 0.5rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.user-dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--primary);
}

.user-dropdown-item i {
  width: 20px;
  text-align: center;
  color: var(--text-muted);
  transition: color 0.2s;
}

.user-dropdown-item:hover i {
  color: var(--primary);
}

.user-dropdown-item.danger {
  color: var(--danger);
}

.user-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.05);
}

.user-dropdown-item.danger i {
  color: var(--danger);
}

/* ===========================
   User Avatar (Global)
   =========================== */

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

/* ===========================
   Notification Bell
   =========================== */

.notification-bell-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-bell {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  font-size: 1.1rem;
}

.notification-bell:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
  color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
  border: 2px solid var(--surface);
}

.notification-badge.show {
  display: flex;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: 500px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notification-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.notification-header h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mark-all-read {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
}

.mark-all-read:hover {
  background: rgba(59, 130, 246, 0.1);
}

.notification-list {
  flex: 1;
  overflow-y: auto;
  max-height: 350px;
}

.notification-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

.notification-item:hover {
  background: var(--bg-tertiary);
}

.notification-item.unread {
  background: rgba(59, 130, 246, 0.05);
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.notification-icon.mention {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

.notification-icon.comment {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.notification-icon.status_change {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.notification-icon.deadline {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.notification-content {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.notification-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.notification-message {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.notification-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.notification-item:hover .notification-delete {
  opacity: 1;
}

.notification-delete:hover {
  color: var(--danger);
}

.notification-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.notification-empty i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.notification-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.notification-footer button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
}

.notification-footer button:hover {
  color: var(--primary);
}

/* ===========================
   In-App Notifications
   =========================== */

#notification-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.in-app-notification {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  max-width: 350px;
}

.in-app-notification.fade-out {
  animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  flex-shrink: 0;
}

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

.notif-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.notif-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.notif-close:hover {
  color: var(--text-primary);
}

/* ===========================
   Notification Permission Modal
   =========================== */

.notification-modal {
  max-width: 420px;
}

.notification-preview {
  text-align: center;
  padding: 1rem;
}

.preview-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.notification-preview p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.notification-preview ul {
  list-style: none;
  text-align: left;
  padding: 0;
}

.notification-preview li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: var(--text-primary);
}

.notification-preview li i {
  color: var(--primary);
  width: 20px;
  text-align: center;
}

/* ===========================
   Activity Panel
   =========================== */

/* ===========================
   Activity Panel (Chat Style)
   =========================== */

.activity-toggle-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  font-size: 1.1rem;
}

.activity-toggle-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
  color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.activity-panel {
  position: fixed;
  top: 80px;
  right: -420px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: calc(100vh - 100px); /* Shorter and floating */
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px; /* Rounded corners */
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1002;
  display: flex;
  flex-direction: column;
}

/* Mobile optimization for Activity Panel */
@media (max-width: 768px) {
  .activity-panel {
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 200px);
    top: 70;
    right: -100%;
    border-radius: 0;
    background: var(--bg-secondary);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: right 0.15s ease-in-out;
  }
  
  .activity-panel.open {
    right: 0;
  }

  .activity-panel-header {
      padding: 0.75rem 1rem;
  }
}

:root.dark .activity-panel {
    background: rgba(36, 51, 82, 0.98) !important;
    border-color: #3d5066 !important;
}

.activity-panel.open {
  right: 20px; /* Floating margin */
}

.activity-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

:root.dark .activity-panel-header {
    background: rgba(26, 39, 68, 0.5) !important;
    border-color: #3d5066 !important;
}

.activity-panel-header h4 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.activity-filters {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.activity-filters select {
  flex: 1;
  padding: 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.activity-filters button {
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.activity-filters button:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.activity-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
  /* Space for input area */
  padding-bottom: 1rem; 
}

/* Chat Input Area */
.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--surface);
    position: relative;
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    align-items: flex-end;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    max-height: 100px;
    min-height: 24px;
    padding: 0.25rem 0;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    resize: none;
    outline: none;
    line-height: 1.4;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    background: var(--primary-dark);
}

.chat-send-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

/* Mention Dropdown for Activity Panel Chat */
.chat-input-area .mention-dropdown {
    position: absolute;
    bottom: 100%;
    left: 1rem;
    width: 250px;
    max-height: 200px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    z-index: 1001;
    display: none;
    margin-bottom: 0.5rem;
}

.chat-input-area .mention-dropdown.show {
    display: block;
    animation: slideUpFade 0.2s ease;
}

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

.chat-input-area .mention-item {
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-light);
}

.chat-input-area .mention-item:last-child {
    border-bottom: none;
}

.chat-input-area .mention-item:hover, 
.chat-input-area .mention-item.active {
    background: var(--bg-tertiary);
}

.chat-input-area .mention-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input-area .mention-info {
    display: flex;
    flex-direction: column;
}

.chat-input-area .mention-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-input-area .mention-type {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Chat Bubble Style */
.activity-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end; /* Align avatar to bottom like chat */
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom center;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  padding: 0.5rem;
  border-radius: 12px;
  margin: -0.5rem;
  margin-bottom: 0.5rem;
}

/* Highlighted state when navigating from notification */
.activity-item.highlighted {
  background: rgba(59, 130, 246, 0.15);
  box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgba(59, 130, 246, 0.25);
  animation: highlightPulse 1s ease-in-out 2;
}

@keyframes highlightPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgba(59, 130, 246, 0.25);
  }
  50% {
    box-shadow: 0 0 0 4px var(--primary), 0 6px 20px rgba(59, 130, 246, 0.4);
  }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.activity-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  margin-bottom: 4px; /* Slight adjust for bottom alignment */
}

.activity-bubble {
    position: relative;
    background: #f8fafc;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    border-bottom-left-radius: 4px; /* Chat bubble tail effect */
    max-width: 85%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Dark mode activity bubble - use !important to override */
:root.dark .activity-bubble {
    background: #2d3d5c !important;
    border-color: #3d5066 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
}

.activity-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.activity-user {
  font-weight: 700;
  color: var(--text-primary);
}

.activity-action {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.activity-entity {
    font-weight: 600;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.08); /* Subtle highlight */
    padding: 0 4px;
    border-radius: 4px;
    cursor: pointer;
}

.activity-entity:hover {
    text-decoration: underline;
}

.activity-changes {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.03);
  padding: 0.5rem;
  border-radius: 8px;
  margin: 0.5rem 0;
  border-left: 2px solid var(--border-color);
}

.activity-time {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.activity-time i {
    font-size: 0.65rem;
}

/* Empty & Loading States */
.activity-empty,
.activity-loading {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.activity-empty i,
.activity-loading i {
  font-size: 2.5rem;
  margin-bottom: 0;
  opacity: 0.3;
}

/* ===========================
   Comments Section
   =========================== */

.comments-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.comments-header {
  margin-bottom: 1rem;
}

.comments-header h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-input-wrapper {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.comment-input-container {
  flex: 1;
  position: relative;
}

.comment-input {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  resize: none;
  transition: border-color 0.15s;
}

.comment-input:focus {
  outline: none;
  border-color: var(--primary);
}

.comment-actions,
.reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.no-comments {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-style: italic;
}

.comment {
  display: flex;
  gap: 0.75rem;
}

.comment.reply {
  margin-left: 3rem;
  margin-top: 0.75rem;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 600;
  color: var(--text-primary);
}

.comment-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.comment-edited {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.comment-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.comment-text .mention {
  color: var(--primary);
  font-weight: 500;
  background: rgba(59, 130, 246, 0.1);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.comment-footer {
  display: flex;
  gap: 1rem;
}

.comment-action {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.comment-action:hover {
  color: var(--primary);
}

.comment-action.danger:hover {
  color: var(--danger);
}

.reply-form {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.replies {
  margin-top: 0.75rem;
}

/* Mention Dropdown for Comments Section */
.comment-input-container .mention-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 200px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.comment-input-container .mention-dropdown.show {
  display: block;
}

.comment-input-container .mention-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}

.comment-input-container .mention-item:hover,
.comment-input-container .mention-item.selected {
  background: var(--bg-tertiary);
}

.comment-input-container .mention-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.75rem;
}

.comment-input-container .mention-info {
  flex: 1;
  min-width: 0;
}

.comment-input-container .mention-name {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.comment-input-container .mention-email {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===========================
   Live Cursors on Map
   =========================== */

.user-cursor-marker {
  pointer-events: none;
}

.cursor-pointer {
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  transform: rotate(-45deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cursor-pointer i {
  transform: rotate(45deg);
}

.cursor-label {
  position: absolute;
  top: 28px;
  left: 0;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: white;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===========================
   Online Users Indicator
   =========================== */

.online-users-indicator {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.online-count {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.online-count i {
  color: var(--success);
}

.online-avatars {
  display: flex;
  margin-left: -8px;
}

.online-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  border: 2px solid var(--bg-primary);
  margin-left: -8px;
}

.online-more {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 600;
  border: 2px solid var(--bg-primary);
  margin-left: -8px;
}

/* ===========================
   Project Viewers
   =========================== */

.project-viewers {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.viewer-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  border: 2px solid var(--bg-primary);
  margin-left: -8px;
}

.viewer-avatar:first-child {
  margin-left: 0;
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 768px) {
  .user-menu-toggle .user-name {
    display: none;
  }

  .user-menu-toggle i.fa-chevron-down {
    display: none;
  }

  .notification-dropdown {
    width: calc(100vw - 20px);
    right: -10px;
  }

  .activity-panel {
    width: 100%;
    right: -100%;
  }

  .activity-panel.open {
    right: 0;
  }

  .comment.reply {
    margin-left: 1.5rem;
  }
  
  /* Mobile: Reduce heavy animations for performance */
  .activity-item {
      animation: none !important;
      transition: background 0.15s ease !important;
  }
  
  .activity-item.highlighted {
      animation: none !important;
      background: rgba(59, 130, 246, 0.15);
      box-shadow: 0 0 0 2px var(--primary);
  }
  
  .chat-send-btn:hover {
      transform: none !important; /* Disable scale animation */
  }
  
  .chat-input-wrapper {
      transition: border-color 0.15s ease !important; /* Faster transition */
  }
  
  .chat-input-wrapper:focus-within {
      box-shadow: none !important; /* Remove shadow for performance */
      border-color: var(--primary);
  }
  
  .mention-dropdown.show {
      animation: none !important; /* Disable slide animation */
  }
  
  /* Simplify activity bubble animations */
  .activity-bubble {
      transition: none !important;
  }
  
  /* Reduce comment animations */
  .comment-action {
      transition: color 0.1s ease !important;
  }
}

/* ===========================
   Simple Activity Item (Login/Logout)
   =========================== */
.activity-item--simple {
  padding: 0.25rem 0;
  margin-bottom: 0.5rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.activity-simple-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--surface); /* Fallback or use surface */
    padding: 0.25rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    opacity: 0.8;
}

[data-theme="dark"] .activity-simple-line {
   background: var(--surface-elevated);
   border-color: var(--border);
}

.activity-simple-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.activity-item--simple .activity-user {
    font-weight: 600;
    color: var(--text);
}

.activity-action-simple {
    color: var(--text-secondary);
}

.activity-time-simple {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
    border-left: 1px solid var(--border);
    padding-left: 0.5rem;
}

