/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #1e1e1e;
  color: #d4d4d4;
  height: 100vh;
  overflow: hidden;
}

/* Conteneur principal */
.ide-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Barre d'outils */
.toolbar {
  background-color: #2d2d30;
  border-bottom: 1px solid #3e3e42;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}

.toolbar-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Boutons */
.btn {
  background-color: #0e639c;
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s;
}

.btn:hover:not(:disabled) {
  background-color: #1177bb;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: #16825d;
}

.btn-primary:hover:not(:disabled) {
  background-color: #1e9e6f;
}

.btn-danger {
  background-color: #f14c4c;
}

.btn-danger:hover:not(:disabled) {
  background-color: #f36666;
}

.btn-secondary {
  background-color: #3c3c3c;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #4c4c4c;
}

.btn-icon {
  background: none;
  border: none;
  color: #cccccc;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Indicateur de statut */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #cccccc;
}

.status-indicator i {
  font-size: 10px;
}

.status-indicator.ready i {
  color: #16825d;
}

.status-indicator.running i {
  color: #007acc;
  animation: pulse 1.5s infinite;
}

.status-indicator.error i {
  color: #f14c4c;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* Contenu principal */
.main-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

/* Panneaux Ã©diteur et terminal */
.editor-panel,
.terminal-panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 300px;
}

/* SÃ©paration entre Ã©diteur et terminal */
.editor-panel {
  border-bottom: none;
}

/* SÃ©parateur redimensionnable horizontal */
.panel-resizer {
  height: 6px;
  background-color: #3e3e42;
  cursor: ns-resize;
  flex-shrink: 0;
  transition: background-color 0.2s;
}

.panel-resizer:hover,
.panel-resizer.dragging {
  background-color: #007acc;
}

/* Bouton toggle pour le panneau fichiers */
.file-panel-toggle {
  position: absolute;
  left: 250px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  background-color: #252526;
  border: 1px solid #3e3e42;
  border-left: none;
  color: #8b8b8b;
  padding: 12px 4px;
  cursor: pointer;
  border-radius: 0 4px 4px 0;
  transition: all 0.2s;
}

.file-panel-toggle:hover {
  color: #fff;
  background-color: #37373d;
}

.file-panel-toggle.collapsed {
  left: 0;
}

.file-panel-toggle.collapsed i {
  transform: rotate(180deg);
}

/* Ã‰tat du panneau fichiers masquÃ© */
.file-panel {
  transition: margin-left 0.2s, width 0.2s;
}

.file-panel.collapsed {
  margin-left: -250px;
}


/* En-tÃªte des panneaux */
.panel-header {
  background-color: #252526;
  padding: 10px 16px;
  border-bottom: 1px solid #3e3e42;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  flex: 0 0 auto;
}

.panel-header i {
  margin-right: 8px;
  color: #cccccc;
}

.shortcuts-hint {
  font-size: 12px;
  color: #8b8b8b;
  font-weight: normal;
}

/* Ã‰diteur CodeMirror */
#editorContainer {
  flex: 1;
  overflow: hidden;
}

.CodeMirror {
  height: 100%;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
}

.CodeMirror-gutters {
  border-right: 1px solid #3e3e42;
  background-color: #30322a !important;
  white-space: nowrap;
}

.CodeMirror-linenumber {
  color: #858585 !important;
  padding-left: 8px !important;
}

/* Terminal PyScript/XTerm.js */
/* 1) Container unique flex, sans scroll */
py-terminal#terminal {
  display: block;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  background-color: #1e1e1e;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.4;
  height: 100%;
  white-space: pre-wrap;
}

/* Force XTerm.js containers to fill available height */
py-terminal#terminal .xterm {
  height: 100% !important;
}

py-terminal#terminal .xterm-viewport {
  height: 100% !important;
}

py-terminal#terminal .xterm-screen {
  height: 100% !important;
}

/* 2) RÃ©active les events souris sur les contenus (pour le hover/clic des erreurs) */
/* py-terminal#terminal .xterm-screen, */
/* py-terminal#terminal .xterm-rows, */
/* py-terminal#terminal .xterm-helpers { */
/* pointer-events: auto !important; */
/* } */

