/**
 * Pointage Express
 * Feuille de style principale
 */

/* Variables globales avec les couleurs du logo */
:root {
    --primary: #2B5797;  /* Bleu du logo */
    --primary-dark: #1E3F6F;  /* Version plus foncée du bleu */
    --secondary: #404040;  /* Gris foncé/noir pour le "X" */
    --accent: #44729B;  /* Bleu clair pour le "p" */
    --success: #28a745;  /* Vert pour les succès */
    --danger: #dc3545;  /* Rouge pour les erreurs */
    --warning: #ffc107;  /* Jaune pour les avertissements */
    --info: #17a2b8;  /* Cyan pour les informations */
    --light: #f8f9fa;  /* Gris clair pour les fonds */
    --dark: #343a40;  /* Gris foncé pour les textes */
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
    --header-height: 60px;
    --footer-height: 50px;
    --border-radius: 0.25rem;
    --transition-speed: 0.3s;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Styles généraux */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fb;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--primary-dark);
}

/* Structure principale */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    align-items: stretch;
}

#content {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: all var(--transition-speed);
}

/* Sidebar */
.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--primary);
    color: #fff;
    transition: all var(--transition-speed);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.active {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar .sidebar-header {
    padding: 15px;
    background: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar .sidebar-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #fff;
}

.sidebar .sidebar-header button {
    color: #fff;
    padding: 0;
}

.sidebar ul.components {
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #4a4a4a;
}

.sidebar ul li {
    position: relative;
}

.sidebar ul li a {
    padding: 12px 15px;
    display: block;
    color: #fff;
    text-decoration: none;
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
}

.sidebar ul li a:hover,
.sidebar ul li.active > a {
    background: var(--secondary);
    color: #fff;
    border-left: 3px solid var(--accent);
}

.sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar ul.collapse {
    background: rgba(0, 0, 0, 0.1);
    margin-left: 0;
    padding-left: 0;
}

.sidebar ul.collapse li a {
    padding-left: 40px;
}

.sidebar a[data-bs-toggle="collapse"] {
    position: relative;
}

.sidebar .dropdown-toggle::after {
    display: block;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

.sidebar .user-info {
    padding: 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.sidebar .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.sidebar .user-details {
    flex: 1;
}

.sidebar .user-name {
    margin: 0;
    font-weight: 600;
    font-size: 0.9rem;
}

.sidebar .user-role,
.sidebar .client-name {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar .sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    bottom: 0;
    width: 100%;
}

/* Navbar */
.navbar {
    padding: 0 15px;
    background: #fff !important;
    border-bottom: 1px solid #eaecef;
    height: var(--header-height);
    box-shadow: var(--box-shadow);
}

.navbar .navbar-brand {
    font-weight: 600;
}

.navbar-light .navbar-nav .nav-link {
    color: #555;
}

.navbar-light .navbar-nav .nav-link:hover {
    color: var(--primary);
}

/* Contenu principal */
#content > .container-fluid {
    flex: 1;
    padding: 20px;
}

/* Tableaux */
.table {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.table th {
    background-color: var(--light);
    font-weight: 600;
}

.table td, .table th {
    vertical-align: middle;
}

/* Cartes */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eaecef;
    font-weight: 600;
    padding: 15px;
}

.card-footer {
    background-color: #fff;
    border-top: 1px solid #eaecef;
    padding: 10px 15px;
}

/* Formulaires */
.form-label {
    font-weight: 500;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(43, 87, 151, 0.25);
}

.input-group-text {
    background-color: var(--light);
    border-color: #ced4da;
}

/* Boutons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(43, 87, 151, 0.25);
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

.btn-accent {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-accent:hover {
    background-color: #365b7d;
    border-color: #365b7d;
    color: white;
}

/* Alertes */
.alert {
    border: none;
    box-shadow: var(--box-shadow);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 5px 8px;
}

/* QR Code */
.qr-container {
    background-color: #fff;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
}

#qr-reader {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Responsivité */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    #content {
        width: 100%;
        margin-left: 0;
    }
    
    #content.active {
        margin-left: var(--sidebar-width);
    }
    
    /* Overlay quand sidebar est actif sur mobile */
    #content.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        pointer-events: none;
    }
}

/* Page de login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f7fb;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    height: 80px;
}

/* Dashboard */
.dashboard .card {
    transition: transform var(--transition-speed);
}

.dashboard .card:hover {
    transform: translateY(-5px);
}

/* Notifications */
.dropdown-menu {
    padding: 0;
    overflow: hidden;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    padding: 10px 15px;
    border-bottom: 1px solid #eaecef;
}

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

.dropdown-item.active, .dropdown-item:active {
    background-color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 3px 5px;
    border-radius: 50%;
    font-size: 0.6rem;
}

/* Style pour le profil utilisateur */
.profile-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 30px 20px;
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 5px solid rgba(255, 255, 255, 0.5);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar i {
    font-size: 50px;
    color: var(--primary);
}

.profile-info {
    padding: 20px;
}

.profile-info h5 {
    font-weight: 600;
    margin-bottom: 5px;
}

.profile-info p {
    margin-bottom: 15px;
    color: var(--secondary);
}

/* Footer */
footer {
    background: #fff;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--secondary);
    border-top: 1px solid #eaecef;
}

/* Utilitaires */
.cursor-pointer {
    cursor: pointer;
}

.min-h-500 {
    min-height: 500px;
}

/* Animation de chargement */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}