/*
 * Collaboration Features
 * Live cursors, collaborative editing, annotations
 */

/* Cursor Presence */
.presence-demo {
  position: relative;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  height: 180px;
  overflow: hidden;
}

.presence-cursor {
  position: absolute;
  pointer-events: none;
}

.presence-pointer {
  display: block;
}

.presence-label {
  position: absolute;
  top: 16px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: white;
  white-space: nowrap;
}

.presence-content {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  color: var(--text-secondary);
  font-size: 12px;
}

/* Call Controls */
.call-controls {
  display: flex;
  gap: 8px;
  padding: 12px;
  background-color: var(--bg-secondary);
  border-radius: 12px;
  width: fit-content;
}

.call-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  font-size: 20px;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s;
  position: relative;
}

.call-btn:hover {
  background-color: var(--border-color);
  transform: scale(1.05);
}

.call-btn-off {
  background-color: #EF4444 !important;
}

.call-btn-active {
  background-color: var(--accent-primary) !important;
}

.call-btn-end {
  background-color: #EF4444;
}

.call-btn-end:hover {
  background-color: #DC2626;
}

.call-btn-badge::after {
  content: '3';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background-color: #EF4444;
  border-radius: 50%;
  font-size: 11px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Screen Share Preview */
.screen-share-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  width: 240px;
}

.screen-share-preview {
  height: 135px;
  background-color: var(--bg-tertiary);
}

.screen-share-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  font-size: 14px;
  gap: 8px;
}

.screen-share-placeholder span:first-child {
  font-size: 32px;
}

.screen-share-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
}

.screen-share-name {
  font-size: 14px;
  font-weight: 500;
}

.screen-share-status {
  font-size: 11px;
}

.screen-share-live {
  color: #EF4444;
  animation: pulse 2s infinite;
}

.screen-share-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

.screen-share-card-minimized {
  width: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

.screen-share-mini {
  font-size: 20px;
}

/* =================================================================
   COLLABORATION COMPONENTS
   ================================================================= */

/* Live Cursors */
.live-cursors-demo {
  position: relative;
  min-height: 300px;
}

.cursor-canvas {
  position: relative;
  min-height: 280px;
  padding: 40px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.live-cursor {
  position: absolute;
  pointer-events: none;
  z-index: 10;
}

.cursor-pointer {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.cursor-label {
  position: absolute;
  top: 18px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

.canvas-content {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* @Mention Autocomplete */
.mention-container {
  position: relative;
  max-width: 400px;
}

.mention-input-wrapper {
  position: relative;
}

.mention-input {
  width: 100%;
  min-height: 80px;
  padding: 12px 16px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  outline: none;
}

.mention-input:focus {
  border-color: var(--accent-primary);
}

.mention-tag {
  padding: 2px 6px;
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border-radius: 4px;
  font-weight: 500;
}

.mention-highlight {
  color: var(--accent-primary);
  font-weight: 500;
}

.mention-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 100;
}

.mention-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.mention-option:hover,
.mention-option-active {
  background-color: var(--bg-secondary);
}

.mention-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.mention-user-info {
  flex: 1;
}

.mention-user-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.mention-user-handle {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Reaction Picker */
.reaction-examples {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message-reactions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reaction-chip:hover {
  background-color: var(--bg-tertiary);
}

.reaction-chip-active {
  background-color: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
}

.reaction-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.reaction-add {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reaction-add:hover {
  background-color: var(--bg-tertiary);
  border-style: solid;
}

.reaction-add svg {
  color: var(--text-secondary);
}

.reaction-picker {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  max-width: 320px;
}

.reaction-picker-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
}

.reaction-picker-search input {
  width: 100%;
  padding: 8px 12px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}

.reaction-picker-search input::placeholder {
  color: var(--text-secondary);
}

.reaction-picker-tabs {
  display: flex;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.reaction-tab {
  padding: 6px 8px;
  background: none;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.reaction-tab:hover {
  background-color: var(--bg-secondary);
}

.reaction-tab-active {
  background-color: var(--bg-tertiary);
}

.reaction-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.reaction-emoji {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 4px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reaction-emoji:hover {
  background-color: var(--bg-secondary);
  transform: scale(1.2);
}

.reaction-picker-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.reaction-preview {
  font-size: 24px;
}

.reaction-name {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Comment Annotation */
.annotation-canvas {
  position: relative;
  display: inline-block;
}

.annotation-content {
  position: relative;
}

.annotation-image {
  display: block;
  max-width: 100%;
  border-radius: 8px;
}

.annotation-pin {
  position: absolute;
  z-index: 10;
}

.annotation-marker {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-primary);
  border: 2px solid white;
  border-radius: 50%;
  color: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  transition: transform 0.15s ease;
}

.annotation-marker:hover {
  transform: scale(1.1);
}

.annotation-pin-resolved .annotation-marker {
  background-color: var(--accent-green);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.annotation-thread {
  position: absolute;
  top: 32px;
  left: 0;
  width: 280px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 20;
}

.annotation-comment {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.annotation-comment:last-of-type {
  border-bottom: none;
}

.annotation-reply {
  background-color: var(--bg-secondary);
}

.annotation-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

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

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

.annotation-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.annotation-time {
  font-size: 11px;
  color: var(--text-secondary);
}

.annotation-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
}

.annotation-reply-input {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.annotation-reply-input input {
  flex: 1;
  padding: 8px 12px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
}

.annotation-reply-input input::placeholder {
  color: var(--text-secondary);
}

.annotation-reply-input input:focus {
  border-color: var(--accent-primary);
}

