/* ============================================================
   POLICE & VARIABLES GLOBALES
============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap');

:root {
  --primary: #2980b9;
  --primary-light: #3498db;
  --sidebar-bg: #2c3e50;
  --sidebar-hover: #34495e;
  --text-dark: #2c3e50;
  --text-light: #ecf0f1;
  --background: #f9f9f9;
  --radius: 8px;
  --transition: 0.3s ease;
}

/* ============================================================
   RESET
============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Source Sans Pro', sans-serif;
}

/* ============================================================
   LAYOUT GLOBAL
============================================================ */
body {
  display: flex;
  min-height: 100vh;
  background: var(--background);
  color: var(--text-dark);
  padding-top: 50px;
}

/* ============================================================
   HEADER FIXE
============================================================ */
.header-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background-color: var(--primary);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 1000;
}

.header-top h1 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-right: 20px;
}

/* --- Quick Access --- */
.quick-access a {
  color: var(--text-light);
  margin-right: 15px;
  text-decoration: none;
  font-size: 0.9rem;
}

.quick-access a:hover {
  text-decoration: underline;
}

/* --- Alignements Gauche/Droite --- */
.header-left {
  display: flex;
  align-items: center;
}

.header-right {
    display: flex;
    align-items: center;   /* centre verticalement avec le bouton */
    gap: 8px;             /* espace entre texte et bouton */
}

.user-info {
    display: flex;
    flex-direction: column; /* Nom au-dessus, rôle en dessous */
    justify-content: center; /* centre le texte verticalement */
    text-align: right;
    line-height: 1.1;
    margin: 0;
}

.user-name {
  font-weight: 600;
  display: block;
}

.user-role {
  font-size: 0.75rem;
  opacity: 0.85;
}

/* --- Logout Button (déjà existant) --- */
#logout-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  transition: transform var(--transition);
  font-size: 1.2rem;
}

#logout-btn:hover {
  transform: scale(1.1);
}

/* ============================================================
   SIDEBAR
============================================================ */
nav.sidebar {
  width: 320px;
  background-color: var(--sidebar-bg);
  color: var(--text-light);
  padding: 20px;
  overflow-y: auto;
  flex-shrink: 0;
}

nav.sidebar h2 {
  font-size: 1.4em;
  margin-bottom: 1rem;
  color: var(--text-light);
  font-weight: 600;
}

.sidebar-logo-link {
  color: var(--text-light);
  font-weight: 600;
  font-size: 1.4em;
  text-align: center;
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  text-decoration: none;
  transition: color var(--transition);
}

.sidebar-logo-link:hover {
  color: var(--primary-light);
}

nav.sidebar ul {
  list-style: none;
}

nav.sidebar ul li {
  margin: 10px 0;
}

nav.sidebar ul li > a,
nav.sidebar ul li > button.dropdown-btn {
  color: var(--text-light);
  text-decoration: none;
  cursor: pointer;
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 1em;
  transition: background-color var(--transition);
  position: relative;
}

nav.sidebar ul li > a:hover,
nav.sidebar ul li > button.dropdown-btn:hover {
  background-color: var(--sidebar-hover);
}

nav.sidebar button.dropdown-btn::after {
  content: "▼";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7em;
  transition: transform var(--transition);
}

nav.sidebar button.dropdown-btn.active::after {
  transform: translateY(-50%) rotate(180deg);
}

nav.sidebar ul ul.dropdown-content {
  display: none;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-left: 15px;
  margin-top: 6px;
  border-left: 1px solid rgba(255,255,255,0.3);
  padding-left: 10px;
  font-size: 0.9em;
  color: #bdc3c7;
  transition: all 0.3s ease;
}

nav.sidebar ul ul.dropdown-content.open {
  display: block;
  max-height: 1000px;
  opacity: 1;
}

nav.sidebar ul ul.dropdown-content li > a {
  color: #bdc3c7;
  padding: 5px 10px;
  border-radius: 4px;
}

nav.sidebar ul ul.dropdown-content li > a:hover {
  background-color: #3e556c;
}

nav.sidebar button.dropdown-btn:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* ============================================================
   CONTENU PRINCIPAL
============================================================ */
main.content {
  flex-grow: 1;
  padding: 20px;
  background: #f3f3f3;
  overflow-y: auto;
}

main.content h1 {
  margin-bottom: 10px;
  color: var(--text-dark);
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
}

/* ============================================================
   QUICK ACCESS BUTTONS
============================================================ */
.quick-access {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
  justify-content: center;
}

.quick-access button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 15px 25px;
  font-size: 1.1em;
  border-radius: var(--radius);
  cursor: pointer;
  flex: 1 1 200px;
  max-width: 250px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
  transition: background-color var(--transition), transform var(--transition);
}

.quick-access button:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
}

