/* --- Mise en page des deux colonnes principales --- */
main {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}


/* 8.3 Overlay génération (accueil) */
.overlay-generation {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 58, 138, 0.68);
  backdrop-filter: blur(4px);
  z-index: 2000;
  padding: 1rem;
}

.overlay-hidden {
  display: none;
}

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: min(320px, 100%);
  padding: 2rem 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  color: #ffffff;
  text-align: center;
}

.spinner-container p {
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.overlay-contenu {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(245, 245, 255, 0.95));
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  min-width: 260px;
  max-width: 90%;
  text-align: center;
}

.overlay-titre {
  font-weight: 700;
  color: var(--bleu-principal);
  font-size: 1.05rem;
  text-align: center;
  align-items: center;
  justify-content: center;
}

.overlay-soustexte {
  font-size: 0.92rem;
  color: var(--texte-secondaire);
  text-align: center;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-right-color: #ffffff;
  animation: spin 0.8s linear infinite;
  box-sizing: border-box;
}

body.dark-theme .spinner-container {
  background: linear-gradient(135deg, #172554, #4c1d95);
  border-color: rgba(255, 255, 255, 0.24);
}

/* ---------- Section import planning (Premium) ---------- */
.import-section {
  display: none;
  width: 100%;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.05), rgba(30, 58, 138, 0.05));
  border: 2px dashed rgba(109, 40, 217, 0.3);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  text-align: center;
}

.import-section h3 {
  font-size: 1.1rem;
  color: var(--bleu-principal);
  margin-bottom: 0.8rem;
}

.import-section p {
  font-size: 0.9rem;
  color: var(--texte-secondaire);
  margin-bottom: 1rem;
}

.import-box {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.import-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  background: var(--fond-clair);
  border: 1.5px solid rgba(109, 40, 217, 0.4);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--violet-accent);
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
  margin-right: 0.8rem;
  margin-bottom: 0;
}

.import-label:hover {
  background: rgba(109, 40, 217, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.2);
}

#file-name {
  font-size: 0.88rem;
  color: var(--texte-secondaire);
  margin-top: 0.6rem;
}

.import-section--visible {
  display: block;
}

/* ---------- Section presentation ---------- */

.presentation {
  width: 100%;
  text-align: center;
  padding: 3rem 2rem 2rem;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.06), rgba(109, 40, 217, 0.06));
  border-radius: 20px;
  margin-bottom: 1rem;
}

.presentation h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.presentation h2 {
  font-size: 1.8rem;
  color: #4C1D95;
  margin-bottom: 1rem;
}

.presentation p {
  font-size: 1.05rem;
  color: var(--texte-secondaire);
  max-width: 600px;
  margin: 0 auto 1.5rem;
  line-height: 1.65;
}

.presentation .highlight {
  color: var(--couleur-secondaire, #6D28D9);
  font-weight: 600;
}



#plage-horaire {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 1rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: var(--fond-cartes);
  border-radius: 14px;
  padding: 1.2rem 1.5rem;
}

#plage-horaire label {
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

#plage-horaire input[type="time"] {
  padding: 0.45rem 0.7rem;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.9rem;
  background: var(--fond-clair);
  color: var(--texte-principal);
  margin-left: 0.4rem;
}

.btn-generer-wrapper {
  margin-left: auto;
}

/* ---------- Colonnes créneaux + tâches ---------- */

.colonne {
  flex: 1;
  min-width: 300px;
}

#emploi-du-temps,
#taches {
  background: var(--fond-cartes);
  border-radius: 15px;
  padding: 1.5rem;
  min-height: 350px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: background var(--transition), box-shadow var(--transition);
}

#emploi-du-temps h2,
#taches h2 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: var(--bleu-principal);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

#liste-creneaux,
#liste-taches {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding: 0;
  list-style: none;
}

.item-creneau,
.item-tache {
  background: var(--fond-clair);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  transition: box-shadow var(--transition), transform 0.15s ease, opacity 0.15s ease;
  width: 100%;
}

.item-creneau:hover,
.item-tache:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
  cursor: grab;
}

