:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --light-gray: #f4f4f4;
    --soft-bg: #ecf0f1;
}

body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: var(--light-gray);
    padding: 0;
    margin: 0;
}

table {
    height: 100%;
    table-layout: fixed;
    width: 100%;
    margin: 20px auto;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

table, th, td {
    border: 1px solid black;
}

th, td {
    padding: 10px;
    text-align: center;
}

th {
    background: #3498db;
    color: white;
}

tr {
    height: 100%; /* Ajuste la hauteur de la ligne du tableau selon tes besoins */
}

td {
    vertical-align: top;
    height: 100%; /* S'assure que la cellule prend la hauteur de la ligne */
}

#professorsTable th:nth-child(3),
#professorsTable td:nth-child(3) {
width: 60%;
min-width: 300px; /* Largeur minimale pour éviter un rétrécissement excessif */

}


.dropzone {
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-height: 60px; /* Hauteur minimale visible */
    background: #ecf0f1;
}


#available-tasks {
width: 100%;
margin: 20px auto;
background: white;
padding: 10px;
border: 1px solid black;
}

/* Style spécifique pour les boutons de classe (task) */
.task {
    display: inline-block;
    padding: 5px 5px;
    margin: 5px;
    background-color: var(--primary);
    color: white;
    border-radius: 5px;
    cursor: grab;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s, opacity 0.2s;
    user-select: none;
    border: none;
}
#task-table th:nth-child(3), #task-table td:nth-child(3) {
width: 55%;
}


.task:hover {
    opacity: 0.9;
    background-color: var(--primary-dark);
}

.task:active {
    cursor: grabbing;
    opacity: 0.7;
    transform: scale(1.05);
}

.task-container {
    min-height: 40px;
    background: var(--soft-bg);
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button {
    padding: 10px 15px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background-color: var(--primary-dark);
}

button:focus, .task:focus {
    outline: 2px solid var(--primary-dark);
    outline-offset: 2px;
}

.alert {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px;
    font-weight: bold;
    margin: 10px auto;
    border-radius: 5px;
}

h1 {
    margin: 20px 0;
    font-size: 2em;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    padding: 20px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

#task-table {
width: 100%;
border-collapse: collapse;
}



.delete-button {
    color: red;
    cursor: pointer;
    margin-left: 5px;
}

.editable {
    font-weight: 500;
    cursor: pointer;
    margin: 3px 0;
}

#task-list {
display: flex;
flex-wrap: wrap;
gap: 10px;
justify-content: flex-start;
}

#task-list .task {
width: 150px;  /* Ajuste cette largeur selon tes besoins */
margin: 5px;
}

#available-classes {
display: flex;
flex-wrap: wrap;
gap: 10px;
justify-content: flex-start;
border: 2px solid #ccc;
padding: 10px;
margin-top: 20px;
}