/* ============================================================
   TABLEAUX
============================================================ */
.data-table {
  width: 100%;
  max-width: 1200px;
  margin: 20px auto;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.data-table thead {
  background-color: var(--primary);
  color: #fff;
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.data-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.data-table tbody tr:hover {
  background-color: #e1ecf8;
}

.data-table a {
  color: var(--primary);
  text-decoration: none;
}

.data-table a:hover {
  text-decoration: underline;
}

/* ============================================================
   SCROLLBAR CUSTOM
============================================================ */
.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.5);
}

/* ============================================================
   BARRE DE RECHERCHE
============================================================ */
.search-box {
    display: flex;
    justify-content: center;
    margin: 20px auto;
    width: 100%;
    max-width: 700px; /* ↑ plus large */
}

.search-box input[type="text"] {
    width: 100%;
    padding: 10px 12px;  /* ↑ plus haut */
    font-size: 1rem;     /* texte un peu plus grand */
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    height: auto;        /* laisse le padding définir la hauteur */
}

.search-box input[type="text"]:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(52,152,219,0.25);
    outline: none;
}
/* ============================================================
   FICHE ÉTUDIANT / CARTES
============================================================ */
.etudiant-header {
  background: #fff;
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.etudiant-header h2 {
  margin-bottom: 5px;
  color: #0078d7;
}

.etudiant-header p {
  margin: 0;
  font-weight: 500;
}

.fiche-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.fiche-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 20px 20px 20px 30px;
  overflow: hidden;
  transition: max-height 0.3s ease;
  position: relative;
  margin-bottom: 20px; /* espace entre chaque fiche */
}

.fiche-card.full-width {
  grid-column: span 2; /* occupe les deux colonnes */
}

.fiche-card h2 {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #0078d7;
}

.fiche-card h2::after {
  content: "+";
  font-weight: bold;
  transition: transform 0.3s;
}

.fiche-card.open h2::after {
  content: "–";
}

.fiche-card-content {
  max-height: none;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.fiche-card:not(.open) .fiche-card-content {
  max-height: 0;
  opacity: 0;
}

.fiche-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fiche-card li {
  padding: 4px 0;
  border-bottom: 1px solid #eee;
}

.fiche-card:not(:last-child) {
    margin-bottom: 20px;
}

.btn-retour {
  display: inline-block;
  margin-top: 30px;
  padding: 10px 15px;
  background: #0078d7;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.btn-retour:hover {
  background: #005ea6;
}

/* ============================================================
   VALIDATION PAGE
============================================================ */
.validation-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 10px;
}

.validation-card h3 {
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--primary);
}

.validation-category {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.validation-category h3 {
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--primary);
}

.validation-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.validation-item label {
  width: 100px;
  font-weight: 500;
}

.btn-pdf {
  padding: 5px 10px;
  background-color: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-pdf:hover {
  background-color: var(--primary-light);
}

.btn-pdf.invisible {
  visibility: hidden;
  pointer-events: none;
}

.btn-enregistrer {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 120px;
}

.btn-enregistrer:hover {
    background-color: #45a049;
}

.btn-modifier {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 120px;
}

.btn-modifier:hover {
    background-color: #1976D2;
}
.form-actions {
    display: flex;
    justify-content: space-between;
    gap : 10px;
    margin-top: 20px;
}
.fiche-grid.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 50% - 50% */
  gap: 20px;
  align-items: start;
}

.fiche-these {
  grid-column: 1;
}

.fiche-validations {
  grid-column: 2;
}

.quick-access-icons button {
    background-color: #f5f5f5; /* fond clair */
    border: 1px solid #ccc;    /* bord léger */
    border-radius: 5px;        /* coins arrondis */
    padding: 5px 10px;         /* espace autour de l’icône */
    cursor: pointer;
    font-size: 16px;           /* taille de l’icône */
    transition: all 0.2s ease;
    margin-left: 5px;          /* espacement entre les boutons */
}

.quick-access-icons button:hover {
    background-color: #e0e0e0; /* fond un peu plus sombre au survol */
    transform: scale(1.1);     /* léger agrandissement */
}

.quick-access-icons button:active {
    transform: scale(0.95);    /* effet clic */
    background-color: #d0d0d0;
}

/* ============================================================
   FICHE ÉTUDIANT : LIGNES VERTICALES ET REPÈRES
============================================================ */

/* Ligne verticale pour chaque bloc fiche-card */
.fiche-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    background-color: var(--primary);
    border-radius: 2px;
}

/* Sous-sections (h3) : petit repère circulaire */
.fiche-card h3 {
    position: relative;
    margin-top: 15px;
    margin-bottom: 5px;
    color: var(--primary);
}

.fiche-card h3::before {
    content: "";
    position: absolute;
    left: -10px; /* décalage vers la gauche */
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
}

