body { text-align: center; font-family: Arial, sans-serif; }
#peer-video { width: 600px; cursor: default; }
.point {
    position: absolute;
    width: 20px;
    height: 20px;
    pointer-events: none;
}

:root {
  --primary-color: #0a192f;        /* Dark Navy - fond principal */
  --secondary-color: #00d9ff;      /* Cyan électrique - actions principales */
  --accent-color: #ff006e;         /* Rose néon - alertes/déconnexion */
  --text-light: #e6f1ff;           /* Blanc bleuté - texte */
  --bg-dark: #020c1b;              /* Noir profond - arrière-plans */
  --surface-dark: #112240;         /* Surface sombre - cartes */
  --border-glow: rgba(0, 217, 255, 0.3); /* Bordures lumineuses */
  --shadow: 0 8px 32px rgba(0, 217, 255, 0.15); /* Ombres cyan */
  --glow-effect: 0 0 20px rgba(0, 217, 255, 0.4); /* Effet néon */
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    -45deg,
    #020c1b,      /* Noir profond */
    #0a192f,      /* Dark Navy */
    #112240,      /* Surface sombre */
    #00394d,      /* Cyan sombre */
    #001a33,      /* Bleu nuit */
    #0d1b2a       /* Bleu très foncé */
  );
  background-size: 400% 400%;
  animation: gradient 20s ease infinite;
  z-index: -1;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-light);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  position: relative;
}

/* Pour améliorer la lisibilité du contenu sur le fond animé */
#video-chat-lobby {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#video-chat-room {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(5px);
  border-radius: 20px;
  padding: 30px;
}

h2 {
  font-size: 24px;
  padding: 20px;
  color: var(--text-light);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 300;
}

#video-chat-lobby {
  text-align: center;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.1);
  margin: 50px auto;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 20px;
}

#chat-window {
  height: 400px;
  overflow: auto;
  background: #f9f9f9;
}

/* Style de base pour tous les messages */
#output p {
  padding: 10px 15px;
  width: 90%; /* Changé de max-width à width */
  word-wrap: break-word;
  position: relative;
  animation: slideIn 0.3s ease-out;
  text-align: left;
  margin: 8px auto; /* Centré avec des marges automatiques */
}

#output p strong {
  display: block;
  font-size: 0.8em;
  margin-bottom: 4px;
  opacity: 0.8;
}

/* Messages à droite en bleu */
.my-message {
  background: linear-gradient(135deg, #112240 0%, #1a3a52 100%);
  color: var(--text-light);
  margin-left: auto !important;
  margin-right: 10px !important;
  border-radius: 12px 12px 0 12px;
  border: 1px solid var(--border-glow);
  box-shadow: var(--shadow);
}

/* Messages à gauche en gris */
.other-message {
  background: linear-gradient(135deg, #0a192f 0%, #112240 100%);
  color: var(--text-light);
  margin-right: auto !important;
  margin-left: 10px !important;
  border-radius: 12px 12px 12px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animation d'apparition des messages */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#feedback p {
  color: #aaa;
  padding: 14px 0px;
  margin: 0 20px;
}

#output strong {
  color: #000000;
}

label {
  box-sizing: border-box;
  display: block;
  padding: 10px 20px;
}

input {
  padding: 15px 20px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  width: 90%;
  margin: 10px auto;
  font-size: 16px;
  color: var(--primary-color);
  transition: all 0.3s ease;
}

input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--secondary-color);
  transform: translateY(-2px);
}

#join {
  background: var(--secondary-color);
  color: white;
  font-size: 18px;
  padding: 15px 30px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  width: 90%;
  margin: 20px auto;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

#join:hover {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

#video-chat-room {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

#user-video, #peer-video {
  position: relative;
  border-radius: 15px;
  box-shadow: var(--shadow);
  background: rgba(0, 0, 0, 0.2);
  width: 600px;
  height: auto;
  transition: all 0.3s ease;
  z-index: 1;
}

#user-video:hover, #peer-video:hover {
  transform: scale(1.02);
}

#peer-video {
  transition: max-width 0.3s ease;
  width: 100%;
  height: auto;
  object-fit: contain;
}

#peer-video.video-default {
  max-width: 500px !important;
  width: 100%;
  height: auto;
  transition: all 0.3s ease;
}

#peer-video.video-fullwidth {
  max-width: 100% !important;
  width: 100%;
  height: auto;
  transition: all 0.3s ease;
}

/* Ajuste la disposition quand la vidéo est en plein écran */
#video-chat-room:has(#peer-video.video-fullwidth) {
  max-width: 1200px;
  padding: 20px;
}

