* {
    font-family: 'Roboto', sans-serif;
}
/* 🌙 Dark Mode (par défaut) */
body {
    background-color: #1c1c1c;
    color: #f5f5f5; /* texte global clair */
    transition: background-color 0.5s ease, color 0.5s ease; /* transition douce */
}

/* 🌞 Light Mode */
body.light-mode {
    background-color: #f8f9fa;
    color: #212529; /* texte global foncé */
}

/* --- SIDEBAR --- */
.sidebar {
    background: #2b2b2b;
    color: #f5f5f5;
    transition: background-color 0.5s ease, color 0.5s ease;
}

body.light-mode .sidebar {
    background: #f1f3f5;
    border-right: 1px solid #ddd;
    color: #212529;
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

/* Texte “Aucune commande trouvée” */
.no-command-message {
    color: #ccc; /* gris clair en dark mode */
    transition: color 0.5s ease; /* transition douce */
}

body.light-mode .no-command-message {
    color: #495057; /* gris foncé en light mode */
}

.breadcrumb-item {
    color: #ccc; /* gris clair en dark mode */
    transition: color 0.5s ease; /* transition douce */
}

body.light-mode .breadcrumb-item {
        color: #495057; /* gris foncé en light mode */

}

/* Liens sidebar */
.sidebar a {
    color: #e0e0e0;
    transition: color 0.5s ease, background 0.5s ease;
}
.sidebar a:hover {
    background: linear-gradient(135deg, #4e73df, #1cc88a);
    color: #fff;
}
.product-name {
    color: #000;
    transition: color 0.5s ease;
}
body.light-mode .sidebar a {
    color: #212529;
}
body.light-mode .sidebar a:hover {
    background: #e9ecef;
    color: #000;
}

/* Sidebar titles (ex: Produits, Commandes) */
.sidebar strong {
    color: #aaa;
    transition: color 0.5s ease;
}
body.light-mode .sidebar strong {
    color: #495057;
}




  /* Navbar toujours au-dessus */
.navbar {
    position: relative;
    z-index: 1200;
}

/* Dropdown fixé par-dessus, ne pousse pas la navbar */
.navbar .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    margin-top: .5rem;
    z-index: 1300;
    animation: fadeIn 0.2s ease-in-out;
}

/* Animation d'apparition du menu */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}


.nav-link.position-relative {
    display: flex;
    align-items: center;
}

.avatar-pulse {
    position: absolute;
    left: 0; /* ajuste selon l'avatar */
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #28a745; /* vert pulsant */
    opacity: 0;
    z-index: 0; /* derrière l'image */
    animation: pulse-slow 4s infinite; /* durée 4s pour pulsation lente */
}

