/* style.css */
/**
 * Nom du fichier : style.css
 * Description : Styles généraux et responsives pour le framework.
 * Auteur : Sylvain SCATTOLINI
 * Date : 08/02/2025
 * Version : 1.0
 */
:root {
  --bleu: #246cd1;
  --bleuClair: #007BFF;
  --grisClair: rgb(238, 238, 238);
  --grisMoyen: rgb(190, 190, 190);
  --grisFonce: rgb(70, 70, 70);
}

 /* ajouté pour scrool */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
  }

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


h1 {
    text-align: center;
    margin-bottom: 20px;
}


/* Styles généraux */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1; /* Prend tout l'espace restant */
    min-height: calc(100vh - 70px - 40px); /* Hauteur exacte entre header et footer */
    overflow-y: auto;
    display: flex;
    align-items: center;
    flex-direction: column;
    background: #f8f9fa;
}

#content {
    width: 100%;
    max-width: 1200px; /* Largeur max pour un meilleur affichage */
    padding: 20px;
}

/* Conteneur central */
*/*.container {
    height: 100vh;
    margin: 10px 10px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}*/

.profile-form {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Header commun */
header {
    background-color: #007BFF;
    height: 70px;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.843);
}

/* Menu hamburger pour mobile */
header .menu {
    background-color: #007BFF;
    color: #fff;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}
.menu a {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
    font-weight: bold;
}
.logoblanc {
    color: #fff;
    height: 50px;
}

.logo svg {
    width: auto;
    height: 70px;
    display: block;
}

.logo .wave {
    color: #ff8e05; /* Couleur de la vague */
    fill: currentColor;
}

.logo .text {
    fill: white; /* Couleur du texte */
}

@media (max-width: 600px) {
    header .menu {
        display: none;
    }
    header .hamburger {
        display: block;
        cursor: pointer;
    }
}

/* Style du formulaire */
form {
    display: flex;
    flex-direction: column;
}

form label {
    margin-bottom: 5px;
    font-weight: bold;
}

form input[type="email"],
form input[type="password"] {
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

form button {
    padding: 10px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 10px;
    transition: background-color 0.3s ease;
}

form button:hover {
    background-color: #0056b3;
}

/* Style pour les liens */
a {
    text-decoration: none;
    color: #007BFF;
    font-size: 14px;
    text-align: center;
    display: block;
}

a:hover {
    text-decoration: underline;
}

/* Styles pour l'affichage de messages (par exemple, message flash) */
/* Styles spécifiques à la gestion du profil */



.profile-form .form-group {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
    align-items: center;
}
.profile-form .form-group label {
    flex: 0 0 100%;
    font-weight: bold;
    margin-right: 10px;
}
.profile-form form input[type="text"],
.profile-form .form-group input[type="email"],
.profile-form .form-group input[type="password"] {
    flex: 1 0 250px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 0px;
    font-size: 14px;
}
.profile-form .form-group input[type="checkbox"] {
    margin-right: 5px;
}
.profile-form .form-group button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: #007BFF;
    color: #fff;
    cursor: pointer;
    flex: 1;
}
.profile-form .form-group button:hover {
    background-color: #0056b3;
}
.message {
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
}
.message.error {
    color: red;
}
.message.success {
    color: green;
}

/* Responsive : ajustements pour les écrans étroits */
@media (max-width: 480px) {
    .container {
        margin: 20px;
        padding: 15px;
    }
    
    form input[type="email"],
    form input[type="password"] {
        font-size: 14px;
        padding: 8px;
    }
    
    form button {
        font-size: 14px;
        padding: 8px;
    }
}

/* Footer */
footer {
    height: 40px;
    background: #343a40;
    color: white;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Empêche le footer de rétrécir */
}

.info-button {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 40px;
    background-color: #3498db;
    color: white;
    font-size: 24px; /* Taille du "i" normal */
    font-family: "Charm", cursive;
    font-style: italic; /* Italique */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 40px 0 0;
    cursor: pointer;
    line-height: 1;
    text-align: center;
    transition: background-color 0.3s ease;
    text-decoration: none;
}


.info-button:hover,
.info-button:focus,
.info-button:active {
    text-decoration: none;
    background-color: #217dbb; 
}

.info-button[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 50px; /* Positionnement au-dessus du bouton */
    left: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 12px;
    font-family: Arial, sans-serif;
    z-index: 1000;
}

/* Conteneur du "i" */
.info-button span {
    display: block;
    transform: translateX(-7px) translateY(2px);
    transition: transform 0.2s ease, font-size 0.2s ease; /* Animation fluide */
}

/* Effet au survol */
.info-button:hover span {
    transform: translateX(-8px) translateY(2px) scale(1.3); /* Agrandit le "i" sans déformer le bouton */
}

.inactive {
    background-color: #7e7e7e;
    color: white;
    cursor: auto;
}

.info-button.inactive:hover {
    background-color: #7e7e7e;
}
/* Pour les boutons inactifs, ne pas appliquer l'effet d'agrandissement */
.info-button.inactive:hover span {
    transform: translateX(-7px) translateY(2px) scale(1);
}


/**************** TEMPLATE Default **********************/
/* ===== Layout principal ===== */
.template-container {
    display: flex;
    width: 100%;
}

/* ===== Menu latéral ===== */
.template-sidebar {
    width: 220px;
    min-height: 10vh;
    background-color: #f8f9fa;
    padding: 0px;
    border-right: 1px solid #ddd;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.template-sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.template-sidebar nav ul li {
    width: 100%;
    margin-bottom: 10px;
}

.template-sidebar nav ul li a {
    display: block;
    width: 100%;
    padding: 12px 16px;
    color: #333;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.3s ease;
    text-align: left;
}

.template-sidebar nav ul li a:hover {
    background-color: var(--bleuClair); /* bleu clair avec transparence */
    color: #fff;
    text-decoration: none;
}

.page-header {
    width: 100%;
    border-bottom: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 20px;
    display: flex;
    color: #222;
}

.template-content {
    width: 100%;
    border-bottom: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    color: #222;
}

.bloc {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px;
    width: calc(100% - 40px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

.search {
    width: 100%; 
    max-width: 400px; 
    padding: 6px;
}

/************* Template tableau ********************/


/***** le bon */
.table-block {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 100%;
    margin-bottom: 30px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.table-header h2 {
    font-size: 1.3rem;
    color: var(--grisFonce);
}

.table-header .table-actions {
  display: flex;
  align-items: center;
  gap: 0.5em; /* espace entre les boutons */
}

.table-header .table-actions > * {
  margin: 0; /* on enlève tout margin par défaut */
}
/* === TABLEAU GÉNÉRIQUE === */

table.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

table.table thead {
    background-color: var(--grisClair, #f0f0f0);
}

table.table thead th {
    padding: 12px;
    text-align: left;
    font-weight: bold;
    color: #000;
    border-bottom: 1px solid var(--gris, #ccc);
}

table.table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--gris, #eee);
    vertical-align: middle;
    color: var(--grisFonce, #333);
}

table.table tbody tr:last-child td {
    border-bottom: none;
}

/* Colonne actions */
td.actions {
    text-align: center;
    white-space: nowrap;
}

/* Boutons d'action discrets dans les cellules */
button.action-btn, .btn{
    background: none;
    border: none;
    cursor: pointer;
    padding: 0px;
    margin: 0 2px;
    color: var(--grisFonce, #333); /* Couleur par défaut */
    transition: color 0.2s ease;
}

button.action-btn:hover, .btn:hover {
    color: var(--bleu, #007bff);
}

/* Icônes FontAwesome */
button.action-btn i, .btn i {
    font-size: 1rem;
    vertical-align: middle;
    pointer-events: none;
}

/* Colonne avec checkbox (actif) */
td.checkbox-cell {
    text-align: center;
    vertical-align: middle;
}

td.checkbox-cell input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
}

/* Actions */
td.table-actions {
    vertical-align: middle;
    white-space: nowrap;
}

td.table-actions .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 4px;
    padding: 4px;
    height: 32px;
    width: 32px;
    border: none;
    background: none;
    cursor: pointer;
}

td.table-actions .action-btn i {
    font-size: 1rem;
    line-height: 1;
    height: 1em;
    vertical-align: middle;
}

.toggle-actif {
    transform: scale(1.1);
    cursor: pointer;
}
/* switch */
.switch-toggle {
    display: inline-block;
    vertical-align: middle;
    position: relative;
    width: 42px;
    height: 24px;
    margin-right: 10px;
}

.switch-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 34px;
}

.switch-toggle .slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.switch-toggle input:checked + .slider {
    background-color: #007BFF;
}

.switch-toggle input:checked + .slider::before {
    transform: translateX(18px);
}

.switch-toggle .label-text {
    font-size: 0.9rem;
    color: #333;
}

/* modale */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-content {
  background: #fff;
  padding: 1.5em;
  border-radius: 0.5em;
  width: 320px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.modal-actions .btn {
  margin-left: 0.5em;
}


/* Tri de colonnes : curseur + indicateurs */
.table th.sortable {
  cursor: pointer;
  user-select: none;
}

.table th.sortable .th-label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.table th.sortable .sort-indicator {
  font-size: .85em;
  opacity: .7;
}

/* États explicites si tu utilises aria-sort */
.table th[aria-sort="ascending"]  .sort-indicator::before { content: "▲"; }
.table th[aria-sort="descending"] .sort-indicator::before { content: "▼"; }
/* Si tu veux un hint neutre: */
/* .table th.sortable[aria-sort="none"] .sort-indicator::before { content:"↕︎"; opacity:.4; } */

/* Assure l’affichage de la colonne Actions (th + td) */
.table th.table-actions,
.table td.table-actions {
  text-align: center;
  white-space: nowrap;
  width: auto;        /* laisse le tableau calculer */
  min-width: 100px;   /* garantit la place des icônes */
}

/* par défaut, cache la colonne "deleted_at" dans les tableaux groupés */
.table-block:not(.show-deleted-rows) th[data-col="deleted_at"],
.table-block:not(.show-deleted-rows) td[data-col="deleted_at"] {
  display: none;
}

/* quand le switch local est ON, la colonne s’affiche */
.table-block.show-deleted-rows th[data-col="deleted_at"],
.table-block.show-deleted-rows td[data-col="deleted_at"] {
  display: table-cell;
}