/* PMP Experts - Custom Styles */

/* Palette de couleurs cohérente */
:root {
    --pmp-primary: #0066cc;
    --pmp-secondary: #4a5568;
    --pmp-accent: #f59e0b;
    --pmp-success: #10b981;
    --pmp-danger: #ef4444;
    --pmp-light: #f8fafc;
    --pmp-dark: #1e293b;
}

/* Cards avec effet hover moderne */
.card {
    transition: all 0.3s ease;
    border: none;
    background-color: white !important;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    background-color: white !important;
}

/* Navbar plus moderne */
.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Boutons améliorés */
.btn {
    border-radius: 6px;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Boutons d'actions dans tableaux */
.btn-sm {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    margin: 0 2px;
    display: inline-block;
    min-width: 32px;
}

.btn-group .btn {
    margin: 0 2px;
}

/* Colonne actions - boutons en ligne */
.text-nowrap {
    white-space: nowrap !important;
}

td.text-nowrap .btn {
    margin: 0 2px;
}

/* Force les boutons d'actions sur une ligne */
table td:last-child {
    white-space: nowrap !important;
}

table td:last-child .btn {
    display: inline-block !important;
    margin: 0 2px !important;
    vertical-align: middle;
    padding: 0.35rem 0.5rem !important;
    font-size: 0.8rem !important;
    min-width: 32px;
}

table td:last-child .btn i {
    font-size: 0.9rem;
}

table td:last-child a {
    display: inline-block !important;
}

/* Tables DataTables plus modernes */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th,
table.dataTable thead th,
#clients-table thead th {
    background: #0d6efd !important;
    color: white !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border: none !important;
    padding: 1.2rem 1rem;
}

.table tbody tr {
    transition: all 0.2s ease;
    background-color: white;
}

.table tbody tr:hover {
    background-color: white !important;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table td {
    vertical-align: middle;
    padding: 1.1rem 1rem;
}

/* DataTables wrapper styling */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin: 0;
    padding: 0;
}

.dataTables_wrapper .dataTables_length {
    float: left;
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
}

.dataTables_wrapper .dataTables_filter {
    float: right;
    display: flex;
    align-items: center;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    font-weight: 600;
    color: #2d3748;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    line-height: 1;
    font-size: 1rem;
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    background-color: #ffffff;
    margin: 0;
    height: 44px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dataTables_wrapper .dataTables_length select {
    width: 90px;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    text-align: center;
}

.dataTables_wrapper .dataTables_filter input {
    width: 300px;
    margin: 0;
    font-weight: 400;
}

.dataTables_wrapper .dataTables_filter input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    background-color: #f8fafc;
}

.dataTables_wrapper .dataTables_length select:hover,
.dataTables_wrapper .dataTables_filter input:hover {
    border-color: #a0aec0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Conteneur des contrôles DataTables */
.dataTables_wrapper .row:first-child {
    background: white;
    padding: 2rem 2.5rem;
    border-radius: 0;
    margin: 0 0 2rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: none;
    border-bottom: 1px solid #e2e8f0;
}

.dataTables_wrapper .row:first-child > div {
    display: flex;
    align-items: center;
}

.dataTables_wrapper .row:first-child::after {
    content: "";
    display: table;
    clear: both;
}

/* Amélioration visuelle de la zone */
.card-body.bg-light {
    background-color: #f8fafc !important;
    padding: 0 !important;
}

.card-body .table-responsive {
    background: white;
    border-radius: 0;
    padding: 0;
}

/* Espacement entre header et tableau */
.card-header {
    margin-bottom: 0;
}

.table {
    margin-bottom: 0;
}

/* Home page cards styling */
.home-card {
    border: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: white !important;
}

.home-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    background: white !important;
}

.home-card .card-body {
    padding: 2rem;
}

.home-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.home-card:hover i {
    transform: scale(1.1) rotate(5deg);
}

/* Badges modernisés */
.badge {
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-weight: 500;
}

/* Formulaires améliorés */
.form-control,
.form-select {
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.7rem 1rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

/* Espacement des formulaires */
.card-body form {
    padding: 2.5rem 3rem;
}

.card-body fieldset {
    margin-bottom: 2rem;
}

.card-body .row {
    margin-bottom: 1.5rem;
}

.card-body .col-md-4,
.card-body .col-md-6,
.card-body .col-md-12 {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Boutons de formulaire */
.card-body .btn {
    padding: 0.7rem 2rem;
    font-size: 1rem;
    margin: 0.5rem;
}

.card-body .text-end {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

/* Headers de pages */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}

.card-header {
    border-radius: 12px 12px 0 0;
}

/* Fieldsets dans formulaires */
fieldset {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    background-color: #fafbfc;
}

fieldset legend {
    font-weight: 700;
    color: #0d6efd;
    padding: 0 1rem;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Sections de formulaire */
.card-body > fieldset:first-of-type {
    margin-top: 0;
}

.card-body > fieldset:last-of-type {
    margin-bottom: 0;
}

/* Alerts/Messages */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1fae5;
    border-left-color: var(--pmp-success);
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    border-left-color: var(--pmp-danger);
    color: #991b1b;
}

.alert-info {
    background-color: #dbeafe;
    border-left-color: var(--pmp-primary);
    color: #1e40af;
}

/* Pagination améliorée */
.dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    margin: 0 2px;
    padding: 0.4rem 0.8rem !important;
}

.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate span .paginate_button.current {
    background: #0d6efd !important;
    background-color: #0d6efd !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3) !important;
}

/* Force le texte en blanc - plus spécifique */
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:active,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:focus {
    color: #ffffff !important;
}

/* Zone info et pagination en bas */
.dataTables_wrapper .dataTables_info {
    font-weight: 500;
    color: #4a5568;
    padding: 1.5rem 2.5rem;
}

.dataTables_wrapper .dataTables_paginate {
    padding: 1.5rem 2.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .table {
        font-size: 0.85rem;
    }
    
    .btn-group .btn {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .home-card i {
        font-size: 2rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.table tbody tr {
    animation: fadeIn 0.5s ease-out;
}

/* Stats cards pour dashboard */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.3);
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}