/* 3) Seul le scroll-area reste non-interactif (pour ne pas â€œvolerâ€ la molette) */
/* py-terminal#terminal .xterm-scroll-area { */
/* pointer-events: none !important; */
/* } */

/* 3) Seul le viewport gÃ¨re le scroll interne */
/* py-terminal#terminal .xterm-viewport { */
/* 1. Remplit tout lâ€™espace disponible */
/* flex: 1 1 auto; */
/* min-height: 0; */
/* height: 100% !important; */
/* max-height: 100% !important; */

/* 2. Active le scroll interne */
/* overflow-y: auto !important; */
/* autorise le comportement natif de la molette */
/* overscroll-behavior: auto; */
/* } */

/* Mode plein Ã©cran */
.terminal-panel.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background-color: #1e1e1e;
}

/* Scrollbar personnalisÃ©e */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
  background: #464647;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5a5a5a;
}

/* Liens d'erreur cliquables */
.error-link {
  color: #3794ff;
  text-decoration: underline;
  cursor: pointer;
}

.error-link:hover {
  color: #5cadff;
}

/* Ligne d'erreur surlignÃ©e dans l'Ã©diteur (style plus doux/pedagogique) */
.CodeMirror .error-line-highlight {
  background-color: rgba(255, 165, 0, 0.1) !important;
  border-bottom: 1px dotted rgba(255, 165, 0, 0.4);
}

.error-gutter {
  width: 14px;
}

.error-marker {
  color: #f39c12;
  /* Orange pour Ãªtre moins agressif */
  font-size: 11px;
  cursor: help;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

#editorContainer {
  position: relative;
}

/* Linter Floating Alert (Global) */
.linter-floating-alert {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background-color: rgba(60, 48, 20, 0.95);
  border: 1px solid #f39c12;
  color: #f39c12;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  max-width: 90%;
  cursor: default;
}

.linter-floating-alert.minimized {
  left: calc(100% - 20px);
  transform: translateX(-100%);
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
}

.linter-floating-alert.minimized span,
.linter-floating-alert.minimized .linter-minimize-btn {
  display: none;
}

.linter-minimize-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: 10px;
  opacity: 0.5;
  border-radius: 4px;
  font-size: 12px;
}

.linter-minimize-btn:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
}

@keyframes slideDown {
  from {
    top: -40px;
    opacity: 0;
  }

  to {
    top: 10px;
    opacity: 1;
  }
}

/* Mots sÃ©lectionnÃ©s surlignÃ©s (addon) */
.CodeMirror .CodeMirror-selection-highlight-scrollbar {
  background-color: rgba(255, 255, 0, 0.4);
}

.cm-matchhighlight {
  background-color: rgba(255, 150, 50, 0.3);
}

/* Styles pour le gestionnaire de fichiers */
.ide-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.file-panel {
  width: 250px;
  background-color: #252526;
  border-right: 1px solid #3e3e42;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.file-panel-header {
  background-color: #2d2d30;
  padding: 10px;
  border-bottom: 1px solid #3e3e42;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  /* Ajouter cette ligne */
}

.file-panel-header h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.file-item {
  padding: 5px 10px;
  margin: 2px 0;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  transition: background-color 0.2s;
}

.file-item:hover {
  background-color: #2a2d2e;
}

.file-item i {
  font-size: 12px;
  color: #cccccc;
}

