/* Styles pour les interactions sociales (forum, messagerie, partage) */

/* Conteneur principal */
.social-container {
  display: flex;
  height: 100%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Barre latérale des discussions */
.social-sidebar {
  width: 300px;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
}

.social-header {
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.social-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #333;
}

/* Liste des discussions */
.discussions-list {
  flex: 1;
  overflow-y: auto;
}

.discussion-item {
  padding: 1rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
  background: #fff;
}

.discussion-item:hover {
  background-color: #f8f9fa;
}

.discussion-item.active {
  background-color: #e9f5ff;
  border-left: 3px solid #0d6efd;
}

.discussion-title {
  font-weight: 500;
  margin: 0 0 0.25rem 0;
  color: #333;
}

.discussion-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #6c757d;
}

.discussion-preview {
  font-size: 0.9rem;
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.25rem;
}

/* Vue de discussion */
.discussion-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.discussion-header {
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.discussion-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
}

/* Messages */
.messages-container {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
}

.no-discussion-selected {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6c757d;
  text-align: center;
  padding: 2rem;
}

.no-discussion-selected i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #dee2e6;
}

.message {
  max-width: 70%;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  position: relative;
  word-wrap: break-word;
}

.message.sent {
  align-self: flex-end;
  background-color: #0d6efd;
  color: white;
  border-top-right-radius: 0.25rem;
}

.message.received {
  align-self: flex-start;
  background-color: #e9ecef;
  color: #212529;
  border-top-left-radius: 0.25rem;
}

.message-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.message-sender {
  font-weight: bold;
}

.message-time {
  color: #6c757d;
  margin-left: 0.5rem;
}

.message-content {
  line-height: 1.4;
}

/* Zone de saisie de message */
.message-input-container {
  display: flex;
  padding: 1rem;
  border-top: 1px solid #e0e0e0;
  background: #fff;
}

#message-input {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 1px solid #ced4da;
  border-radius: 1.5rem;
  margin-right: 0.5rem;
  outline: none;
  transition: border-color 0.2s;
}

#message-input:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#send-message-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modales */
.modal-content {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
  border-bottom: 1px solid #e9ecef;
  padding: 1rem 1.5rem;
}

.modal-title {
  font-weight: 500;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 1rem 1.5rem;
}

/* Mode sombre */
[data-theme="dark"] .social-container,
[data-theme="dark"] .social-sidebar,
[data-theme="dark"] .discussion-view,
[data-theme="dark"] .messages-container {
  background-color: #212529;
  color: #f8f9fa;
}

[data-theme="dark"] .social-header,
[data-theme="dark"] .discussion-header,
[data-theme="dark"] .message-input-container {
  background-color: #2c3034;
  border-color: #373b3e;
}

[data-theme="dark"] .discussion-item {
  background-color: #2c3034;
  border-color: #373b3e;
  color: #f8f9fa;
}

[data-theme="dark"] .discussion-item:hover {
  background-color: #373b3e;
}

[data-theme="dark"] .discussion-item.active {
  background-color: #1a3a5f;
}

[data-theme="dark"] .discussion-title,
[data-theme="dark"] .discussion-header h3,
[data-theme="dark"] .social-header h3 {
  color: #f8f9fa;
}

[data-theme="dark"] .message.received {
  background-color: #2c3034;
  color: #f8f9fa;
}

[data-theme="dark"] #message-input {
  background-color: #2c3034;
  border-color: #373b3e;
  color: #f8f9fa;
}

/* Réactivité */
@media (max-width: 768px) {
  .social-container {
    flex-direction: column;
    height: auto;
  }
  
  .social-sidebar {
    width: 100%;
    height: 300px;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }
  
  .discussion-view {
    height: 400px;
  }
  
  .message {
    max-width: 85%;
  }
}

/* Styles pour le partage social */

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

.share-modal-content {
  background-color: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

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

.share-modal-header h4 {
  margin: 0;
  color: var(--text-color);
  font-weight: 600;
}

.share-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
}

.share-modal-close:hover {
  color: var(--text-color);
  background-color: var(--secondary-color);
}

.share-modal-body {
  padding: 1.5rem;
}

/* Options de partage */
.share-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: white;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-color);
}

.share-option:hover {
  background-color: var(--secondary-color);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text-color);
}

.share-option i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.share-option span {
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

/* Lien de partage */
.share-link {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background-color: var(--secondary-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.share-link input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-color);
  font-size: 0.875rem;
  outline: none;
}

.share-link button {
  flex-shrink: 0;
}

/* Éléments d'annotation */
.bookmark-item,
.note-item,
.highlight-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  margin-bottom: 0.5rem;
  background-color: white;
  transition: var(--transition);
}

.bookmark-item:hover,
.note-item:hover,
.highlight-item:hover {
  background-color: var(--secondary-color);
  border-color: var(--primary-color);
}

.bookmark-info,
.note-content,
.highlight-info {
  flex: 1;
  min-width: 0;
}

.bookmark-info h5,
.highlight-info span {
  margin: 0 0 0.25rem 0;
  font-weight: 600;
  color: var(--text-color);
}

.bookmark-info small,
.note-content small,
.highlight-info small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.note-content p {
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
  color: var(--text-color);
}

.bookmark-actions,
.note-item button,
.highlight-item button {
  flex-shrink: 0;
}

/* Aperçu de couleur de surlignage */
.highlight-color-preview {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
}

