/* Dashboard Modern Styles */
:root {
    --primary-color: #10B981;
    --primary-hover: #EFFAF7;
    --secondary-color: #EFFBF7;
    --third-color: #F8F8F0;
    --primary-hoverTxt: #330000;
    --success-color: #10b981;
    --info-color: #0ea5e9;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-color: #f9fafb;
    --dark-color: #111827;
    --gray-color: #9ca3af;
    --sidebar-colorLinks: #330000;
    --sidebar-width: 260px;
    --dashboard-bg-users: #10B981;
    --dashboard-bg-slots: #10B981;
    --dashboard-bg-appointments: #10B981;
    --dashboard-bg-statuses: #10B981;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition-speed: 0.3s;
    --border-radius: 0.75rem;
    --font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Ajout des variables pour la page de connexion */
    --primary-light: rgba(16, 185, 129, 0.1);
    --primary-dark: #0E9F6E;
    --dark-bg: #1A1F2C;
    --text-color: #374151;
    --text-light: #6B7280;
    --border-color: #E5E7EB;
	/* Badge ADMIN (Vert émeraude) */
	  --badge-admin-color: #10B981;
	  --badge-admin-color-light: #34D399;   /* Vert plus clair */
	  --badge-admin-color-dark: #059669;    /* Vert plus foncé */

	  /* Badge MANAGER (Orange doré) */
	  --badge-manager-color: #F59E0B;
	  --badge-manager-color-light: #FBBF24;
	  --badge-manager-color-dark: #D97706;

	  /* BadgeGESTIONNAIRE (Bleu clair) */
	  --badge-gestionnaire-color: #3B82F6;
	  --badge-gestionnaire-color-light: #60A5FA;
	  --badge-gestionnaire-color-dark: #2563EB;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--third-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar-transparent {
    padding: 0.5rem 1rem;
}

/* Bouton hamburger pour la sidebar */
.sidebar-toggler {
    border: 1px solid var(--primary-color);
    padding: 0.5rem 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.5rem;
    font-size: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed);
}

.sidebar-toggler:hover {
    background-color: var(--primary-hover);
    color: var(--primary-color);
}

/* Désactiver l'icône par défaut de Bootstrap */
.navbar-toggler-icon {
    display: none;
}

/* Bouton hamburger flottant pour mobile */
.floating-burger {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1040;
    background-color: var(--primary-color);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.floating-burger:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
    color: white;
}

.floating-burger:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Bouton fermer dans la sidebar */
.close-sidebar {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: transparent;
    border: none;
    color: var(--gray-color);
    font-size: 20px;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.close-sidebar:hover {
    background-color: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

.close-sidebar:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Icône utilisateur */
.user-toggle {
    color: var(--dark-color);
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all var(--transition-speed);
}

.user-toggle:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Menu utilisateur */
.user-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 1rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    z-index: 1050;
    min-width: 200px;
}

.user-menu .nav-link {
    color: var(--dark-color);
    padding: 0.5rem 0.75rem;
    display: block;
}

.user-menu .nav-link.text-danger {
    color: var(--danger-color) !important;
}

.user-menu .nav-link:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

/* Section utilisateur dans le menu */
.user-info {
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius);
    border: 1px solid rgba(229, 231, 235, 0.5);
    padding: 0.5rem 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-speed);
    margin-bottom: 0.5rem;
}

.user-info:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.user-details {
    flex: 1;
}

.user-details h6 {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
    color: var(--dark-color);
}

.user-details small {
    font-size: 0.75rem;
    opacity: 0.85;
}

/* Sidebar Styling */
.sidebar {  
    background-color: var(--secondary-color) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border-right: 1px solid rgba(229, 231, 235, 0.5);
    padding-top: 1rem;
    height: 100vh;
    position: fixed;
    top: 0;
    width: var(--sidebar-width);
    overflow-y: auto;
    transition: transform var(--transition-speed);
    z-index: 1030;
    padding: 20px;
}

.sidebar .nav-link {
    color: var(--primary-color);
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: var(--primary-hover);
}

.dashboard-bg-users {
    color: var(--primary-color) !important;	
    background-color: var(--primary-color) !important;
}
.dashboard-bg-slots {
    color: var(--primary-color) !important;	
    background-color: var(--primary-color) !important;
}
.dashboard-bg-appointments {
    color: var(--primary-color) !important;	
    background-color: var(--primary-color) !important;
}
.dashboard-bg-statuses {
    color: var(--primary-color) !important;	
    background-color: var(--primary-color) !important;
}

.sidebar .nav-link i {
    width: 20px;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-item.active {
    background-color: var(--primary-color);
    color: var(--primary-hoverTxt);
    background-color: #0d6efd;
    color: white;
}

.nav-link {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--sidebar-colorLinks);
    font-weight: 500;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
}

.nav-link:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: var(--primary-hoverTxt);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.nav-link.text-danger {
    color: var(--danger-color) !important;
}

.nav-link.text-danger:hover {
    background-color: #fee2e2;
}

.nav-link i {
    width: 1.25rem;
    text-align: center;
    margin-right: 0.75rem;
    opacity: 0.85;
}

.sidebar-logo {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

/* Style pour les sous-items */
.subitems {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    transition: all var(--transition-speed) ease;
}

.subitem .nav-link {
    padding-left: 2.5rem; /* Indentation des sous-items */
    font-size: 0.95rem;
}

.subitem .nav-link i {
    margin-right: 0.5rem;
}

/* Style pour les en-têtes de section dans l'administration */
.subitem.section-header {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    border-top: 1px solid rgba(16, 185, 129, 0.2);
    padding-top: 0.5rem;
}

.subitem.section-header:first-child {
    margin-top: 0.5rem;
    border-top: none;
    padding-top: 0;
}

.subitem.section-header span.nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: transparent !important;
    cursor: default;
    pointer-events: none;
}