@keyframes pulse-slow {
    0% {
        transform: scale(1);
        opacity: 0;
    }
    10% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(2);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.avatar-img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: bold;
    color: white;
background: linear-gradient(135deg, #ff5f6d, #ffc371);
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}




 /* --- SIDEBAR --- */
    .sidebar {
        position: fixed;
        top: 0;
        left: -250px; /* caché par défaut */
        width: 250px;
        height: 100%;
        background: linear-gradient(180deg, #1c1c1c, #2d2d2d);
        color: white;
        padding-top: 1rem;
        transition: left 0.3s ease-in-out;
        z-index: 9999;
        overflow-y: auto; /* permet le scroll vertical dans le sidebar */
    -webkit-overflow-scrolling: touch; /* effet smooth scroll sur iOS */
    }

    .sidebar.open {
        left: 0; /* s’affiche quand on ajoute la classe "open" */
    }

    .sidebar h4 {
        font-size: 1.25rem;
        font-weight: 700;
        margin-bottom: 2rem;
        text-align: center;
        color: #ffffff;
        letter-spacing: 1px;
    }

    .sidebar strong {
        display: block;
        font-size: 0.85rem;
        padding: 0.2rem;
        text-transform: uppercase;
        text-decoration: underline;
        color: #aaa;
        letter-spacing: 1px;
    }

    .sidebar a {
        color: #e0e0e0;
        display: block;
        padding: 0.7rem 1rem;
        border-radius: 8px;
        margin-bottom: 0.3rem;
        font-size: 0.95rem;
        transition: all 0.2s ease-in-out;
        text-decoration: none;
    }

    .sidebar a:hover {
        background: linear-gradient(135deg, #4e73df, #1cc88a);
        color: #fff;
        transform: translateX(3px);
    }

    .sidebar a.active {
        background: linear-gradient(135deg, #4e73df, #1cc88a);
        color: #fff;
        font-weight: 600;
    }

    
/* Hamburger dans la navbar */
.hamburger {
    cursor: pointer;
    width: 28px;
    height: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.hamburger span {
    display: block;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open span:nth-child(2) {
    opacity: 0;
}
.hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}


    /* Overlay (fond assombri quand menu ouvert) */
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 900;
    }
    .overlay.show {
        display: block;
    }

    /* Desktop : sidebar toujours visible */
    @media(min-width: 992px) {
        .sidebar {
            left: 0;
            position: relative;
        }
        .hamburger, .overlay {
            display: none;
        }
    }


.searchBar {
    border: 2px solid #000;
    border-radius: 0px;
}


/* Dropdown notifications */
#notifMenu {
    width: 380px;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem 0;
    right: 0 !important;
}

/* Notification item */
#notifMenu li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #f1f1f1;
}

#notifMenu li:last-child {
    border-bottom: none;
}

/* Lien de notification */
#notifMenu li a.dropdown-item.notif-link {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #333;
    padding: 0;
    background: none;
    white-space: normal; /* ✅ permet au texte long de revenir à la ligne */
    word-break: break-word;
}

/* Texte principal */
#notifMenu li a .notif-text {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

/* Heure */
#notifMenu li a .notif-time {
    font-size: 0.75rem;
    color: #999;
}

/* Bouton Supprimer */
#notifMenu .notif-delete {
    display: flex;                /* ✅ Permet de centrer le contenu */
    align-items: center;          /* ✅ Centre verticalement la croix */
    justify-content: center;      /* ✅ Centre horizontalement la croix */
    width: 28px;                  /* ✅ Taille fixe du bouton */
    height: 28px;                 /* ✅ Garde une forme carrée */
    background: none;
    border: 1px solid #000;
    border-radius: 15%;           /* ✅ Petit effet bouton rond */
    color: #dc3545;
    font-size: 1.2rem;            /* Ajusté pour bien s’intégrer */
    font-weight: bold;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;               /* ✅ Évite que le texte décale le bouton */
}

#notifMenu .notif-delete:hover {
    background-color: #ffe5e5;
    color: #a71d2a;
    border-color: #a71d2a;
}


/* Header */
#notifMenu li.dropdown-header {
    font-weight: bold;
    text-align: center;
}

/* Divider */
#notifMenu li.dropdown-divider {
    margin: 0.25rem 0;
}

/* Message par défaut */
#notifMenu li.text-center.text-muted {
    font-size: 0.85rem;
    color: #999;
}

/* ✅ Notifications non lues */
#notifMenu .notif-link.fw-bold {
    font-weight: 700;
    background-color: #f8f9fa;
    border-radius: 0.4rem;
}

/* ✅ Notifications lues */
#notifMenu .notif-link:not(.fw-bold) {
    font-weight: 400;
    opacity: 0.9;
}

/* ✅ Responsive - mobile */
@media (max-width: 576px) {
    #notifMenu {
        left: 10% !important;
        transform: translateX(-55%);
        right: auto !important;
    }

    #notifMenu li {
        padding: 0.5rem 0.75rem;
    }

    #notifMenu li a .notif-text {
        font-size: 0.9rem;
    }

    #notifMenu .notif-delete {
        font-size: 1.5rem;
    }
}