/* Indicateur de fichier non sauvegardÃ© */
.file-item .unsaved-indicator {
  font-size: 8px;
  color: #f39c12;
  margin-left: auto;
  margin-right: 4px;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Indicateur de fichier en cours d'upload */
.file-item .uploading-indicator {
  font-size: 12px;
  color: #007acc;
  margin-left: auto;
  margin-right: 4px;
}

/* Temporary save confirmation badge */
.file-save-badge {
  font-size: 11px;
  color: #4caf50;
  background-color: rgba(76, 175, 80, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
  margin-right: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: badge-appear 0.3s ease-out;
  white-space: nowrap;
}

.file-save-badge i {
  font-size: 10px;
}

.file-save-badge.fade-out {
  animation: badge-fade-out 0.5s ease-out forwards;
}

@keyframes badge-appear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes badge-fade-out {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(0.8);
  }
}

/* "No changes" message near save indicator */
.no-changes-message {
  font-size: 12px;
  color: #16825d;
  margin-left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: badge-appear 0.3s ease-out;
  white-space: nowrap;
}

.no-changes-message i {
  font-size: 11px;
}

.no-changes-message.fade-out {
  animation: badge-fade-out 0.5s ease-out forwards;
}

.file-item .remove-btn {
  margin-left: auto;
  color: #8b8b8b;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: all 0.2s;
}

.file-item .remove-btn:hover {
  color: #f14c4c;
  background-color: rgba(241, 76, 76, 0.2);
}

.file-drop-zone {
  border: 2px dashed #3e3e42;
  border-radius: 4px;
  padding: 20px;
  text-align: center;
  margin: 10px;
  background-color: #1e1e1e;
  transition: all 0.3s;
}

.file-drop-zone.drag-over {
  border-color: #007acc;
  background-color: rgba(0, 122, 204, 0.1);
}

.file-drop-zone p {
  margin: 0;
  font-size: 13px;
  color: #8b8b8b;
}

.file-drop-zone i {
  font-size: 24px;
  color: #8b8b8b;
  margin-bottom: 8px;
}

.file-input {
  display: none;
}

.ide-content {
  flex: 1;
  display: flex;
  flex-direction: row;
  /* Horizontal pour permettre le panneau debug Ã  droite */
  min-width: 0;
}

.file-item {
  position: relative;
}

.file-item.open::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: #007acc;
}

/* Preview des fichiers binaires */
.editor-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#editorContainer {
  height: 100%;
}

.file-preview {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: #1e1e1e;
  color: #d4d4d4;
  overflow: auto;
}

.file-preview img {
  max-width: 90%;
  max-height: 70%;
  object-fit: contain;
  border: 1px solid #3e3e42;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.file-preview-info {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: #cccccc;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.file-preview-title {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 2px;
  word-break: break-all;
}

.file-preview-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #252526;
  border: 1px solid #3e3e42;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 12px;
  color: #cccccc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.preview-badge:hover {
  background-color: #2d2d30;
  border-color: #505054;
}

.preview-badge i {
  color: #007acc;
  font-size: 12px;
}

.binary-file-info {
  background-color: #252526;
  border: 1px solid #3e3e42;
  border-radius: 8px;
  padding: 24px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  max-width: 90%;
}

.binary-file-info i.fas,
.binary-file-info i.fab {
  font-size: 48px;
  color: #007acc;
  margin-bottom: 8px;
}

.back-link {
  font-weight: 600;
  border-bottom: 1px solid #444;
  margin: 4px 0 6px;
  cursor: pointer;
}

.download-btn {
  color: #8b8b8b;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: all 0.2s;
}

.download-btn:hover {
  color: #4CAF50;
  background-color: rgba(76, 175, 80, 0.2);
}

/* Indicateur de sauvegarde */
.save-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #f39c12;
  margin-right: 16px;
}

.save-indicator i {
  font-size: 8px;
}

/* Bouton de dÃ©connexion */
.logout-btn {
  color: #8b8b8b;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 14px;
}

.logout-btn:hover {
  color: #cccccc;
  background-color: rgba(255, 255, 255, 0.1);
}

/* SÃ©parateurs dans la toolbar */
.toolbar-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Onglets de sortie */
.output-tabs {
  margin-left: 20px;
  display: flex;
  gap: 4px;
}

.output-tab {
  background: none;
  border: none;
  color: #8b8b8b;
  padding: 4px 12px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  font-size: 13px;
  transition: all 0.2s;
}

.output-tab:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.output-tab.active {
  background-color: #1e1e1e;
  color: #d4d4d4;
}

/* Panneaux de sortie */
.output-panels {
  flex: 1;
  position: relative;
  min-height: 0;
}

.output-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
}

.output-panel.active {
  display: flex !important;
  /* Force flex quand actif */
  flex-direction: column;
}

#graphicsPanel {
  background-color: #f8f9fa;
  padding: 10px;
}

#graphicsPanel.active {
  display: flex;
}

#skulptCanvas {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  background-color: white;
  border: 1px solid #ddd;
  overflow: hidden;
}

#skulptCanvas canvas,
#skulptCanvas svg {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  /* CRITIQUE : empÃªche Skulpt de dÃ©caler les calques */
  padding: 0 !important;
  border: none !important;
  background-color: transparent !important;
}