#btn-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px auto;
  max-width: 600px;
  padding: 0 20px;
}

.btn-group button {
  background: var(--primary-color);
  color: var(--text-light);
  border: none;
  padding: 12px;
  width: 50px;  /* légèrement plus grand */
  height: 50px; /* légèrement plus grand */
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-group button i {
  font-size: 20px; /* taille des icônes plus grande */
}

.btn-group button:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--glow-effect);
  transition: all 0.3s ease;
}

.btn-group button:active,
.btn-group button.active {
  box-shadow: var(--glow-effect), inset 0 0 10px rgba(0, 217, 255, 0.2);
}

#BtnLeave {
  background: var(--accent-color);
}

#BtnLeave:hover {
  background: #c0392b;
}

#BtnPoint {
    background: var(--primary-color);
    transition: all 0.3s ease;
}

#BtnPoint:hover {
    background: var(--secondary-color);
}

#BtnPoint.active {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.5);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

#video-chat-lobby, #video-chat-room, #btn-group {
  animation: fadeIn 0.5s ease-out;
}

/* Pour index.html uniquement */
.invite-section {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 15px;
  z-index: 1000;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.invite-section input[type="tel"] {
  padding: 12px 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  width: 180px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-light);
  font-size: 14px;
  transition: all 0.3s ease;
}

.invite-section input[type="tel"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.invite-section input[type="tel"]:focus {
  outline: none;
  border-color: var(--secondary-color);
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.invite-section button {
  background: var(--secondary-color);
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.invite-section button:hover {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.invite-section button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(52, 152, 219, 0.2);
}

/* Animation d'entrée */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.invite-section {
  animation: slideIn 0.5s ease-out;
}

@keyframes slideDown {
  from {
    height: auto;
  }
  to {
    height: 50px;
  }
}

@keyframes slideUp {
  from {
    height: 50px;
  }
  to {
    height: auto;
  }
}

#chat-app {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 350px;
  background: rgba(25, 25, 25, 0.95);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: height 0.5s ease-out;
  z-index: 1000;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header h2 {
  margin: 0;
  padding: 0;
}

/* Bouton toggle chat avec icône */
.chat-toggle-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-toggle-btn:hover {
  background: rgba(0, 217, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.chat-toggle-btn i {
  font-size: 20px;
}

/* Badge de notification */
.chat-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent-color);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-badge 1.5s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

#chat-window {
  height: 350px;
  overflow-y: auto;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  scroll-behavior: smooth;
}

.chat-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
}

#message {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 14px;
}

#message:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 15px var(--border-glow);
  background: rgba(17, 34, 64, 0.8);
}

#send, #file-btn {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--secondary-color) 0%, #0099cc 100%);
  box-shadow: var(--shadow);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#send:hover, #file-btn:hover {
  box-shadow: var(--glow-effect);
  transform: translateY(-2px) scale(1.05);
}

#file-btn {
  background: linear-gradient(135deg, #00b894 0%, #00a383 100%);
}

#send i, #file-btn i {
  font-size: 16px;
}

#file-btn:hover {
  background: #2ecc71;
}

/* Scrollbar personnalisée */
#chat-window::-webkit-scrollbar {
  width: 6px;
}

#chat-window::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

#chat-window::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Animation des messages */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Style pour le champ username */
#username {
  width: calc(100% - 40px);
  padding: 8px 12px;
  margin: 0 20px 15px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 14px;
}

#username:focus {
  outline: none;
  border-color: #2980b9;
}

.video-default {
  max-width: 500px;
  width: 100%;
  height: auto;
}

.video-fullwidth {
  max-width: 1280px;
  width: 60%;
  height: auto;
}

/* Styles pour le tableau des rooms */
#rooms {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#rooms thead {
    background: rgba(44, 62, 80, 0.9);
}

#rooms th {
    padding: 15px 20px;
    text-align: left;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* Aligner la dernière colonne d'en-tête à gauche */
#rooms th:last-child {
    text-align: left;
}

#rooms tbody tr {
    transition: all 0.3s ease;
}

#rooms tbody tr:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

#rooms td {
    padding: 15px 20px;
    color: var(--text-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Aligner la dernière colonne à gauche */
#rooms td:last-child {
    text-align: left;
}

/* Style pour les boutons dans le tableau */
#rooms button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#rooms button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

#rooms button:disabled {
    background: var(--accent-color);
    cursor: not-allowed;
    opacity: 0.7;
}

