/* Reset et variables globales */
:root {
    --primary-color: #3498db;       /* Bleu professionnel */
    --secondary-color: #2c3e50;    /* Gris foncé */
    --accent-color: #e74c3c;        /* Rouge pour les alertes */
    --success-color: #27ae60;      /* Vert pour les succès */
    --light-color: #ecf0f1;         /* Fond clair */
    --dark-color: #2c3e50;          /* Texte foncé */
    --border-radius: 8px;           /* Coins arrondis */
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* En-tête commune */
.header {
    background-color: white;
    box-shadow: var(--box-shadow);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    color: var(--primary-color);
    font-weight: 600;
}

.header a {
    color: var(--dark-color);
    text-decoration: none;
    margin-left: 20px;
    transition: var(--transition);
}

.header a:hover {
    color: var(--primary-color);
}

/* Conteneurs principaux */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Cartes (tuiles) */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.card-title {
    color: var(--primary-color);
    font-weight: 600;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #1a252f;
}

.btn-danger {
    background-color: var(--accent-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #219653;
}

/* Formulaires */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Tableau de bord (grille de tuiles) */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tuile {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border-top: 4px solid var(--primary-color);
}

.tuile:hover {
    transform: translateY(-5px);
}

.tuile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tuile-title {
    font-weight: 600;
    color: var(--dark-color);
}

.tuile-actions {
    margin-top: 15px;
}

.action-item {
    background: #f8f9fa;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
}



/* Pied de page */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: #7f8c8d;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        text-align: center;
    }

    .header a {
        margin: 10px 0;
    }
}
/* Boutons améliorés pour Déconnexion/Retour */
.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    gap: 8px;
}

.btn-deconnexion {
    background-color: #e74c3c;
    color: white;
}

.btn-deconnexion:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
}

.btn-retour {
    background-color: #3498db;
    color: white;
}

.btn-retour:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

/* Style pour les icônes dans les boutons */
.btn-nav i {
    font-size: 14px;
}
/* Style pour le menu déroulant des actions */
.tuile-actions-menu {
    position: relative;
    display: inline-block;
}

.tuile-actions-button {
    background: none;
    border: none;
    color: #7f8c8d;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.tuile-actions-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.tuile-actions-dropdown {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 180px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    z-index: 1;
    overflow: hidden;
    border: 1px solid #eee;
}