/* Boutons d'action */
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Mode sombre */
body.dark-mode .share-modal-content {
  background-color: #2c3034;
  color: var(--text-color);
}

body.dark-mode .share-modal-header {
  border-color: #495057;
}

body.dark-mode .share-option {
  background-color: #343a40;
  border-color: #495057;
  color: var(--text-color);
}

body.dark-mode .share-option:hover {
  background-color: #495057;
  border-color: var(--primary-color);
}

body.dark-mode .share-link {
  background-color: #343a40;
  border-color: #495057;
}

body.dark-mode .share-link input {
  color: var(--text-color);
}

body.dark-mode .bookmark-item,
body.dark-mode .note-item,
body.dark-mode .highlight-item {
  background-color: #343a40;
  border-color: #495057;
}

body.dark-mode .bookmark-item:hover,
body.dark-mode .note-item:hover,
body.dark-mode .highlight-item:hover {
  background-color: #495057;
  border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
  .share-modal {
    padding: 0.5rem;
  }
  
  .share-modal-content {
    max-width: 100%;
    margin: 0;
  }
  
  .share-options {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .share-option {
    padding: 0.75rem;
  }
  
  .share-option i {
    font-size: 1.25rem;
  }
  
  .share-option span {
    font-size: 0.75rem;
  }
  
  .bookmark-item,
  .note-item,
  .highlight-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .bookmark-actions {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .share-options {
    grid-template-columns: 1fr;
  }
  
  .share-modal-header {
    padding: 1rem;
  }
  
  .share-modal-body {
    padding: 1rem;
  }
  
  .share-link {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .share-link input {
    width: 100%;
  }
}

/* Styles pour les fonctionnalités sociales */

/* Panneau de chat */
#chat-panel {
  width: 400px;
  max-width: 90vw;
  height: 600px;
  max-height: 80vh;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
}

.welcome-message {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
}

.welcome-message i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.chat-message {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: var(--border-radius);
  max-width: 80%;
}

.chat-message.own {
  background: var(--primary-color);
  color: white;
  margin-left: auto;
}

.chat-message.other {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.message-user {
  font-weight: 600;
}

.message-time {
  opacity: 0.7;
}

.message-content {
  line-height: 1.4;
}

.chat-input-container {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
}

.chat-form .input-group {
  display: flex;
  gap: 0.5rem;
}

.chat-form input {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.75rem;
  font-size: 0.875rem;
}

.chat-form button {
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  border: none;
  background: var(--primary-color);
  color: white;
  cursor: pointer;
  transition: background-color 0.2s;
}

.chat-form button:hover {
  background: var(--primary-dark);
}

.online-indicator {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: var(--success-color);
  color: white;
  border-radius: 1rem;
}

/* Panneau d'aide */
#help-panel {
  width: 500px;
  max-width: 90vw;
  height: 600px;
  max-height: 80vh;
}

.help-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-content {
  flex: 1;
  overflow-y: auto;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
}

.faq-item h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.faq-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
}

/* Formulaire d'aide */
.help-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.help-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.help-form label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.help-form input,
.help-form textarea,
.help-form select {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.help-form input:focus,
.help-form textarea:focus,
.help-form select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-color-alpha);
}

.help-form button {
  padding: 0.75rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
}

.help-form button:hover {
  background: var(--primary-dark);
}

/* Demandes d'aide */
.help-request-item {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  background: var(--bg-secondary);
}

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

.request-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.request-status {
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.request-status.pending {
  background: var(--warning-color);
  color: white;
}

.request-status.in-progress {
  background: var(--info-color);
  color: white;
}

.request-status.resolved {
  background: var(--success-color);
  color: white;
}

.request-status.closed {
  background: var(--text-muted);
  color: white;
}

.help-request-item p {
  margin: 0 0 0.75rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
}

.request-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.request-priority {
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-weight: 600;
}

.request-priority.low {
  background: var(--success-color);
  color: white;
}

.request-priority.medium {
  background: var(--warning-color);
  color: white;
}

.request-priority.high {
  background: var(--danger-color);
  color: white;
}

.request-date {
  color: var(--text-muted);
}

/* États vides */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

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

.empty-state p {
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.empty-state small {
  font-size: 0.875rem;
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
  #chat-panel,
  #help-panel {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .chat-message {
    max-width: 90%;
  }
  
  .help-tabs {
    flex-wrap: wrap;
  }
  
  .tab-btn {
    flex: 1 1 50%;
    font-size: 0.875rem;
    padding: 0.5rem;
  }
  
  .request-header {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .request-meta {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

/* Animations */
.chat-message {
  animation: slideIn 0.3s ease-out;
}

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

/* Thème sombre */
[data-theme="dark"] .chat-messages {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .chat-message.other {
  background: var(--bg-quaternary);
}

[data-theme="dark"] .faq-item,
[data-theme="dark"] .help-request-item {
  background: var(--bg-tertiary);
  border-color: var(--border-color-dark);
}

[data-theme="dark"] .help-form input,
[data-theme="dark"] .help-form textarea,
[data-theme="dark"] .help-form select {
  background: var(--bg-tertiary);
  border-color: var(--border-color-dark);
  color: var(--text-primary);
}

/* Accessibilité */
.chat-message:focus,
.tab-btn:focus,
.help-form button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Animations réduites */
@media (prefers-reduced-motion: reduce) {
  .chat-message {
    animation: none;
  }
  
  .tab-btn,
  .help-form button {
    transition: none;
  }
}