/* Console panel pour scroll */

py-terminal#terminal span:not(.terminal-input),
py-terminal#terminal pre {
  display: block;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Curseur PyScript/XTerm.js - visible et clignotant */
/* Cible tous les curseurs XTerm, y compris ceux dans py-terminal */
.xterm-cursor,
py-terminal#terminal .xterm-cursor,
py-terminal .xterm-cursor {
  background-color: #d4d4d4 !important;
  /* Couleur visible */
  color: #1e1e1e !important;
  /* Couleur du texte sur le curseur */
  width: 0.6em !important;
  /* Largeur appropriÃ©e */
}

/* Style du curseur en mode bloc */
.xterm-cursor-block,
py-terminal#terminal .xterm-cursor-block,
py-terminal .xterm-cursor-block {
  background-color: #d4d4d4 !important;
}

/* Style du curseur en mode barre */
.xterm-cursor-bar,
py-terminal#terminal .xterm-cursor-bar,
py-terminal .xterm-cursor-bar {
  background-color: #d4d4d4 !important;
  width: 2px !important;
}

/* Style du curseur en mode soulignement */
.xterm-cursor-underline,
py-terminal#terminal .xterm-cursor-underline,
py-terminal .xterm-cursor-underline {
  border-bottom: 2px solid #d4d4d4 !important;
  background-color: transparent !important;
}

/* Forcer le curseur Ã  Ãªtre visible mÃªme quand pas focus */
.xterm-cursor-outline,
py-terminal .xterm-cursor-outline {
  outline: 1px solid #d4d4d4 !important;
}

/* Animation de clignotement - appliquÃ©e directement sur .xterm-cursor */
@keyframes xterm-cursor-blink {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

/* Activer l'animation avec !important pour surcharger les styles par dÃ©faut */
.xterm-cursor,
py-terminal .xterm-cursor {
  animation: xterm-cursor-blink 1s step-end infinite !important;
}

/* Rendre le textarea helper de XTerm visible comme un curseur clignotant */
py-terminal#terminal .xterm-helper-textarea {
  color: transparent !important;
  background-color: #d4d4d4 !important;
  caret-color: transparent !important;
  border: none !important;
  outline: none !important;
  pointer-events: none !important;
  width: 8px !important;
  height: 1em !important;
  /* Pas d'animation par dÃ©faut - curseur statique */
}

/* Animation de clignotement uniquement quand le textarea a le focus */
py-terminal#terminal .xterm-helper-textarea:focus {
  animation: xterm-textarea-blink 1s step-end infinite !important;
}

@keyframes xterm-textarea-blink {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}




.loading-message {
  text-align: center;
  padding: 20px;
  color: #8b8b8b;
  font-size: 14px;
}

.loading-message i {
  margin-right: 8px;
}

.dropdown-toggle {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #2d2d30;
  border: 1px solid #3e3e42;
  border-radius: 4px;
  min-width: 180px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  color: #d4d4d4;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: #094771;
}

.dropdown-item i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

.rename-btn {
  color: #8b8b8b;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: all 0.2s;
  margin-left: auto;
  margin-right: 4px;
}

.rename-btn:hover {
  color: #3794ff;
  background-color: rgba(55, 148, 255, 0.2);
}

.file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#currentProjectName {
  font-weight: 600;
  color: #007acc;
  padding: 2px 4px;
  border-radius: 3px;
  cursor: text;
}

#currentProjectName:hover {
  background-color: rgba(0, 122, 204, 0.1);
}

#currentProjectName:focus {
  outline: 1px solid #007acc;
  background-color: rgba(0, 122, 204, 0.1);
}

.save-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  margin-right: 16px;
  cursor: help;
  transition: all 0.3s;
}

.save-indicator:hover {
  transform: scale(1.1);
}