#rooms button:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Animation d'entrée pour les nouvelles lignes */
@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#rooms tbody tr {
    animation: fadeInRow 0.3s ease-out forwards;
}

/* Style pour les statuts */
#rooms td:nth-child(2) {
    position: relative;
    padding-left: 30px;
}

#rooms td:nth-child(2)::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;  /* Vert pour "Libre" */
}

#rooms td[data-status="Occupé"]::before {
    background: #e74c3c;  /* Rouge pour "Occupé" */
}

/* Nouveau style pour technicien.html */

.Technicien {
  display: none !important;
}

/* Masquer la vidéo locale pour le technicien uniquement */
.technicien-interface #user-video {
  display: none !important;
}

/* Masquer le bouton caméra pour le technicien */
.technicien-interface #BtnCamOff {
  display: none !important;
}

.zoom-wrapper {
    position: relative;
    transition: transform 0.3s ease;
}

#peer-video.zoomed {
    cursor: move;
}

#BtnZoomIn, #BtnZoomOut {
    background: var(--primary-color);
}

#BtnZoomIn:hover, #BtnZoomOut:hover {
    background: var(--secondary-color);
}

#BtnZoomIn.active, #BtnZoomOut.active {
    background: var(--accent-color);
}

.zoom-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: none;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px;
    border-radius: 5px;
    z-index: 1000;
}

.zoom-level {
    color: white;
    font-size: 12px;
    margin: 0 5px;
}

/* Style pour le groupe de boutons */
.btn-group {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(25, 25, 25, 0.95);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    display: flex;
    gap: 10px;
}

/* Ajustement du chat pour qu'il reste au-dessus des autres éléments */
#chat-app {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background: rgba(25, 25, 25, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: height 0.5s ease-out;
    z-index: 1000;
}

/* Style pour les boutons de zoom */
.page-zoom-controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(25, 25, 25, 0.95);
    padding: 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Style pour s'assurer que les boutons restent cliquables */
.btn-group button,
.page-zoom-controls button,
#chat-app button {
    z-index: 1001;
}

/* Animation de survol pour tous les boutons */
.btn-group button:hover,
.page-zoom-controls button:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* Style pour le contenu principal */
#video-chat-room {
    margin-bottom: 100px; /* Espace pour les boutons fixes */
}

/* Media Queries pour Mobile */
@media (max-width: 768px) {
    /* Base layout */
    html, body {
        max-width: 100%;
        overflow-x: hidden;
        position: relative;
    }

    /* Container principal */
    #video-chat-room {
        width: 100%;
        padding: 10px;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Ajustement des vidéos pour mobile */
    #peer-video.video-default {
        max-width: 180px !important; /* Plus petit */
        width: 100%;
        height: auto;
    }

    #user-video {
        max-width: 380px !important; /* Plus grand */
        width: 100%;
        height: auto;
    }

    /* Groupe de boutons */
    .btn-group {
        position: fixed;
        bottom: 70px; /* Changé de 90px à 70px pour descendre encore plus les boutons */
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        display: flex;
        justify-content: center;
        gap: 25px;
        padding: 15px;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(10px);
        border-radius: 50px;
        z-index: 998;
        transition: transform 0.3s ease;
    }

    /* Chat */
    #chat-app {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px; /* Réduit de 80px à 60px pour plus d'espace */
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(10px);
        border-radius: 20px 20px 0 0;
        z-index: 999;
        transition: height 0.3s ease;
    }

    /* Quand le chat est déplié */
    #chat-app.expanded {
        height: 70vh;
    }

    /* Cache les boutons quand le chat est déplié */
    #chat-app.expanded + .btn-group {
        transform: translateX(-50%) translateY(100px);
    }
}

/* Ajustements pour très petits écrans */
@media (max-width: 480px) {
    #peer-video.video-default {
        max-width: 150px !important;
    }

    #user-video {
        max-width: 320px !important;
    }
}

