/* Styles communs pour PayShare */

/* Variables */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
    --sidebar-width: 250px;
    --header-height: 60px;
}

/* Styles généraux */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

body.with-sidebar {
    padding-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-height: 100vh; /* Assure que le corps occupe au moins toute la hauteur de la fenêtre */
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--dark-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header h1 {
    margin: 0;
    font-size: 24px;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info {
    margin-right: 15px;
    font-weight: 500;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background-color: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 900;
    overflow-y: auto;
    padding-top: 10px; /* Ajout d'un padding en haut pour éviter le chevauchement */
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    border-left: 4px solid transparent;
}

.sidebar-menu li:hover {
    background-color: #f5f5f5;
}

.sidebar-menu li.active {
    background-color: #edf7ff;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* Contenu principal */
.content {
    padding: 20px;
    margin-top: 20px; /* Réduit pour éviter trop d'espace */
    margin-left: 0; /* Supprimé car body.with-sidebar a déjà un padding-left */
    width: calc(100% - 40px); /* Ajusté pour tenir compte du padding */
    box-sizing: border-box;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.content-header h2 {
    margin: 0;
}

/* Stats container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    margin-top: 20px; /* Ajout d'une marge supplémentaire pour les statistiques */
}

.stat-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h2 {
    margin: 0;
    font-size: 32px;
    color: var(--primary-color);
}

.stat-card p {
    margin: 10px 0 0;
    color: var(--gray-color);
}

/* Cartes */
.card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--dark-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Tableaux */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    background-color: #f9f9f9;
    font-weight: 500;
}

table tr:hover {
    background-color: #f5f5f5;
}

/* Boutons */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

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

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

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

.btn-success:hover {
    background-color: #27ae60;
}

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

.btn-danger:hover {
    background-color: #c0392b;
}

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

.btn-warning:hover {
    background-color: #e67e22;
}

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

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

/* Formulaires */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-check {
    display: flex;
    align-items: center;
}

.form-check-input {
    margin-right: 10px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 0;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal form {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    text-align: right;
    border-top: 1px solid #eee;
}

.modal-footer button {
    margin-left: 10px;
}

/* Alertes */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: var(--gray-color);
    border-top: 1px solid #eee;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-menu li span {
        display: none;
    }
    
    body.with-sidebar {
        padding-left: 60px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
    }
}

/* Styles pour la page de connexion et d'inscription */
.login-container, .register-container {
    max-width: 400px;
    width: 100%;
    padding: 15px;
    margin: 0 auto;
}

.login-container .card, .register-container .card {
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.login-container .card-header, .register-container .card-header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    border-radius: 10px 10px 0 0 !important;
    padding: 20px;
}

.login-container .btn-primary, .register-container .btn-primary {
    width: 100%;
}

/* Styles pour les boutons d'action dans les tableaux */
.action-buttons {
    display: flex;
    gap: 5px;
}

.action-btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* Styles pour les filtres */
.filters-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

/* Styles pour les détails */
.details-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.detail-item {
    margin-bottom: 15px;
}

.detail-label {
    font-weight: 500;
    color: var(--gray-color);
}

.detail-value {
    font-size: 16px;
}

/* Styles pour les onglets */
.tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Styles pour les badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-info {
    background-color: var(--info-color);
    color: white;
}

/* Styles pour les fiches de paie */
.payslip-container {
    background-color: white;
    padding: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.payslip-header {
    text-align: center;
    margin-bottom: 30px;
}

.payslip-company {
    margin-bottom: 20px;
}

.payslip-employee {
    margin-bottom: 20px;
}

.payslip-details {
    margin-bottom: 30px;
}

.payslip-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.payslip-table th, .payslip-table td {
    padding: 10px;
    border: 1px solid #ddd;
}

.payslip-table th {
    background-color: #f9f9f9;
}

.payslip-totals {
    margin-top: 20px;
    text-align: right;
}

.payslip-footer {
    margin-top: 30px;
    font-size: 12px;
    color: var(--gray-color);
    text-align: center;
}

/* Fix pour éviter le chevauchement du contenu par la sidebar */
body.with-sidebar .content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width) - 40px); /* Ajusté pour tenir compte du padding */
}

@media (max-width: 768px) {
    body.with-sidebar .content {
        margin-left: 60px;
        width: calc(100% - 60px - 40px);
    }
}

/* Assurer que les modals sont au-dessus de tout */
.modal {
    z-index: 1200;
}

/* Assurer que les formulaires dans les modals sont correctement affichés */
.modal-content {
    overflow: visible;
}
