/* static/css/styles.css */

/* Définition des variables de couleur pour tout le site, basées sur login.css */
:root {
    --ae-primary: #0d4d8c; /* Bleu foncé du logo */
    --ae-accent: #d9581b;  /* Orange du logo */
    --bs-primary-rgb: 13, 77, 140; /* Version RGB pour Bootstrap */
    --bs-link-color-rgb: 217, 88, 27; /* Liens en orange */
}

/* Surcharge des couleurs de Bootstrap */
.bg-primary {
    background-color: var(--ae-primary) !important;
}

.btn-primary {
    background-color: var(--ae-accent); /* Boutons principaux en orange */
    border-color: var(--ae-accent);
    color: #fff;
}

body, h1, h2, h3, h4, h5, h6, p, a, li, button, input, select, textarea, .btn {
    font-family: 'Inter', sans-serif;
}

.btn-primary:hover {
    background-color: #b94a15; /* Orange plus foncé pour le survol */
    border-color: #b94a15;
    color: #fff;
}

/* Classe utilitaire pour utiliser la couleur d'accentuation (orange) */
.text-accent {
    color: var(--ae-accent) !important;
}

/* Style pour le focus sur les champs de formulaire, comme sur la page de connexion */
.form-control:focus {
    border-color: var(--ae-accent);
    box-shadow: 0 0 0 0.2rem rgba(217, 88, 27, 0.25);
}

/* --- Styles pour les Tableaux de Bord --- */

.dashboard-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    background-color: #fff;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.dashboard-card .card-body {
    display: flex;
    align-items: center;
    padding: 1.5rem;
}

.dashboard-card .icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Couleurs douces pour les fonds des icônes */
.bg-primary-soft { background-color: rgba(13, 77, 140, 0.1); }
.bg-success-soft { background-color: rgba(25, 135, 84, 0.1); }
.bg-info-soft { background-color: rgba(13, 202, 240, 0.1); }
.bg-warning-soft { background-color: rgba(255, 193, 7, 0.1); }
.bg-danger-soft { background-color: rgba(220, 53, 69, 0.1); }
/* --- Styles pour le Mode Sombre --- */

/* Prefer the attribute on the HTML element for clarity */
html[data-bs-theme="dark"] {
    --bs-body-bg: #0b0f14;
    --bs-body-color: #e6eef6;
    --bs-tertiary-bg: #0f1720;
    --bs-border-color: rgba(255,255,255,0.06);
    --bs-list-group-bg: #161b20;
    --bs-list-group-border-color: var(--bs-border-color);
    --bs-list-group-color: var(--bs-body-color);
    --bs-list-group-action-hover-bg: #1e262b;
    --bs-card-bg: #0f1720;
    --bs-card-border-color: var(--bs-border-color);
    /* base body */
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* Styles spécifiques pour les éléments en mode sombre */
html[data-bs-theme="dark"] .dashboard-card {
    background-color: var(--bs-tertiary-bg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--bs-card-border-color);
}

html[data-bs-theme="dark"] .dashboard-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

html[data-bs-theme="dark"] .text-muted {
    color: #9aa3ad !important;
}

html[data-bs-theme="dark"] .dropdown-menu {
    --bs-dropdown-bg: #161b20;
    --bs-dropdown-link-color: #e6eef6;
    --bs-dropdown-link-hover-bg: #1e262b;
    --bs-dropdown-link-hover-color: #e6eef6;
    --bs-dropdown-divider-bg: #1e262b;
}

html[data-bs-theme="dark"] .dropdown-item.text-danger {
    color: #ff8a8a !important;
}

html[data-bs-theme="dark"] .dropdown-item.text-danger:hover {
    color: #ffb3b3 !important;
}

/* --- Styles pour la barre de navigation moderne --- */
.navbar-nav .nav-link {
    color: var(--bs-body-color); /* Utilise la variable de thème pour la couleur du texte */
    font-weight: 500;
    position: relative;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 0.375rem; /* Coins arrondis pour le survol */
}

/* Effet de survol simple */
.navbar-nav .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05); /* Couleur de fond légère au survol */
    color: var(--bs-body-color);
}

/* Effet de survol spécifique pour le mode sombre */
html[data-bs-theme="dark"] .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05); /* Fond blanc très transparent */
}

.navbar-nav .nav-link.active {
    color: var(--ae-accent) !important;
    background-color: rgba(217, 88, 27, 0.1); /* Fond léger pour l'élément actif */
}

/* --- Amélioration des formulaires --- */

/* Rendre les étiquettes (titres des champs) plus claires */
.form-label {
    font-weight: 500; /* Police légèrement plus grasse */
    margin-bottom: 0.5rem;
}

/* Rendre le texte de substitution (placeholder) moins visible */
.form-control::placeholder {
    color: #adb5bd; /* Couleur Bootstrap par défaut pour les placeholders */
    opacity: 0.7; /* Réduit l'opacité pour le rendre plus subtil */
}

[data-bs-theme="dark"] .form-control::placeholder {
    opacity: 0.5; /* Encore plus subtil en mode sombre pour un meilleur contraste */
}
