/* =========================================
   DRAG & DROP EXERCISE V2 - MODERN DESIGN
   ========================================= */

/* Header de l'exercice */
.exercise-drag-drop .exercise-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background-color: #4f46e5;
  background: linear-gradient(
    135deg,
    var(--primary-accent, #4f46e5),
    var(--primary-color, #4338ca)
  );
  border-radius: 16px;
  margin-bottom: 1.5rem;
}

/* Corps de l'exercice */

/* Box d'instructions */

/* Box "Comment Ã§a marche" */

/* Layout principal */
.drag-exercise-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .drag-exercise-layout {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

/* Labels de section */
.section-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-label i {
  width: 18px;
  height: 18px;
  color: var(--primary-accent);
}

/* Banque d'Ã©lÃ©ments */
.elements-bank {
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
}

.elements-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.element-card {
  background: var(--bg-body);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.element-card:hover {
  border-color: var(--primary-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.element-card.selected {
  border-color: var(--primary-accent);
  background: rgba(79, 70, 229, 0.05);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.element-card.used {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.element-card.correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.element-card.incorrect {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
  animation: shake 0.4s;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

.element-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.element-icon i {
  width: 24px;
  height: 24px;
  color: var(--primary-accent);
}

.element-info {
  flex: 1;
}

.element-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.element-type {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.element-connector {
  width: 12px;
  height: 12px;
  background: var(--border-color);
  border-radius: 50%;
  transition: all 0.2s;
}

.element-card.selected .element-connector {
  background: var(--primary-accent);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.element-card.correct .element-connector {
  background: #10b981;
}

/* Zone de construction */
.construction-zone {
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
}

.construction-slots {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.construction-slot {
  background: var(--bg-body);
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 80px;
  transition: all 0.2s ease;
}

.construction-slot.active {
  border-color: var(--primary-accent);
  background: rgba(79, 70, 229, 0.03);
}

.construction-slot.filled {
  border-style: solid;
  border-color: var(--primary-accent);
  background: rgba(79, 70, 229, 0.05);
}

.construction-slot.correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.construction-slot.incorrect {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.slot-number {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  color: var(--primary-accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.construction-slot.filled .slot-number {
  background: var(--primary-accent);
  color: white;
}

.construction-slot.correct .slot-number {
  background: #10b981;
  color: white;
}

.construction-slot.incorrect .slot-number {
  background: #ef4444;
  color: white;
}

.slot-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.slot-placeholder i {
  width: 20px;
  height: 20px;
  opacity: 0.5;
}

.slot-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slot-content .element-icon {
  width: 44px;
  height: 44px;
}

.slot-content .element-icon i {
  width: 22px;
  height: 22px;
}

.slot-content .element-info {
  flex: 1;
}

/* Bouton de suppression dans un slot */
.slot-remove-btn {
  width: 32px;
  height: 32px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.slot-remove-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

.slot-remove-btn i {
  width: 16px;
  height: 16px;
  color: #ef4444;
}

/* Actions et feedback */
.exercise-actions {
  margin-top: 2rem;
}

.exercise-feedback {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 10px;
  display: none;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.exercise-feedback.show {
  display: flex;
}

.exercise-feedback.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid #10b981;
  color: #10b981;
}

.exercise-feedback.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  color: #ef4444;
}

.btn-check-exercise {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--border-color);
  color: var(--text-muted);
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: not-allowed;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-check-exercise i {
  width: 20px;
  height: 20px;
}

.btn-check-exercise:not([disabled]) {
  background: var(--primary-accent);
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-check-exercise:not([disabled]):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}
@media (max-width: 767px) {
  .exercise-drag-drop .exercise-header {
    flex-direction: row;
    padding: 1.25rem;
  }

  .elements-bank,
  .construction-zone {
    padding: 1.25rem;
  }

  .element-card {
    padding: 0.875rem;
  }

  .element-icon {
    width: 42px;
    height: 42px;
  }

  .element-icon i {
    width: 20px;
    height: 20px;
  }

  .construction-slot {
    padding: 0.875rem;
    min-height: 72px;
  }
}

/* Bouton de dï¿½connexion explicite */
.disconnect-mini-btn {
  background: #fee2e2;
  color: #ef4444;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
  pointer-events: auto;
  position: relative;
  z-index: 10;
}

.disconnect-mini-btn:hover {
  background: #ef4444;
  color: white;
  transform: scale(1.1);
}

.disconnect-mini-btn i {
  width: 14px;
  height: 14px;
}
/* =========================================
   CODE CHALLENGE STYLES
   ========================================= */

.code-challenge-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.code-display-block {
  background: #1e1e1e;
  border-radius: 16px;
  padding: 2rem;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  color: #d4d4d4;
  overflow-x: auto;
  border: none;
  position: relative;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
}

.code-display-block::before {
  content: "LUA";
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-bottom-left-radius: 12px;
}

.code-line {
  display: block;
  line-height: 1.7;
  white-space: pre;
  font-size: 1rem;
}

/* Syntax Highlighting simple (simulÃ©) */
.syntax-keyword {
  color: #569cd6;
  font-weight: bold;
} /* local, function, if */
.syntax-string {
  color: #ce9178;
} /* "text" */
.syntax-number {
  color: #b5cea8;
} /* 123 */
.syntax-comment {
  color: #6a9955;
  font-style: italic;
} /* -- comment */
.syntax-function {
  color: #dcdcaa;
} /* print, math.random */

/* Options de rÃ©ponse (Code) */
.code-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.code-option-btn {
  background: var(--bg-content);
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.code-option-btn:hover {
  border-color: var(--primary-accent);
  background: var(--bg-body);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.code-option-btn.selected {
  border-color: var(--primary-accent);
  background: rgba(79, 70, 229, 0.05);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.code-option-btn.correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.1) !important;
}

.code-option-btn.incorrect {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.1) !important;
  opacity: 0.7;
}

.option-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.code-option-btn.selected .option-marker {
  border-color: var(--primary-accent);
  background: var(--primary-accent);
  color: white;
}

.code-option-btn.correct .option-marker {
  border-color: #10b981;
  background: #10b981;
  color: white;
}

.code-option-btn.incorrect .option-marker {
  border-color: #ef4444;
  background: #ef4444;
  color: white;
}

/* =========================================
   NEW EXERCISE TYPES - V3
   ========================================= */

/* --- Base Exercise Card --- */

/* --- CODE ORDERING (Réordonner le code) --- */

/* --- FILL IN THE BLANKS (Compléter le code) --- */

/* --- CODE MATCHING (Associer code et résultat) --- */

/* --- BUG FINDER (Trouver l'erreur) --- */

/* --- CODE CHOICE (QCM Code) --- */

/* --- Exercise Actions --- */

.btn-check-exercise {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--border-color);
  color: var(--text-muted);
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: not-allowed;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-check-exercise:not([disabled]) {
  background: var(--primary-accent);
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-check-exercise:not([disabled]):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}
/* =========================================
   EXERCICES V3 - NOUVEAUX STYLES COMPLETS
   ========================================= */

/* --- Card Container --- */

/* --- Header --- */

/* --- Instructions --- */

/* --- Code Ordering --- */

/* --- Fill in the Blanks --- */

/* --- Code Matching --- */

/* --- Bug Finder --- */

/* --- Actions Buttons --- */

/* --- Feedback --- */
.exercise-feedback {
  padding: 0 1.5rem 1.5rem;
}

.exercise-feedback:empty {
  display: none;
}

/* --- Responsive --- */
