@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Nata+Sans:wght@100..900&display=swap');

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #1abc9c;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
}

body {
    font-family: "Nata Sans", sans-serif;
    background-color: #f5f7fa;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    background: linear-gradient(135deg, #2c3e50 0%, #1a2530 100%);
    color: white;
    height: 100vh;
    position: fixed;
    width: 280px;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s;
    top: 0;
    left: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    width: 200px;
    height: 50px;
    object-fit: contain;
}

.sidebar-search {
    padding: 0 20px;
    margin: 10px 0;
}

.sidebar-search .input-group-text {
    background-color: white;
    border-right: none;
    border-radius: 5px 0 0 5px !important;
}

.sidebar-search .form-control {
    border-left: none;
    border-radius: 0 5px 5px 0 !important;
}

.sidebar-menu-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sidebarClose {
    font-size: 1.25rem;
    opacity: 0.7;
    transition: all 0.3s;
}

#sidebarClose:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.sidebar-header .d-flex {
    width: 100%;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
    background-color: rgba(52, 152, 219, 0.2);
    color: white;
    border-left-color: var(--primary-color);
}

.menu-icon {
    width: 24px;
    text-align: center;
    margin-right: 12px;
    font-size: 16px;
}

.menu-text {
    flex: 1;
    font-weight: 500;
}

.menu-arrow {
    transition: transform 0.3s;
    font-size: 12px;
    opacity: 0.6;
}

.menu-badge {
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 10px;
    margin-left: 10px;
    font-weight: bold;
}

.submenu {
    list-style: none;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.submenu-item {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 50px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
    position: relative;
}

.submenu-item:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
    padding-left: 55px;
}

.submenu-item i {
    margin-right: 10px;
    font-size: 8px;
}

.submenu-item.active {
    color: var(--primary-color);
}

.menu-section.active .menu-arrow {
    transform: rotate(90deg);
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.user-role {
    font-size: 12px;
    opacity: 0.7;
}

.logout-btn {
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s;
    padding: 5px;
}

.logout-btn:hover {
    color: white;
    transform: rotate(180deg);
}

/* Main Content Styles */
.main-content {
    margin-left: 280px;
    padding: 20px;
    transition: all 0.3s;
    min-height: 100vh; /* Assure que le contenu a une hauteur minimale */
}

/* Navbar Fixe - Modifications principales */
.navbar {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    position: fixed; /* Reste fixe */
    top: 0; /* Collé en haut */
    left: 280px; /* Décalé de la largeur de la sidebar */
    width: calc(100% - 280px); /* Largeur calculée */
    z-index: 999; /* z-index élevé mais inférieur à la sidebar */
    transition: all 0.3s ease;
    backdrop-filter: blur(10px); /* Effet de flou pour un rendu moderne */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.content-wrapper {
    padding-top: 80px; /* Espace pour la navbar fixe */
    position: relative;
}

/* Cards */
.card {
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: none;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0 !important;
}

.stat-card {
    text-align: center;
    padding: 20px;
    color: white;
    border-radius: 10px;
}

.stat-card i {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.stat-card .count {
    font-size: 2rem;
    font-weight: bold;
}

.stat-card .label {
    font-size: 1rem;
    opacity: 0.8;
}

/* Tables */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: var(--light-color);
    border-top: none;
}

/* Badges */
.badge-status {
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-active {
    background-color: rgba(46, 204, 113, 0.2);
    color: var(--success-color);
}

.badge-inactive {
    background-color: rgba(231, 76, 60, 0.2);
    color: var(--danger-color);
}

.badge-declaree {
    background-color: rgba(241, 196, 15, 0.2);
    color: var(--warning-color);
}

.badge-en_maintenance {
    background-color: rgba(52, 152, 219, 0.2);
    color: var(--primary-color);
}

.badge-resolue {
    background-color: rgba(46, 204, 113, 0.2);
    color: var(--success-color);
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 20px;
}

.blurred {
    filter: blur(4px);
    transition: filter 0.3s ease;
    pointer-events: none; /* empêche de cliquer derrière le menu */
}

/* Responsive - Modifications pour mobile */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .navbar {
        width: 100%;
        left: 0; /* Navbar prend toute la largeur sur mobile */
        margin-left: 0;
    }
    
    /* Ajustement quand la sidebar est ouverte sur mobile */
    .sidebar.active ~ .main-content .navbar {
        left: 280px;
        width: calc(100% - 280px);
    }
}

/* Animation */
.collapsing {
    position: relative;
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease;
}

/* Amélioration supplémentaire : effet de scroll smooth */
html {
    scroll-behavior: smooth;
}