* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.main-title {
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
}

.main-title h1 {
  color: white;
  font-size: 42px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-icon {
  font-size: 32px;
  color: white;
  transition: transform 0.3s;
  cursor: pointer;
}

.toggle-icon.collapsed {
  transform: rotate(-90deg);
}

.header-content {
  background: white;
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: all 0.3s;
}

.header-content.hidden {
  display: none;
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0;
  gap: 10px;
}

.btn-danger {
  background: linear-gradient(135deg, #ff4444, #cc0000);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  transition: transform 0.2s;
  box-shadow: 0 4px 10px rgba(255, 0, 0, 0.3);
}

.btn-danger:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #ff6666, #ff0000);
}

.btn-logout {
  background: linear-gradient(135deg, #607d8b, #455a64);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  transition: transform 0.2s;
}

.btn-logout:hover {
  transform: scale(1.05);
}

.qr-section {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px solid #e0e0e0;
}

.qr-code {
  text-align: center;
  background: white;
  padding: 15px;
  border-radius: 15px;
}

.qr-code canvas {
  width: 150px;
  height: 150px;
}

.mobile-url {
  flex: 1;
  background: #f5f5f5;
  padding: 15px;
  border-radius: 10px;
}

.mobile-url input {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  font-family: monospace;
}

/* Formulaire d'inscription */
.register-form {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 15px;
  align-items: flex-end;
}

.register-form input {
  padding: 15px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
}

.register-form input:first-child {
  width: 120px;
}

.register-form input:nth-child(2) {
  flex: 1;
}

.avatar-selector,
.groupe-selector {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.avatar-selector label,
.groupe-selector label {
  font-size: 12px;
  color: #666;
  margin-left: 5px;
}

.avatar-selector select,
.groupe-selector select {
  padding: 15px;
  font-size: 20px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  background: white;
  min-width: 80px;
  text-align: center;
}

.groupe-selector select {
  font-size: 18px;
  font-weight: bold;
}

.register-form button {
  padding: 15px 30px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
}

.register-form button:hover {
  opacity: 0.9;
}

/* Sélecteur de mode buzzer */
.buzzer-mode-selector {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: 20px;
}

.mode-select {
  padding: 8px 15px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: white;
  font-weight: bold;
  cursor: pointer;
}

.btn-activate-all {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  transition: transform 0.2s;
  white-space: nowrap;
}

.btn-activate-all:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #af64cc, #9b59b6);
}

.btn-activate-all.active {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  animation: pulse 1s infinite;
}

/* Contrôles des buzzers par groupe */
.buzzer-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 20px 0;
  flex-wrap: wrap;
}

.buzzer-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.group-label {
  font-size: 18px;
  font-weight: bold;
  padding: 5px 15px;
  border-radius: 20px;
  color: white;
}

/* Couleurs des groupes 10-50 */
.group-10 {
  background: #e74c3c;
}
.group-20 {
  background: #3498db;
}
.group-30 {
  background: #2ecc71;
}
.group-40 {
  background: #f39c12;
}
.group-50 {
  background: #9b59b6;
}

.btn-buzzer-group {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s;
  color: white;
  min-width: 120px;
}

.btn-buzzer-group.group-10 {
  background: #c0392b;
}
.btn-buzzer-group.group-20 {
  background: #2980b9;
}
.btn-buzzer-group.group-30 {
  background: #27ae60;
}
.btn-buzzer-group.group-40 {
  background: #d68910;
}
.btn-buzzer-group.group-50 {
  background: #7d3c98;
}

.btn-buzzer-group.active {
  animation: pulse 1s infinite;
  box-shadow: 0 0 20px currentColor;
}

.btn-buzzer-group:hover {
  transform: scale(1.05);
}

.btn-stop-all {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: #95a5a6;
  color: white;
}

.btn-stop-all:hover {
  background: #7f8c8d;
}

.timer-display-group {
  font-size: 24px;
  font-weight: bold;
  padding: 5px 10px;
  background: #f5f5f5;
  border-radius: 10px;
  min-width: 60px;
  text-align: center;
}

.eligible-section {
  background: white;
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s;
}

.eligible-section.blink {
  animation: blinkBackground 1s infinite;
}

@keyframes blinkBackground {
  0%,
  100% {
    background: #419493;
  }
  50% {
    background: #2e6b6a;
    box-shadow: 0 10px 40px rgba(65, 148, 147, 0.5);
  }
}

.eligible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.eligible-title {
  display: flex;
  align-items: center;
  gap: 20px;
}

.eligible-title h2 {
  color: #333;
  font-size: 28px;
}

.tour-badge {
  background: linear-gradient(135deg, #ff9800, #f44336);
  padding: 10px 25px;
  border-radius: 50px;
  color: white;
  font-size: 24px;
  font-weight: bold;
}

.current-speaker {
  background: linear-gradient(135deg, #ffd89b, #c7e9fb);
  border-radius: 20px;
  padding: 30px;
  margin: 20px 0;
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.speaker-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.speaker-logo img {
  max-width: 300px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.speaker-avatar {
  font-size: 200px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.speaker-content {
  flex: 1;
  text-align: center;
}

.current-speaker h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 20px;
}

.current-speaker-name {
  font-size: 64px;
  font-weight: bold;
  margin: 20px 0;
}

.current-speaker-detail {
  font-size: 24px;
  color: #666;
}

.speaker-groupe {
  display: inline-block;
  padding: 5px 20px;
  border-radius: 20px;
  color: white;
  font-weight: bold;
  margin-top: 10px;
}

.button-group {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 20px 0;
  flex-wrap: wrap;
}

.next-btn,
.reset-btn,
.total-btn {
  padding: 15px 30px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s;
}

.next-btn:hover,
.reset-btn:hover,
.total-btn:hover {
  transform: scale(1.05);
}

.next-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.reset-btn {
  background: #ff9800;
  color: white;
}

.total-btn {
  background: #4caf50;
  color: white;
}

.queue-section {
  margin-top: 30px;
  border-top: 2px solid #e0e0e0;
  padding-top: 20px;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.queue-title {
  font-size: 22px;
  font-weight: bold;
  color: #333;
}

.queue-stats {
  background: #f0f0f0;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 18px;
}

.queue-list {
  max-height: 400px;
  overflow-y: auto;
}

.queue-item {
  display: flex;
  align-items: center;
  padding: 15px;
  margin: 10px 0;
  background: #f5f5f5;
  border-radius: 15px;
}

.queue-item.current {
  background: linear-gradient(135deg, #ffe6b3, #ffd89b);
  border: 3px solid #ff9800;
  transform: scale(1.02);
}

.queue-position {
  font-size: 28px;
  font-weight: bold;
  width: 70px;
  text-align: center;
  color: #667eea;
}

.queue-avatar {
  font-size: 40px;
  margin-right: 10px;
  width: 60px;
  text-align: center;
}

.queue-info {
  flex: 1;
  padding: 0 15px;
}

.queue-numero {
  font-size: 18px;
  font-weight: bold;
  color: #667eea;
}

.queue-prenom {
  font-size: 16px;
  color: #333;
}

.queue-groupe {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  color: white;
  font-size: 12px;
  font-weight: bold;
  margin-left: 10px;
}

.queue-points {
  font-size: 14px;
  color: #ff9800;
  font-weight: bold;
}

.queue-actions {
  display: flex;
  gap: 8px;
  margin-right: 15px;
}

.point-btn {
  padding: 8px 15px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.point-btn-active {
  background: #4caf50;
  color: white;
}

.point-btn-inactive {
  background: #cccccc;
  color: #666;
  cursor: not-allowed;
  opacity: 0.5;
}

.queue-status {
  width: 60px;
  text-align: center;
}

.status-icon {
  font-size: 28px;
}

.empty-queue {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 18px;
}

.registration-area,
.participants-section {
  background: white;
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

h2 {
  color: #333;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.participants-grid.hidden {
  display: none;
}

.participant-card {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  border: 2px solid #e0e0e0;
  position: relative;
  transition: all 0.3s;
}

.participant-card.connected {
  border-color: #4caf50;
  background: #e8f5e9;
}

.participant-card.speaking {
  border-color: #ff9800;
  background: #fff3e0;
  animation: pulse 1s infinite;
}

.participant-groupe {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 3px 8px;
  border-radius: 10px;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.participant-avatar {
  font-size: 50px;
  margin-bottom: 10px;
  margin-top: 15px;
}

.participant-numero {
  font-size: 20px;
  font-weight: bold;
  color: #667eea;
}

.participant-prenom {
  font-size: 18px;
  font-weight: bold;
  margin-top: 5px;
}

.participant-points {
  font-size: 24px;
  font-weight: bold;
  color: #ff9800;
  margin-top: 10px;
  padding: 8px;
  background: #fff3e0;
  border-radius: 10px;
  display: block;
}

.delete-participant {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  cursor: pointer;
  font-weight: bold;
  z-index: 10;
}

.delete-participant:hover {
  background: #cc0000;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  border-radius: 30px;
  padding: 30px;
  max-width: 900px;
  width: 90%;
  max-height: 85%;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin-bottom: 0;
}

.btn-pdf {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
}

.btn-pdf:hover {
  background: #c0392b;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.ranking-table th,
.ranking-table td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
}

.ranking-table th {
  background: #667eea;
  color: white;
}

.ranking-avatar {
  font-size: 30px;
}

.ranking-groupe {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  color: white;
  font-weight: bold;
}

.medal {
  font-size: 24px;
}

.close-modal {
  padding: 10px 30px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 20px;
  width: 100%;
}

.close-modal:hover {
  background: #5a6fd8;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  z-index: 1000;
  animation: slideIn 0.3s;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .current-speaker {
    flex-direction: column;
  }

  .speaker-logo img {
    max-width: 150px;
  }

  .speaker-avatar {
    font-size: 100px;
  }

  .current-speaker-name {
    font-size: 40px;
  }

  .buzzer-controls {
    flex-direction: column;
    align-items: center;
  }

  .buzzer-group {
    width: 100%;
    max-width: 300px;
  }

  .btn-buzzer-group {
    width: 100%;
  }

  .eligible-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .buzzer-mode-selector {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
}