.inline-input {
    font-size: 1em;
    padding: 3px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.class-title {
    font-weight: 600;
    color: #111827; /* gris foncé */
}
.class-card {
    display: flex;
    align-items: center;
    min-width: 140px;
    padding: 6px 20px 6px 10px; /* Plus de padding à droite pour les icônes */
    margin: 4px;
    background-color: #3498db;
    color: white;
    border-radius: 6px;
    position: relative;
    overflow: visible;
}

/* Effet de survol plus sophistiqué */
.class-card:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Effet lors du clic */
.class-card:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* Version pour les cartes assignées */
.class-card.assigned {
    background-color: #2980b9;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Animation discrète au survol des cartes assignées */
/* Style pour les cartes attribuées */
.class-card.assigned {
    background-color: #2980b9;
}


/* Style pour le contenu interne */
.class-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
}

/* Nom de la classe */
.class-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Heures de la classe */
.class-hours {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 400;
}

/* Styles de base par catégorie */
.class-card.cap { background-color: #3498db; }
.class-card.seconde { background-color: #2ecc71; }
.class-card.premiere { background-color: #e67e22; }
.class-card.terminale { background-color: #e74c3c; }
.class-card.autre { background-color: #9b59b6; }

/* Version "attribuée" - plus claire avec bordure */
.class-card.assigned {
    opacity: 0.9;
    border-left: 4px solid white;
    box-shadow: inset 3px 0 0 rgba(255,255,255,0.3);
}

/* Couleurs spécifiques quand attribuées */
.class-card.cap.assigned { background-color: #2980b9; }
.class-card.seconde.assigned { background-color: #27ae60; }
.class-card.premiere.assigned { background-color: #d35400; }
.class-card.terminale.assigned { background-color: #c0392b; }
.class-card.autre.assigned { background-color: #8e44ad; }

/* Hover states */
.class-card:hover {
    filter: brightness(110%);
    transform: translateY(-2px);
}

/* Style des en-têtes */
.class-category-header {
    margin: 20px 0 8px 0;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    color: white;
}

.cap-header { background-color: #2980b9; }
.seconde-header { background-color: #27ae60; }
.premiere-header { background-color: #d35400; }
.terminale-header { background-color: #c0392b; }
.autre-header { background-color: #8e44ad; }

/* Icône de suppression */
.delete {
    font-size: 16px;
    font-weight: bold;
    color: #ffebee;
    margin-left: 8px;
    transition: color 0.2s;
}

.delete:hover {
    color: #ff6b6b;
}

/* Style général pour les cartes de classes et professeurs */
.class-card, .professor-card {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 110px;
    height: 35px;
    margin: 4px;
    padding: 4px;
    background-color: #3498db;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Classes et professeurs assignés */
.class-card.assigned, .professor-card.assigned {
    background-color: #2980b9;
}

/* Ajout de l'hover effect */
.class-card:hover, .professor-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Contenu des cartes */
.class-info, .professor-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    font-size: 14px;
    width: 100%;
    font-family: Arial, sans-serif;
    color: white;
}

/* Nom de la classe ou du professeur */
.class-name, .professor-name {
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Heures de la classe */
.class-hours {
    font-size: 15px;
    color: #dbe7f2;
}

/* Suppression de la classe */
.delete {
    font-size: 14px;
    color: #e74c3c;
    cursor: pointer;
    margin-left: 5px;
}

/* Drag and drop */
.class-card.dragging, .professor-card.dragging {
    opacity: 0.5;
}

/* Classes disponibles, présentées côte à côte */
#availableClassesList h4 {
margin: 15px 0 5px 0;
padding-bottom: 3px;
border-bottom: 1px solid #3498db;
color: #2c3e50;
font-size: 1.1em;
}

/* Encadré pour la section "Classes disponibles" */
#availableClassesSection {
margin-top: 20px;
padding: 10px;
border: 2px solid #3498db;
border-radius: 5px;
background-color: #f1f1f1;
}



.professor-classes {
    display: inline-block;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 8px;
    width: 100%;
    min-height: 60px;
    box-sizing: border-box; /* Inclut padding dans le calcul de largeur */
    overflow: visible; /* Permet le scroll si nécessaire */
    max-width: 100%; /* Bloque l'expansion au-delà de la cellule */
    line-height: normal; /* Réinitialise le line-height */

}

/* Style pour les noms de professeurs éditables */
.professor-name {
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
    display: inline-block;
}

.professor-name:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.edit-input {
    padding: 5px;
    border: 1px solid #3498db;
    border-radius: 3px;
    width: 90%;
    font-size: inherit;
    font-family: inherit;
}

/* Style pour les professeurs en surcharge */
#professorsTable tr.overload-warning {
background-color: #ffebee; /* Rouge très clair */
}

#professorsTable tr.overload-warning td {
border-color: #ef9a9a; /* Bordure rouge clair */
}


/* Animation subtile pour attirer l'attention */
@keyframes pulseWarning {
    0% { background-color: #ffebee; }
    100% { background-color: #ffcdd2; }
}

/* Conservez aussi votre ancien style pour les heures */
.over-limit {
    color: #c62828;
    font-weight: bold;
}

/* Centrage vertical pour toutes les cellules */
#professorsTable td {
vertical-align: middle;
}

/* Centrage général pour toutes les cellules */
#professorsTable td {
vertical-align: middle;  /* Centre verticalement */
text-align: center;     /* Centre horizontalement */
padding: 10px;
display: table-cell;    /* Rétablit le comportement natif des cellules */
}

/* Correction spécifique pour la colonne des classes */
#professorsTable td.professor-classes {
text-align: left; /* Alignement à gauche du contenu */
vertical-align: middle;
}

/* Boutons d'ajout */
.add-section {
    margin-top: 20px;
    text-align: center;
}

/* Formulaire pour ajouter un professeur ou une classe */
.add-section button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.add-section button:hover {
    background-color: #2980b9;
}

/* Animation pour le drag and drop */
.class-card.drop-over, .professor-card.drop-over {
    border: 2px dashed #00796b;
    background-color: #e0f2f1;
}


/* Conteneur des actions */
.class-actions {
    display: flex;
    gap: 8px;
    margin-left: 12px;
    flex-shrink: 0; /* Empêche le rétrécissement */
}


/* Style des icônes */
/* Icônes plus visibles */
.duplicate, .delete {
    cursor: pointer;
    font-size: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0; /* Garde la taille fixe */
}

.duplicate {
    background-color: rgba(255,255,255,0.2);
    color: white;
}

.delete {
    background-color: rgba(255,255,255,0.2);
    color: #ff6b6b;
}

.duplicate:hover {
    background-color: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.delete:hover {
    background-color: #c0392b;
    transform: scale(1.1);
}

/* Adaptation de la carte pour inclure les actions */
..class-card {
    display: flex;
    align-items: center;
    min-width: 140px; /* Largeur réduite */
    padding: 6px 10px;
    margin: 4px;
    background-color: #3498db;
    color: white;
    border-radius: 6px;
    position: relative; /* Pour le positionnement absolu des icônes */
    overflow: visible; /* Pour que les icônes ne soient pas coupées */
}

/* Icônes positionnées absolument */
.card-icon {
    position: absolute;
    cursor: pointer;
    font-size: 12px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.2s;
}

.card-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Positionnement spécifique */
.duplicate-icon {
    top: 2px;
    right: 2px;
    color: #ffffff;
}

.delete-icon {
    bottom: 2px;
    right: 2px;
    color: #ff9e9e;
}
/* Version pour les cartes attribuées */
.delete-icon.assigned {
    color: #ffcccc;
    font-size: 14px;
}

/* Contenu principal */
.class-info {
    display: flex;
    flex: 1;
    gap: 6px;
    font-size: 14px;
}

/* Style pour le drag and drop */
.class-card.dragging {
    opacity: 0.5;
}

/* Animation au survol de l'élément à déplacer */
.class-card.drop-over {
    border: 2px dashed #00796b;
    background-color: #e0f2f1;
}


/* Style pour la section Controls */
/* Conteneur principal */
.controls {
    margin: 20px 0;
}

/* Bouton Réinitialisation */
button.reset {
    background-color: #e74c3c; /* Rouge vif */
    margin-left: 10px;
}

button.reset:hover {
    background-color: #c0392b;
}

/* Style pour chaque sous-section d'ajout */
.add-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #3498db;
}

/* Supprime la bordure du dernier élément */
.add-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Style pour les inputs dans la section controls */
.controls input {
    padding: 8px;
    margin-right: 10px;
    border: 1px solid #3498db;
    border-radius: 4px;
}

.controls button {
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

/* Conteneur principal */
.add-sections-container {
    display: flex;
    gap: 20px; /* Espace entre les deux sections */
    flex-wrap: wrap; /* Passage à la ligne sur petits écrans */
    justify-content: space-between;
    margin-top: 20px;
}

/* Style pour chaque section */
.add-section {
    flex: 1;
    min-width: 250px; /* Largeur minimale */
    padding: 15px;
    border: 1px solid #3498db;
    border-radius: 8px;
    background-color: #f8fafc;
}

.add-sections-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Sections sans bordure */
.add-section {
    flex: 1;
    min-width: 300px;
    padding: 0; /* Suppression du padding si inutile */
    background-color: transparent; /* Fond transparent */
    border: none; /* Suppression de la bordure */
}


.add-section button {
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.add-section button:hover {
    background-color: #2980b9;
}

/* Responsive */
@media (max-width: 700px) {
    .add-sections-container {
        flex-direction: column;
    }
    .professor-section,
    .class-section {
        width: 100%;
    }
}


/* Conteneur principal */
.controls {
    margin: 20px 0;
}

.controls {
    margin: 20px 0;
}

.add-sections-container {
    display: flex;
    gap: 20px;
    align-items: flex-start; /* Alignement en haut */
}

/* Section Professeur (réduite) */
.professor-section {
    width: 250px; /* Largeur fixe réduite */
    flex: 0 0 auto; /* Empêche l'expansion */
}

/* Section Classe (prend le reste) */
.class-section {
    flex: 0.7; /* 70% de l'espace */
    min-width: 300px;
}

/* Styles communs */
.add-section {
    padding: 0;
    border: none;
    background: transparent;
}

.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}


/* Groupes d'inputs */
.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.input-group input {
    padding: 8px 12px;
    border-radius: 4px;
    flex: 1;
    min-width: 120px;
}

.input-group button {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.input-group button:hover {
    background-color: #2980b9;
}

/* Responsive */
@media (max-width: 700px) {
    .add-section {
        min-width: 100%;
    }
}

.controls button:hover {
    background-color: #2980b9;
}

.overload {
    background-color: #fdd !important;
    font-weight: bold;
}

/* Espacement et bordures */
.actions {
    margin: 30px 0; /* Plus d'espace en haut et en bas */
    padding: 15px;
    border-radius: 8px;
    background-color: #f8fafc;
    display: inline-block;
}

/* Section Tutoriel */
.tutorial-section {
    margin: 30px 0;
    padding: 20px;
    border: 1px solid #3498db;
    border-radius: 8px;
    background-color: #f8fafc;
    text-align: left;
}

.tutorial-section h2 {
    color: #2c3e50;
    margin-top: 0;
    border-bottom: 1px solid #3498db;
    padding-bottom: 10px;
}

/* Pied de page */
footer {
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid #ddd;
    font-size: 0.9em;
    color: #7f8c8d;
    text-align: left;
    line-height: 1.6;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    table, .task-container, .container {
        width: 100%;
        overflow-x: auto;
    }

    .task {
        display: block;
        width: 100%;
    }

    #task-table th:nth-child(3) {
    width: auto;
    }
}
