/**
 * Conversation Linking Common Styles
 * Layout and structure styles (no colors)
 */

/* Linking mode styles */
.conversation-item.selected-for-linking {
  border-left-width: 3px;
  border-left-style: solid;
}

.conversation-item.has-linked-conversations {
  position: relative;
}

.conversation-item.has-linked-conversations::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

/* Linked indicator badge */
.linked-indicator {
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.linked-indicator:hover {
  transform: scale(1.05);
}

/* Linking control checkbox */
.linking-control {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.linking-control .form-check-input {
  cursor: pointer;
  width: 1.25rem;
  height: 1.25rem;
}

.linking-control .form-check-label {
  cursor: pointer;
  user-select: none;
}

/* Highlight animation for navigation */
.conversation-item.highlight-conversation {
  animation: highlight 2s ease;
}

/* Linking instructions alert */
#linkingInstructions {
  margin: 1rem;
  border-left-width: 4px;
  border-left-style: solid;
}

/* Link button states */
#linkConversationsBtn {
  transition: all 0.3s ease;
}

#linkConversationsBtn.btn-warning {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
  }
}

/* Modal styles for linked conversations */
#linkedConversationsModal .list-group-item {
  transition: all 0.2s ease;
}

#linkedConversationsModal .list-group-item:hover {
  transform: translateX(5px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .linking-control .form-check-label small {
    display: none;
  }
  
  .linked-indicator {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
  
  #linkConversationsBtn {
    font-size: 0.875rem;
  }
  
  #linkingInstructions {
    margin: 0.5rem;
    font-size: 0.9rem;
  }
}

/* Tooltip styles */
.linked-indicator[title] {
  position: relative;
}

.linked-indicator[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 0.25rem;
}

/* Loading state for linking operations */
.linking-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.linking-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-width: 2px;
  border-style: solid;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