.tuile-actions-dropdown a {
    color: #2c3e50;
    padding: 10px 15px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.tuile-actions-dropdown a:hover {
    background-color: #f1f3f5;
}

.tuile-actions-dropdown a i {
    font-size: 14px;
}

.tuile-actions-menu:hover .tuile-actions-dropdown {
    display: block;
}

/* Animation pour le menu */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.tuile-actions-dropdown {
    animation: fadeIn 0.2s ease;
}
/* ===== Variables et Reset ===== */
:root {
    --primary: #3498db;
    --secondary: #2c3e50;
    --success: #27ae60;
    --danger: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* ===== Boutons améliorés ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #1a252f;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
}

/* ===== Menu déroulant des actions ===== */
.actions-menu {
    position: relative;
    display: inline-block;
}

.actions-button {
    background: none;
    border: none;
    color: var(--dark);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
}

.actions-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.actions-dropdown {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 180px;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #eee;
    animation: fadeIn 0.2s ease;
}

.actions-dropdown a {
    color: var(--dark);
    padding: 10px 15px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.actions-dropdown a:hover {
    background-color: #f1f3f5;
}

.actions-dropdown a i {
    font-size: 14px;
}

.actions-menu:hover .actions-dropdown {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Cartes et tuiles ===== */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.tuile {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border-top: 4px solid var(--primary);
}

.tuile:hover {
    transform: translateY(-2px);
}

.tuile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.tuile-title {
    color: var(--dark);
    font-weight: 600;
    margin: 0;
}

/* ===== Alertes ===== */
.alert {
    padding: 12px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.alert-success {
    background-color: #dff0d8;
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-error {
    background-color: #fdecea;
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

/* ===== Formulaires ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="color"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* ===== En-tête ===== */
.header {
    background-color: white;
    box-shadow: var(--box-shadow);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header h1 {
    color: var(--primary);
    font-weight: 600;
    margin: 0;
}

.header h1 i {
    margin-right: 10px;
}

/* ===== Pied de page ===== */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: #7f8c8d;
    font-size: 14px;
}

/* ===== Dashboard ===== */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* ===== Actions ===== */
.action-item {
    background: #f8f9fa;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.statut-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.statut-a-faire {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger);
}

.statut-en-cours {
    background-color: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

.statut-termine {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--success);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}
/* Aperçu de la couleur sélectionnée */
.color-preview-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.color-preview {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: inline-block;
}

.color-code {
    font-size: 14px;
    color: #7f8c8d;
    font-family: monospace;
}
/* Style pour le sélecteur de couleur personnalisé */
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.color-picker-preview {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.color-picker-preview::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L9 6l5 5 5 9 10 10.59 12.59 8l-7 7 1.41 1.41L10 15.17l7.59-7.59L19 16l-5-5z'/%3E%3C/svg%3E") no-repeat center;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s;
}

.color-picker-preview:hover::after {
    opacity: 0.7;
}

.color-code {
    font-size: 14px;
    color: #7f8c8d;
    font-family: monospace;
}

/* Masquer le sélecteur de couleur natif */
.color-picker-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}


/* Bouton Déconnexion - Icône seule sur fond jaune fluo */
.btn-logout {
    background-color: #eded16; /* Jaune fluo */
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Forme ronde */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0; /* Supprimer le padding pour centrer l'icône */
}

.btn-logout:hover {
    background-color: #FFD700; /* Jaune légèrement plus foncé au survol */
    transform: scale(1.05); /* Légèrement agrandi */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-logout i {
    color: rgb(38, 38, 38); /* Icône en blanc */
    font-size: 18px; /* Taille légèrement augmentée */
}
/* Style pour le toggle "Afficher les tâches terminées" */
.toggle-container {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin-left: 15px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* Quand le toggle est activé */
input:checked + .toggle-slider {
    background-color: #27ae60; /* Vert pour "activé" */
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

/* Style du label du toggle */
.toggle-label {
    font-weight: 500;
    color: #2c3e50;
    margin-right: 10px;
}

/* Bouton "Retour" - Style bleu clair avec icône */
.btn-retour {
    background-color: #3498db; /* Bleu clair (peut être personnalisé) */
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-retour:hover {
    background-color: #2980b9; /* Bleu légèrement plus foncé au survol */
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-retour i {
    color: white; /* Icône en blanc */
    font-size: 14px;
}

/* Version ronde (optionnelle) */
.btn-retour.rounded {
    border-radius: 50px; /* Bouton arrondi */
    padding: 8px 20px;
}

/* Version icône seule (optionnelle) */
.btn-retour.icon-only {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 50%; /* Cercle */
}

.btn-retour.icon-only i {
    font-size: 16px;
}


/* Style pour le titre dans la barre de menu */
.header h1 {
    color: var(--primary);
    font-weight: 600;
    margin: 0;
    font-size: 20px; /* Taille réduite (ajuste selon tes préférences) */
    display: flex;
    align-items: center;
}

.header h1 i {
    margin-right: 10px;
    font-size: 20px; /* Taille de l'icône ajustée */
}

/* Pour les écrans plus petits */
@media (max-width: 768px) {
    .header h1 {
        font-size: 18px; /* Encore plus petit sur mobile */
    }
    .header h1 i {
        font-size: 18px;
    }
}
/* Style pour les briques avec taille fixe et ascenseur */
.tuile.large {
    min-height: 180px;  /* Hauteur minimale pour éviter les briques trop petites */
    max-height: 250px;  /* Hauteur maximale fixe à 250px */
    display: flex;
    flex-direction: column;
}

.tuile-actions {
    flex: 1;
    overflow-y: auto; /* Ascenseur vertical si le contenu dépasse */
    margin-top: 10px;
    padding-right: 5px; /* Espace pour l'ascenseur */
}

/* Style pour les tâches cliquables */
.action-item {
    padding: 10px;
    margin-bottom: 10px;
    background: white;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary);
    transition: background-color 0.2s;
    position: relative; /* Nécessaire pour le lien absolu */
    overflow: hidden; /* Évite les débordements */
}

.action-item:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

/* Le lien doit couvrir toute la surface de la tâche */
.action-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1; /* Au-dessus du contenu */
    cursor: pointer;
}

/* Contenu de la tâche (doit rester visible) */
.action-content {
    position: relative;
    z-index: 2; /* Au-dessus du lien pour le rendu visuel */
    pointer-events: none; /* Permet au lien de capter les clics */
}