@keyframes pulseSuccess {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

.save-indicator.pulse-success {
  animation: pulseSuccess 0.5s ease-in-out;
}

.students-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.student-card .student-name {
  display: flex;
  align-items: center;
}

.student-card .student-name span {
  /* Laisse le nom prendre la place nÃ©cessaire */
  flex-shrink: 0;
}

.student-card .student-name .btn-view-as {
  /* Pousse le lien tout Ã  droite */
  margin-left: auto;
  text-decoration: none;
  /* selon vos goÃ»ts */
  padding: 4px 8px;
  /* selon vos goÃ»ts */
  border-radius: 4px;
  /* selon vos goÃ»ts */
  background-color: #0e639c;
  /* selon votre charte */
  color: white;
  /* selon votre charte */
}

.student-card .student-name .btn-view-as:hover {
  background-color: #1177bb;
  /* selon votre charte */
}

/* 1) Wrapper flex autour du titre + bouton */
.submission-info .submission-title-wrapper {
  display: flex;
  align-items: center;
}

/* 2) Un petit Ã©cart entre le nom et le bouton */
.submission-title {
  margin-right: 0.5em;
  font-weight: 600;
}

/* 3) Style du bouton (vous lâ€™avez dÃ©jÃ  pour .btn-view-as, mais on peut dÃ©cliner) */
.btn-view-project {
  /* reprend vos rÃ¨gles .btn-primary ou .btn-view-as */
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #1e1e1e;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #3e3e42;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  color: #8b8b8b;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-info {
  background: #2a2d2e;
  padding: 12px;
  border-radius: 4px;
  color: #8b8b8b;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.version-item {
  background: #2a2d2e;
  padding: 12px 16px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.version-item:hover {
  background: #3e3e42;
}

.version-info {
  flex: 1;
}

.version-filename {
  color: #fff;
  font-weight: 500;
  margin-bottom: 4px;
}

.version-date {
  color: #8b8b8b;
  font-size: 12px;
}

.version-size {
  color: #8b8b8b;
  font-size: 12px;
}

.version-load-btn {
  background: #007acc;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.version-load-btn:hover {
  background: #005a9e;
}

.no-versions {
  text-align: center;
  color: #8b8b8b;
  padding: 40px;
}

.package-checkbox input:disabled+label {
  cursor: not-allowed;
}

.package-checkbox.incompatible {
  position: relative;
}

.package-checkbox.incompatible::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.storage-indicator {
  color: #8b8b8b;
  font-size: 12px;
  margin-left: 12px;
}

.unsaved-indicator {
  color: #f1c40f;
  font-size: 8px;
  margin-left: 8px;
}

.unsaved-indicator {
  color: #f1c40f;
  font-size: 8px;
  margin-left: 8px;
}

.file-item i.flowchart-icon {
  color: #2f9e44;
}

.file-item.open {
  background-color: #37373d;
}

.interpreter-status {
  font-size: 11px;
  color: #888;
  margin-left: 12px;
  font-style: italic;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.interpreter-status.visible {
  opacity: 1;
}

.terminal-panel.installing #terminal {
  visibility: hidden;
}

/* Styles pour l'input intÃ©grÃ© Skulpt */
.terminal-input {
  display: inline !important;
  outline: none !important;
  background: transparent !important;
  color: inherit !important;
  font-family: inherit !important;
  font-size: inherit !important;
  border: none !important;
  min-width: 2px;
  white-space: pre-wrap;
  caret-color: #d4d4d4;
  word-break: break-all;
}

/* Simuler un curseur de terminal quand l'Ã©lÃ©ment est focus */
.terminal-input:focus:empty::after {
  content: ' ';
  display: inline-block;
  width: 8px;
  height: 1.2em;
  background-color: #d4d4d4;
  vertical-align: middle;
  animation: xterm-cursor-blink 1s step-end infinite;
}

/* --- COLLABORATIVE LOCKS STYLES --- */
.lock-btn {
  font-size: 11px;
  width: 16px;
  text-align: center;
  transition: transform 0.2s, color 0.2s;
}

.lock-btn:hover {
  transform: scale(1.2);
}

.lock-btn.unlocked-by-me {
  color: #4caf50 !important;
  filter: drop-shadow(0 0 2px rgba(76, 175, 80, 0.4));
}

.lock-btn.locked-by-other {
  color: #f44336 !important;
  cursor: not-allowed !important;
}

.editor-readonly .CodeMirror-cursor {
  display: none !important;
}

.editor-readonly .CodeMirror-lines {
  background-color: rgba(0, 0, 0, 0.1);
}