:root {
    --primary-color: #2c5f2d;
    --secondary-color: #2c5f2d;
    --light-color: #f5f5f5;
    --dark-color: #333;
    --accent-color: #e74c3c;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: var(--dark-color);
    margin: 0;
    padding: 0;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background-color: #2c5f2d;
    color: white;
    padding-top: 20px;
    transition: transform 0.3s ease;
    z-index: 1000;
    transform: translateX(0);
}

.sidebar.closed {
    transform: translateX(-250px);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 5px;
    margin-bottom: 5px;
    text-decoration: none;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar .text-center img {
    width: 80px;
    height: auto;
    border-radius: 5px;
    padding: 5px;
    cursor: pointer;
}

.sidebar .text-center a {
    text-decoration: none;
    display: inline-block;
}

.sidebar .text-center {
    background-color: #f5f5f5;
    padding: 10px !important;
}

.main-content {
    padding: 30px 20px 20px 20px !important;
    transition: margin-left 0.3s ease;
    width: 100%;
}

/* Supprimer les anciennes règles pour .main-content.active */
/* Ajouter un overlay pour mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Styles pour la sidebar mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-250px);
        width: 280px; /* plus large en mobile */
        box-shadow: 3px 0 15px rgba(0, 0, 0, 0.2);
    }

    /* Quand la sidebar est ouverte en mobile */
    .sidebar:not(.closed) {
        transform: translateX(0);
    }

    /* Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        transition: opacity 0.3s ease;
        opacity: 0;
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
}

.search-highlight {
    background-color: yellow;
    padding: 2px 0;
    border-radius: 3px;
}
.search-result-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1001;
    transition: left 0.3s ease;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 20px;
    background-color: white;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
    border-radius: 10px 10px 0 0 !important;
    padding: 15px 20px;
}

.stat-card {
    text-align: center;
    padding: 20px;
    border: none !important;
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-card .count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
}

.stat-card .label {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 5px;
}

.book-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 5px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

.progress {
    height: 10px;
    border-radius: 5px;
    background-color: #f0f0f0;
}

.progress-bar {
    background-color: var(--primary-color);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}
/* État "fermée" pour grand écran */
.sidebar.closed {
    margin-left: -250px;
}
.main-content.closed {
    margin-left: 0;
}

/* @media (max-width: 768px) {
    .toggle-sidebar {
        display: block;
    }
} */

.search-box {
    flex: 1 1 auto;
    max-width: 500px;
    display: flex;
    align-items: center;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 10px;
    color: #7f8c8d;
}

.search-box input {
    flex: 1;
    padding: 5px 10px 5px 30px;
    border-radius: 5px;
    border: 1px solid #ccc;
    width: 100%;
}
.badge-custom {
    background-color: var(--accent-color);
    color: white;
    font-size: 0.6rem;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
}

.recent-activity-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.recent-activity-item:last-child {
    border-bottom: none;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 10px 0;
    margin-top: 5px;
    z-index: 1050; /* Ensure it appears above other elements */
}

.dropdown-item {
    padding: 8px 15px;
    border-radius: 5px;
    margin: 0 5px;
    width: auto;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: var(--primary-color);
}

/* Ajout pour le menu déroulant utilisateur */
.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.sort-dropdown .dropdown-menu {
    position: absolute;
    top: 100%; /* Ensure it appears below the trigger button */
    left: 0;
    z-index: 1050; /* Ensure it appears above other elements */
    margin-top: 0.5rem; /* Add spacing below the trigger button */
}