/* /assets/css/style.css */

/* --- CHARTE GRAPHIQUE ET VARIABLES --- */
:root {
    --primary-color: #F97316; /* Orange principal */
    --secondary-color: #FB923C; /* Orange plus clair */
    --dark-color: #111827;      /* Noir charbon */
    --gray-text: #6B7280;     /* Gris texte */
    --light-gray-bg: #F3F4F6; /* Fond de section */
    --white-color: #FFFFFF;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --font-title: 'Poppins', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --border-radius-md: 0.5rem; /* 8px */
    --border-radius-lg: 1rem;  /* 16px */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* --- STYLES GLOBAUX --- */
body {
    font-family: var(--font-body);
    color: var(--dark-color);
    background-color: var(--white-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: 600;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary-light {
    background-color: #FFF7ED; /* Orange très clair pour les fonds */
}


/* --- BOUTONS --- */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #EA580C; /* Orange plus foncé */
    border-color: #EA580C;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
}
.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* --- NAVBAR --- */
.navbar {
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.nav-link {
    font-weight: 500;
    color: var(--dark-color);
}

.nav-link.active {
    color: var(--primary-color) !important;
}


/* --- CARTES (CARDS) --- */
.card {
    border: 1px solid #E5E7EB;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card-title {
    font-family: var(--font-title);
    font-weight: 600;
}

/* --- BADGES --- */
.badge.bg-success { background-color: var(--success-color) !important; }
.badge.bg-warning { background-color: #F59E0B !important; color: var(--dark-color) !important;}
.badge.bg-danger { background-color: var(--danger-color) !important; }
.badge.bg-info { background-color: #3B82F6 !important; }
.badge-matiere {
    background-color: var(--light-gray-bg);
    color: var(--gray-text);
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    border-radius: 99px; /* Pill shape */
}


/* --- SECTIONS --- */
.section {
    padding: 80px 0;
}
.section-bg {
    background-color: var(--light-gray-bg);
}

/* --- FORMULAIRES --- */
.form-control, .form-select {
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(249, 115, 22, 0.25);
}

/* --- SIDEBAR DASHBOARD --- */
.sidebar {
    background-color: var(--dark-color);
    min-height: 100vh;
    padding-top: 1rem;
}
.sidebar .nav-link {
    color: #D1D5DB; /* Gris clair */
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--border-radius-md);
    margin: 0 1rem 0.5rem 1rem;
}

.sidebar .nav-link:hover {
    background-color: #374151; /* Gris un peu plus foncé */
    color: var(--white-color);
}
.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: var(--white-color);
    font-weight: 600;
}
.sidebar-logo {
    color: var(--white-color);
    text-align: center;
    font-size: 1.8rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
    font-weight: 700;
}
.sidebar-logo span {
    color: var(--primary-color);
}

.main-content {
    background-color: var(--light-gray-bg);
    width: 100%;
    min-height: 100vh;
}/* =================================================================== */
/* == STYLES POUR LE MENU LATÉRAL (SIDEBAR) RESPONSIVE == */
/* =================================================================== */

/* --- Variables pour une personnalisation facile --- */
:root {
    --sidebar-width: 260px; /* Largeur du menu latéral sur grand écran */
    --sidebar-bg: #ffffff; /* Couleur de fond du menu */
    --sidebar-logo-color: #212529;
    --sidebar-link-color: #5a6a85;
    --sidebar-link-hover-color: #0d6efd;
    --sidebar-link-active-bg: rgba(13, 110, 253, 0.1);
    --sidebar-box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
}

/* --- Style de base du corps de page --- */
body {
    overflow-x: hidden; /* Empêche le défilement horizontal */
}

/* --- Style du menu latéral (Desktop) --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh; /* Pleine hauteur de l'écran */
    position: fixed; /* Reste en place au défilement */
    top: 0;
    left: 0;
    z-index: 1030; /* Au-dessus du contenu principal */
    background-color: var(--sidebar-bg);
    box-shadow: var(--sidebar-box-shadow);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
}

.sidebar-logo a {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--sidebar-logo-color);
    text-decoration: none;
    margin-bottom: 2rem;
    display: block;
}

.sidebar-logo a span {
    color: var(--sidebar-link-hover-color);
}

.sidebar .nav-link {
    color: var(--sidebar-link-color);
    font-weight: 500;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 0.375rem; /* Bootstrap's .rounded */
    transition: all 0.2s ease-in-out;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    line-height: 1; /* Meilleur alignement vertical */
}

.sidebar .nav-link:hover {
    color: var(--sidebar-link-hover-color);
    background-color: var(--sidebar-link-active-bg);
}

.sidebar .nav-link.active {
    color: var(--sidebar-link-hover-color);
    background-color: var(--sidebar-link-active-bg);
    font-weight: 600;
}

/* Pousse le bouton de déconnexion en bas */
.sidebar .nav-item.mt-auto {
    margin-top: auto !important;
}

/* --- Style du contenu principal --- */
.main-content {
    width: 100%;
    margin-left: var(--sidebar-width); /* Crée un espace pour le menu latéral */
    transition: margin-left 0.3s ease-in-out;
}


/* ========================================== */
/* == STYLES POUR TABLETTES & MOBILES (<992px) == */
/* ========================================== */
@media (max-width: 991.98px) {
    .sidebar {
        /* Par défaut, le menu est caché en dehors de l'écran à gauche */
        transform: translateX(calc(-1 * var(--sidebar-width)));
        box-shadow: var(--sidebar-box-shadow);
    }
    
    /* Classe à ajouter avec JS pour faire apparaître le menu */
    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0; /* Le contenu principal prend toute la largeur */
    }

    /* Le d-none de Bootstrap doit être surchargé */
    .sidebar.d-none.d-lg-block {
        display: flex !important;
    }
}


/* --- Bouton "Hamburger" (visible uniquement sur mobile) --- */
#sidebar-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1020; /* En dessous du menu, mais au-dessus du contenu */
    border: none;
}

/* --- Overlay (visible uniquement quand le menu est ouvert sur mobile) --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1029; /* Juste en dessous du menu */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}