/* ===== COLLABORATION STYLES ===== */

/* Collaborators Panel */
.collaborators-panel {
  position: fixed;
  top: 60px;
  right: 0;
  width: 320px;
  height: calc(100vh - 60px);
  background: white;
  border-left: 1px solid #e5e7eb;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.collaborators-panel.open {
  transform: translateX(0);
}

.collaborators-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.collaborators-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.btn-close-panel {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: #6b7280;
  border-radius: 6px;
  transition: background 0.2s;
}

.btn-close-panel:hover {
  background: #f3f4f6;
}

.collaborators-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.collaborator-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.collaborator-item:hover {
  background: #f9fafb;
}

.collaborator-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #667eea;
  position: relative;
}

.collaborator-avatar.online::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid white;
  border-radius: 50%;
}

.collaborator-info {
  flex: 1;
  min-width: 0;
}

.collaborator-name {
  font-weight: 500;
  font-size: 0.9375rem;
  color: #111827;
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collaborator-role {
  font-size: 0.8125rem;
  color: #6b7280;
}

.collaborator-status {
  font-size: 0.75rem;
  color: #10b981;
  font-weight: 500;
}

.btn-remove-collaborator {
  padding: 6px;
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.2s;
}

.collaborator-item:hover .btn-remove-collaborator {
  opacity: 1;
}

.btn-remove-collaborator:hover {
  background: #fee2e2;
}

.btn-invite {
  width: 100%;
  padding: 0.75rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
}

.btn-invite:hover {
  background: #5568d3;
}

/* Invite Modal */
.invite-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.invite-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  padding: 2rem;
}

.invite-modal-header {
  margin-bottom: 1.5rem;
}

.invite-modal-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.invite-modal-header p {
  color: #6b7280;
  margin: 0;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9375rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9375rem;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.form-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 1.5rem;
}

.btn-modal-primary {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-modal-primary:hover {
  background: #5568d3;
}

.btn-modal-primary:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.btn-modal-secondary {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-modal-secondary:hover {
  background: #e5e7eb;
}

/* Comments Thread */
.comments-panel {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  border: 1px solid #e5e7eb;
}

.comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.comments-header h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.comment-count {
  color: #6b7280;
  font-size: 0.875rem;
}

.comment-item {
  padding: 1rem;
  border-radius: 8px;
  background: #f9fafb;
  margin-bottom: 12px;
}

.comment-item.resolved {
  opacity: 0.6;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5e7eb;
}

.comment-author-info {
  display: flex;
  flex-direction: column;
}

.comment-author-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: #111827;
}

.comment-timestamp {
  font-size: 0.75rem;
  color: #9ca3af;
}

.comment-actions {
  display: flex;
  gap: 8px;
}

.btn-comment-action {
  padding: 4px 8px;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 0.8125rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-comment-action:hover {
  background: #f3f4f6;
  color: #374151;
}

.comment-content {
  color: #374151;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.mention {
  color: #667eea;
  font-weight: 500;
  background: rgba(102, 126, 234, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
}

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

.comment-resolved-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #d1fae5;
  color: #065f46;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.comment-input {
  display: flex;
  gap: 8px;
  margin-top: 1rem;
}

.comment-textarea {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.comment-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-add-comment {
  align-self: flex-end;
  padding: 0.75rem 1.5rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-add-comment:hover {
  background: #5568d3;
}

.btn-add-comment:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

/* Presence Indicators */
.presence-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.presence-avatars {
  display: flex;
  margin-left: auto;
}

.presence-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid white;
  margin-left: -8px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #667eea;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s;
}

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

.presence-avatar:hover {
  transform: scale(1.1);
  z-index: 10;
}

.presence-avatar::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid white;
  border-radius: 50%;
}

.presence-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8125rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.presence-avatar:hover .presence-tooltip {
  opacity: 1;
}

.editing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Comments in Activity Cards */
.comments-section {
  margin-top: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.comments-header h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
  color: #374151;
}

.btn-close-comments {
  padding: 4px;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-close-comments:hover {
  background: #e5e7eb;
  color: #374151;
}

.comments-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

.empty-comments {
  text-align: center;
  padding: 1.5rem;
  color: #9ca3af;
  font-size: 0.875rem;
}

.comment-error {
  padding: 1rem;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 6px;
  font-size: 0.875rem;
}

.comment-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.comment-input-wrapper .comment-textarea {
  flex: 1;
  min-height: 60px;
}

.btn-add-comment {
  padding: 0.625rem 1rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-add-comment:hover {
  background: #5568d3;
}

.comment-actions-inline {
  display: flex;
  gap: 6px;
}

.btn-comment-action-sm {
  padding: 4px 10px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #6b7280;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-comment-action-sm:hover {
  background: #e5e7eb;
  color: #374151;
}

.comment-replies {
  margin-left: 2.5rem;
  margin-top: 0.75rem;
  padding-left: 1rem;
  border-left: 2px solid #e5e7eb;
}

.comment-count {
  font-size: 0.75rem;
  color: #667eea;
  font-weight: 600;
  margin-left: 4px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .collaborators-panel {
    width: 100%;
    max-width: 400px;
  }

  .invite-modal-content {
    margin: 1rem;
  }

  .presence-bar {
    flex-wrap: wrap;
  }

  .comments-panel {
    padding: 0.75rem;
  }

  .comment-reply,
  .comment-replies {
    margin-left: 1rem;
  }

  .comment-input-wrapper {
    flex-direction: column;
  }

  .btn-add-comment {
    width: 100%;
    justify-content: center;
  }
}