.item-creneau.dragging,
.item-tache.dragging {
  opacity: 0.45;
  cursor: grabbing;
  transform: scale(0.98);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.item-creneau.drag-over,
.item-tache.drag-over {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  transform: translateY(-3px);
}

.item-info {
  flex: 1;
}

.item-info .item-nom {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--texte-principal);
}

.item-info .item-details {
  font-size: 0.82rem;
  color: var(--texte-secondaire);
  margin-top: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.item-info .item-details span {
  background: rgba(109, 40, 217, 0.08);
  color: var(--violet-accent);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.item-actions {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.5rem;
  width: 1.5rem;
  border: none;
  background: none;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
}

.item-actions button:hover {
  transform: scale(1.2);
}

.item-actions button img.emoji-img {
  height: 100%;
  width: auto;
  max-width: 100%;
}

/* Validation visuelle pour inputs et groupes (bord rouge + animation shake) */
input.input-error,
select.input-error,
textarea.input-error {
  border-color: #e53e3e !important;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.08) !important;
  animation: shake 0.35s ease !important;
}

.checkbox-group.input-error {
  border: none !important;
  padding: 0 !important;
}

.checkbox-group.input-error label {
  border: 1.5px solid #e53e3e !important;
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  margin: 0.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  animation: shake 0.35s ease !important;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}


/* Rappel par e-mail (formulaire de tâche, Premium) */
.rappel-section {
  display: none;
}

.rappel-section--visible {
  display: block;
}

.rappel-section .rappel-case {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.rappel-section input[type="checkbox"],
.rappel-section input[type="radio"] {
  width: auto;
  accent-color: var(--violet-accent);
}

.rappel-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.rappel-section .rappel-modes label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 400;
  padding: 0.3rem 0.6rem;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
}

.rappel-section .rappel-modes label:has(input:checked) {
  background: rgba(109, 40, 217, 0.1);
  border-color: var(--violet-accent);
  color: var(--violet-accent);
  font-weight: 600;
}

.rappel-section .rappel-ligne {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.rappel-section .rappel-ligne[hidden] {
  display: none;
}

.rappel-section .rappel-ligne select,
.rappel-section .rappel-ligne input[type="time"] {
  width: auto;
}

.form-group .repartir-case {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0;
}
/* Cases personnalisées (emojis) : répartir + rappel e-mail */
#repartir,
#rappel-actif {
  -webkit-appearance: none;
  appearance: none;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  padding: 0 !important;
  margin: 0;
  border: none !important;
  border-radius: 3px;
  background: url("../images/emojis/case.png") center / contain no-repeat !important;
  cursor: pointer;
  flex-shrink: 0;
}

#repartir:checked,
#rappel-actif:checked {
  background-image: url("../images/emojis/vu.png") !important;
}

#repartir:focus-visible,
#rappel-actif:focus-visible {
  outline: 2px solid var(--violet-accent);
  outline-offset: 2px;
}
/* ---------- Accueil : aide, listes vides, étapes ---------- */

/* Liste vide : exemple à la place du vide */
.liste-vide {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  padding: 1.2rem 1rem;
  margin-bottom: 1rem;
  border: 2px dashed rgba(109, 40, 217, 0.25);
  border-radius: 12px;
  color: var(--texte-secondaire);
  font-size: 0.88rem;
}

.liste-vide strong {
  color: var(--texte-principal);
  font-size: 0.95rem;
}

.liste-vide[hidden] {
  display: none;
}

#liste-creneaux:empty,
#liste-taches:empty {
  flex: 0;
  margin: 0;
}

/* Fenêtre de choix : mettre à jour ou tout refaire */
.choix-planning-contenu {
  max-width: 600px;
  width: 92%;
  padding: 2.2rem 2rem 2rem;
  text-align: center;
}

.choix-planning {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  margin-top: 1.6rem;
}



.choix-btn {
  width: 100%;
  padding: 0.95rem 1rem;
  font-size: 1rem;
}

.choix-aide {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--texte-secondaire);
}

@media (max-width: 640px) {
  .choix-planning {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
}