/* Style pour les items indentés sous les sections */
.subitem.indented .nav-link {
    padding-left: 3rem; /* Plus d'indentation pour les items sous les sections */
    font-size: 0.9rem;
    color: var(--text-color);
}

.subitem.indented .nav-link:hover {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
}

.nav-link.has-subitems {
    cursor: pointer;
}

.nav-link .toggle-icon {
    transition: transform var(--transition-speed);
}

.nav-link.active .toggle-icon.fa-chevron-down {
    transform: rotate(180deg);
}

/* Main Content */
main {
    padding: 1.5rem;
    transition: all var(--transition-speed);
}

.content {
    padding: 20px;
}

/* Overlay pour mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1020;
    transition: opacity var(--transition-speed);
    opacity: 0;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Media Queries */
@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
    }
    .sidebar-toggler {
        display: none !important;
    }
    .sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        width: 100%;
        max-width: 260px;
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-toggler {
        display: inline-block !important;
    }
    main {
        margin-left: 0 !important;
    }
    .stat-value {
        font-size: 2rem;
    }
    .stat-icon {
        font-size: 2rem;
    }
    .chart-container {
        min-height: 250px;
    }
    .card {
        margin-bottom: 1rem;
    }
    .user-menu {
        right: 0.5rem;
        min-width: 180px;
    }
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.display-4 {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.display-6 {
    font-weight: 700;
    font-size: 1.5rem;
}

.card small {
    opacity: 0.85;
}

/* Color Overrides */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-info {
    background-color: var(--info-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

.text-white {
    color: white !important;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.625rem 1.25rem;
    transition: all var(--transition-speed);
}

.btn-lg {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    border-radius: 0.5rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
}

.btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: #475569;
    border-bottom-width: 1px;
    border-bottom-color: rgba(229, 231, 235, 0.8);
    padding: 0.75rem 1rem;
}

.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    color: #334155;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #fafafa;
}

.table-hover tbody tr:hover {
    background-color: #f1f5f9;
}

/* Badges */
.badge {
    font-size: 14px;
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    border: none;
}

.alert-info {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Dropdowns */
.dropdown-menu {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
}

.dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

/* Filter spacing */
.gap-2 {
    gap: 0.5rem !important;
}

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

/* Statistics Page Specific Styles */
.stat-card {
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white !important;
    border: 1px solid rgba(229, 231, 235, 0.5);
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.stat-icon .fas {
    background: linear-gradient(135deg, currentColor 0%, rgba(255,255,255,0.6) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #1e293b;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    line-height: 1.2;
}

.stat-title {
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 5px;
}

.chart-container {
    min-height: 300px;
    border-radius: 0.5rem;
    overflow: hidden;
    padding: 0.75rem;
}

.period-selector {
    border-radius: var(--border-radius);
    background: white !important;
    border: 1px solid rgba(229, 231, 235, 0.5);
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.period-selector .card-title {
    color: #1e293b;
    font-weight: 600;
    font-size: 1.15rem;
}

.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.5rem;
}

.form-control {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Date picker and flatpickr styling */
.flatpickr-calendar {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: none;
}

.flatpickr-day.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.flatpickr-day.selected:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.flatpickr-day:hover {
    background: #f1f5f9;
}

/* ApexCharts customization */
.apexcharts-tooltip {
    border-radius: 0.5rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    border: none !important;
}

.apexcharts-tooltip-title {
    background-color: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    font-weight: 600 !important;
}

.apexcharts-xaxistooltip {
    border-radius: 0.375rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #e2e8f0 !important;
}

.apexcharts-menu {
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
}

.apexcharts-menu-item:hover {
    background-color: #f1f5f9 !important;
}

/* Better row spacing for statistics page */
.row.g-4 {
    margin-bottom: 1.5rem;
}

/* Better hover effect for buttons */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Improve period presets dropdown */
.dropdown-item.period-preset {
    display: flex;
    align-items: center;
}

.dropdown-item.period-preset:before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    margin-right: 0.5rem;
    opacity: 0.7;
}

.dropdown-item.period-preset:hover:before {
    opacity: 1;
}

/* Styles pour la page de connexion */
.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--text-light) !important;
}

.footer {
    background-color: #fff;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-link {
    color: var(--text-light);
    text-decoration: none;
    display: block;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-color);
}

/* Style pour le logo sous la boîte de connexion */
.login-logo {
    max-width: 150px;
    height: auto;
    animation: fadeIn 0.5s ease-out;
}

/* Ajustement de la login-card */
.login-card {
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2.5rem;
    max-width: 450px; /* Taille par défaut pour desktop */
    width: 100%;
}

.login-section {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* Media Queries pour la responsivité */
@media (max-width: 576px) {
    .login-card {
        max-width: 100%; /* Prend toute la largeur sur mobile */
        padding: 1.5rem; /* Réduit le padding sur mobile */
        margin: 0 1rem; /* Ajoute une marge latérale pour éviter de coller aux bords */
    }

    .login-logo {
        max-width: 120px; /* Réduit la taille du logo sur mobile */
    }

    .login-section {
        padding: 1rem; /* Réduit le padding de la section sur mobile */
    }

    .form-control,
    .input-group-text {
        font-size: 0.875rem; /* Réduit la taille de la police des champs sur mobile */
    }

    .btn {
        padding: 0.5rem 1rem; /* Réduit le padding du bouton sur mobile */
        font-size: 0.875rem; /* Réduit la taille de la police du bouton */
    }

    .footer {
        padding: 1rem 0; /* Réduit le padding du footer sur mobile */
    }

    .footer p {
        font-size: 0.75rem; /* Réduit la taille de la police du footer */
    }
}