/* Style personnalisé pour l'application de chat WebSocket */

body {
    overflow: hidden; /* Évite le double scrolling */
  }
  
  /* Structure principale - layout horizontal */
  .container-fluid {
    padding: 0;
  }
  
  .chat-section {
    width: 60%;
    height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  .code-section {
    width: 40%;
    height: 100vh;
    background-color: #f8f9fa;
    border-left: 1px solid #dee2e6;
    overflow-y: auto;
  }
  
  /* Structure du chat */
  .chat-header {
    height: 70px;
    z-index: 10;
  }
  
  .chat-main {
    display: flex;
    flex: 1;
    overflow: hidden;
  }
  
  .chat-sidebar {
    width: 250px;
    height: 100%;
    overflow-y: auto;
  }
  
  .chat-messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 200px; /* Espace pour la console */
  }
  
  #message-form {
    position: fixed;
    left: 250px; /* Largeur de la sidebar */
    right: 40%; /* Complément de la largeur de la section code (100% - 60%) */
    bottom: 200px; /* Hauteur de la console ouverte */
    background-color: #fff;
    padding: 10px;
    border-top: 1px solid #dee2e6;
    z-index: 900;
    transition: bottom 0.3s ease;
    box-shadow: 0 -5px 10px rgba(0,0,0,0.1);
  }
  
  /* Style spécifique pour le formulaire de message */
  #message-form .input-group {
    margin-bottom: 0;
  }
  
  #cancel-private {
    margin-top: 5px;
  }
  
  /* Ajuster la hauteur des messages pour éviter qu'ils ne soient cachés */
  #chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: 80px; /* Hauteur du formulaire + marge */
    margin-bottom: 0;
  }
  
  @media (max-width: 992px) {
    #message-form {
      left: 0;
      right: 0;
    }
  }
  
  /* Style pour les messages */
  .message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
    max-width: 80%;
  }
  
  .message-sent {
    background-color: #dcf8c6;
    align-self: flex-end;
    margin-left: auto;
  }
  
  .message-received {
    background-color: #f1f0f0;
    align-self: flex-start;
  }
  
  .message-private {
    background-color: #d1ecf1;
    border-left: 4px solid #0dcaf0;
  }
  
  .message-system {
    background-color: #e2e3e5;
    width: 100%;
    text-align: center;
    font-style: italic;
  }
  
  .message-time {
    font-size: 0.7rem;
    color: #888;
    margin-top: 5px;
    text-align: right;
  }
  
  .message-sender {
    font-weight: bold;
    margin-bottom: 5px;
  }
  
  /* Style pour la liste des utilisateurs */
  .user-list {
    max-height: calc(100% - 110px); /* Hauteur moins header et global room */
  }
  
  .user-item {
    cursor: pointer;
    transition: background-color 0.2s;
  }
  
  .user-item:hover {
    background-color: #f8f9fa;
  }
  
  .user-item.active {
    background-color: #e9ecef;
  }
  
  /* Style pour la salle globale */
  .global-room {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
  }
  
  #global-room-btn {
    text-align: left;
  }
  
  #global-room-btn.active {
    background-color: #0d6efd;
    color: white;
  }
  
  /* Style pour la section de code */
  .code-container {
    height: 100%;
  }
  
  .sticky-top {
    position: sticky;
    top: 0;
    z-index: 100;
  }
  
  /* Style pour les blocs de code */
  pre {
    margin: 0;
    padding: 0;
    background: transparent;
  }
  
  pre code {
    font-size: 0.85rem;
    white-space: pre-wrap;
  }
  
  .accordion-body {
    padding: 0.5rem;
  }
  
  /* Style pour la console */
  .console-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background-color: #212529;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
  }
  
  .console-panel.collapsed {
    transform: translateY(calc(100% - 40px));
  }
  
  .console-header {
    cursor: pointer;
    background-color: #343a40;
    flex-shrink: 0;
  }
  
  .console-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  
  .console-body .tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .console-body .tab-pane {
    flex: 1;
    display: flex;
  }
  
  .console-output {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    color: #fff;
    background-color: #212529;
  }
  
  #client-console {
    color: #02d302;
  }
  
  #server-console {
    color: #ffc107;
  }
  
  /* Style pour les onglets */
  .nav-tabs .nav-link {
    color: rgba(255, 255, 255, 0.8);
    border-color: transparent;
  }
  
  .nav-tabs .nav-link.active {
    color: #495057;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
  }
  
  /* Animation pour les nouveaux messages */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .message-new {
    animation: fadeIn 0.3s ease-out;
  }
  
  /* Message de séparation de session */
  .message-system.session-separator {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    font-weight: bold;
    margin: 15px 0;
  }
  
  /* Style pour les messages avec historique */
  .message-history {
    opacity: 0.8;
  }
  
  /* Styles réactifs pour les petits écrans */
  @media (max-width: 992px) {
    .chat-section {
      width: 100%;
    }
    
    .code-section {
      display: none;
    }
    
    .chat-sidebar {
      width: 200px;
    }
  }
  
  @media (max-width: 768px) {
    .chat-main {
      flex-direction: column;
    }
    
    .chat-sidebar {
      width: 100%;
      height: 150px;
      display: flex;
      flex-direction: column;
    }
    
    .user-list {
      max-height: none;
    }
  }