/* Séparateur léger entre sous-sections */
.fiche-card-content ul + h3 {
    margin-top: 20px;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

/* Responsive : tableau ou cartes */
@media (max-width: 900px) {
  .fiche-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   FICHE VALIDATIONS : CARTES RÉDUCTIBLES
============================================================ */

.validation-card {
    background: #fff;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.validation-card h3.toggle-card {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary);
    position: relative;
    padding-right: 20px;
}

.validation-card h3.toggle-card::after {
    content: "+";
    font-weight: bold;
    position: absolute;
    right: 0;
    transition: transform 0.3s;
}

.validation-card.open h3.toggle-card::after {
    content: "–";
}

.validation-card-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.validation-card.open .validation-card-content {
    max-height: 500px; /* assez grand pour le contenu */
    opacity: 1;
}
/* ============================================================
   TABLE SIMPLE (pour affichage statique / léger)
============================================================ */
.table-simple {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin: 15px 0;
    font-size: 0.95rem;
}

.table-simple th {
    background: #f0f4f8;
    color: #2c3e50;
    font-weight: 600;
    padding: 10px;
    border-bottom: 2px solid #d9e2ec;
    text-align: left;
}

.table-simple td {
    padding: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.table-simple tr:nth-child(even) {
    background: #fafafa;
}

.table-simple tr:hover {
    background: #eef5fc;
}

/* ============================================================
    PAGE D'EXPORTS
============================================================ */

.export-category {
            margin-bottom: 30px;
        }
        .export-category h2 {
            margin-bottom: 10px;
            color: #0078d7;
        }
        .export-buttons {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
        }
        .export-buttons a {
            text-decoration: none;
        }
/* ============================================================
   INPUTS - COMPACT+
============================================================ */

/* Champs courts (dates, heures, nombres) */
input[type="date"],
input[type="time"],
input[type="number"] {
    width: 110px;  /* ↓ encore plus compact */
    height: 28px;      /* ↓ hauteur réduite */
    padding: 0px 6px;  /* optionnel : réduit le padding interne */
    font-size: 0.85rem; /* ajuste la taille du texte si besoin */
}

/* Champs standards (texte, email, select) */
input[type="text"],
input[type="email"],
select {
    width: 200px;  /* ↓ réduit mais confortable */
    height: 28px;      /* ↓ hauteur réduite */
    padding: 0px 6px;  /* optionnel : réduit le padding interne */
    font-size: 0.85rem; /* ajuste la taille du texte si besoin */
}

/* Textarea */
textarea {
    width: 100%;
    max-width: 380px; /* ↓ un peu plus étroit */
}

/* Style général */
input,
select,
textarea {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 0.85rem;   /* plus compact */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

/* Focus */
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(52,152,219,0.25);
    outline: none;
}

/* Lecture seule */
input[readonly],
select[disabled],
textarea[readonly] {
    background-color: #f4f4f4;
    border-color: #ccc;
    color: #666;
}

/* Alignement lignes */
.fiche-card-content ul li,
.validation-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================================
  ADD BOUTON STYLES
============================================================ */

/* Bouton + rond bleu */
.btn-add {
    background-color: #2980b9;   /* bleu */
    color: white;                /* texte blanc */
    border: none;                /* pas de bordure */
    border-radius: 50%;          /* rond */
    width: 40px;                 /* largeur */
    height: 40px;                /* hauteur */
    font-size: 24px;             /* taille du + */
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.btn-add:hover {
    background-color: #0056b3;   /* bleu foncé au survol */
}
/* ============================================================
   Login Page Compact
============================================================ */
/* Login page uniquement */
body.login-page {
    display: flex;
    height: 100vh;
    margin: 0;
}

body.login-page .login-container {
    display: flex;
    flex: 1;
}

body.login-page .login-left {
    flex: 1;
    background-color: #f4f6f8;
}

body.login-page .login-right {
    flex: 1;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    width: 280px;                 /* largeur réduite */
    padding: 15px 20px;           /* padding compact */
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.login-box h2 {
    text-align: center;
    font-size: 1.2rem;
    margin: 5px 0 10px 0;        /* réduit espace au-dessus et au-dessous */
}

.login-box .error {
    color: red;
    text-align: center;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.login-box label {
    display: block;
    font-size: 0.85rem;
    margin: 5px 0 2px 0;          /* réduit espace avant et après label */
}

.login-box input[type="email"],
.login-box input[type="password"] {
    width: 100%;                  /* largeur identique */
    padding: 6px 8px;             /* hauteur réduite */
    margin-bottom: 10px;          /* espace réduit entre champs */
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.login-box button {
    width: 100%;
    padding: 8px;                 /* bouton plus petit */
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    background-color: #3498db;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-box button:hover {
    background-color: #2980b9;
}
.welcome-message {
  text-align: center; /* centre le texte horizontalement */
}
/* ============================================================
 User toggle
============================================================ */
.user-menu-container {
    position: relative;
    cursor: pointer;
}

.user-info {
    color: #ecf0f1;
    padding: 5px 10px;
    border-radius: 4px;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.15);
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 40px;
    background: #2c3e50;
    border: 1px solid #1c2833;
    border-radius: 6px;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
}

.user-dropdown a {
    display: block;
    padding: 10px 15px;
    color: #ecf0f1;
    text-decoration: none;
}

.user-dropdown a:hover {
    background: #34495e;
}