/* Mode paysage sur mobile */
@media screen and (max-width: 899px) and (orientation: landscape) and (max-height: 500px) {
    /* Base layout */
    html, body {
        max-width: 100%;
        overflow-x: hidden;
        position: relative;
        height: 100vh;
        margin: 0;
        padding: 0;
    }

    /* Container principal */
    #video-chat-room {
        width: 100%;
        height: calc(100vh - 130px); /* Espace pour le chat et les boutons */
        padding: 10px;
        margin: 0;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 20px;
    }

    /* Vidéos */
    #peer-video.video-default {
        width: 40vw !important;
        height: auto !important;
        max-height: calc(100vh - 160px) !important;
        margin: 0;
        object-fit: contain;
    }

    #user-video {
        width: 40vw !important;
        height: auto !important;
        max-height: calc(100vh - 160px) !important;
        margin: 0;
        object-fit: contain;
    }

    /* Groupe de boutons */
    .btn-group {
        position: fixed;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 12px;
        padding: 10px 20px;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(10px);
        border-radius: 50px;
        z-index: 998;
        transition: transform 0.3s ease;
    }

    .btn-group button {
        width: 45px;
        height: 45px;
        padding: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .btn-group button i {
        font-size: 18px;
    }

    .btn-group button:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
    }

    #BtnLeave {
        background: rgba(220, 53, 69, 0.8) !important;
    }

    #BtnLeave:hover {
        background: rgba(220, 53, 69, 1) !important;
    }

    /* Chat */
    #chat-app {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100% !important;
        height: 60px;
        margin: 0 !important;
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(10px);
        border-radius: 20px 20px 0 0;
        z-index: 999;
        transition: all 0.3s ease;
    }

    /* Quand le chat est déplié - AGRANDI */
    #chat-app.expanded {
        height: 90vh !important; /* Augmenté à 90vh au lieu de 60vh */
        bottom: 0;
    }

    /* Contenu du chat - AGRANDI */
    #chat-window {
        height: calc(100% - 60px);
        padding: 15px;
        overflow-y: auto;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    #chat-app.expanded #chat-window {
        opacity: 1;
    }

    /* Zone de saisie du chat */
    .chat-input-group {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 10px;
        background: rgba(0, 0, 0, 0.7);
        box-sizing: border-box;
        display: flex;
        gap: 10px;
        align-items: center;
    }

    /* Input de message */
    #message {
        flex: 1;
        padding: 10px 15px;
        font-size: 14px;
        border-radius: 25px;
        border: none;
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    #send {
        width: 40px;
        height: 40px;
        padding: 0;
        font-size: 16px;
        border-radius: 50%;
        background: #2980b9;
        color: white;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    #send:hover {
        background: #3498db;
        transform: scale(1.05);
    }

    /* Messages dans le chat */
    #output p {
        font-size: 13px;
        padding: 10px 15px;
        margin: 5px 0;
        border-radius: 15px;
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    /* Animation quand le chat est déplié */
    #chat-app.expanded + .btn-group {
        transform: translateX(-50%) translateY(-85vh); /* Ajusté pour suivre l'agrandissement */
    }
}

/* Ajustements pour très petits écrans en mode paysage */
@media screen and (max-width: 899px) and (orientation: landscape) and (max-height: 500px) {
    #peer-video.video-default {
        max-width: 120px !important;
        height: 90px !important;
    }

    #user-video {
        max-width: 240px !important;
        height: 180px !important;
    }

    #chat-app.expanded {
        height: 90vh !important;
    }

    /* Contenu du chat */
    #chat-window {
        display: block !important; /* FORCE L'AFFICHAGE */
        height: calc(90vh - 120px) !important; /* Hauteur calculée pour laisser de la place pour l'input */
        overflow-y: auto !important;
        background: rgba(0, 0, 0, 0.5);
        padding: 10px;
    }

    #output {
        display: block !important; /* FORCE L'AFFICHAGE */
        opacity: 1 !important; /* FORCE L'OPACITÉ */
    }
}

/* ==========================================
   INDICATEUR D'ÉTAT DE CONNEXION
   ========================================== */

.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    z-index: 9998;
    transition: all 0.3s ease;
}

.connection-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* État : Connecté */
.connection-status.connected .connection-status-dot {
    background: #27ae60;
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
}

.connection-status.connected .connection-status-text {
    color: #27ae60;
}

/* État : Reconnexion */
.connection-status.reconnecting .connection-status-dot {
    background: #f39c12;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
    animation: pulse 1.5s ease-in-out infinite;
}

.connection-status.reconnecting .connection-status-text {
    color: #f39c12;
}

/* État : Déconnecté */
.connection-status.disconnected .connection-status-dot {
    background: #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.connection-status.disconnected .connection-status-text {
    color: #e74c3c;
}

/* État : En attente */
.connection-status.waiting .connection-status-dot {
    background: #95a5a6;
    box-shadow: 0 0 10px rgba(149, 165, 166, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

.connection-status.waiting .connection-status-text {
    color: #95a5a6;
}

/* Animation de pulsation pour la reconnexion */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Responsive mobile */
@media (max-width: 768px) {
    .connection-status {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .connection-status-dot {
        width: 8px;
        height: 8px;
    }
}

