/* Formations CSS */
.formations-container {
    padding: 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.page-header h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 2rem;
}

/* Statistiques des formations */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Table des formations */
.table-responsive {
    overflow-x: auto;
    margin-top: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table .actions {
    width: 120px;
    text-align: center;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

.badge-level-debutant {
    background-color: #28a745;
    color: white;
}

.badge-level-intermediaire {
    background-color: #ffc107;
    color: #212529;
}

.badge-level-avance {
    background-color: #dc3545;
    color: white;
}

.badge-status-planifie {
    background-color: #6c757d;
    color: white;
}

.badge-status-en_cours {
    background-color: #007bff;
    color: white;
}

.badge-status-termine {
    background-color: #28a745;
    color: white;
}

.badge-status-annule {
    background-color: #dc3545;
    color: white;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

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

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    margin: 0 2px;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

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

.btn-danger {
    background-color: #dc3545;
    color: white;
}

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

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

/* Date range styling */
.date-range {
    white-space: nowrap;
}

.date-range i {
    color: #007bff;
    margin-right: 5px;
}

.text-muted {
    color: #6c757d !important;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 1rem 0;
    color: #495057;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-content h3 {
    margin-top: 0;
    color: #dc3545;
}

.modal-content i {
    color: #dc3545;
    margin-right: 0.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Notifications */
.notification {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.close-notification {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.close-notification:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.5rem;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }
    
    .table th,
    .table td {
        padding: 0.3rem;
        font-size: 0.8rem;
    }
    
    .btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
}

/* ============================================
   Styles supplémentaires depuis formations_view.php
   ============================================ */

/* Vue cartes formations */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.2em;
}

.formation-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5em;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.formation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.formation-card .card-header {
    background: none;
    padding: 0 0 1em 0;
    border-radius: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.formation-card .card-header h4 {
    margin: 0;
    color: #1e293b;
    font-weight: 600;
    font-size: 1.1em;
    flex: 1;
}

.formation-card .card-info p {
    margin: 0 0 1em 0;
    color: #64748b;
    line-height: 1.4;
}

.formation-meta {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
    margin-bottom: 1.2em;
}

.formation-meta div {
    color: #64748b;
    font-size: 0.9em;
    display: flex;
    align-items: center;
}

.formation-meta i {
    width: 16px;
    margin-right: 0.5em;
    color: #94a3b8;
}

.card-actions {
    display: flex;
    gap: 0.5em;
    justify-content: center;
}

/* Stats grid avec flex */
.stats-grid.flex-stats {
    display: flex;
    gap: 1em;
    margin-bottom: 1.5em;
    flex-wrap: nowrap;
    overflow-x: auto;
}

/* Stat cards avec couleurs */
.stat-card {
    background: white;
    padding: 1em 1.2em;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.stat-card-blue {
    border-left: 4px solid #007bff;
}

.stat-card-green {
    border-left: 4px solid #28a745;
}

.stat-card-yellow {
    border-left: 4px solid #ffc107;
}

.stat-card-purple {
    border-left: 4px solid #6f42c1;
}

.stat-icon-blue {
    color: #007bff;
    font-size: 1.6em;
    margin-bottom: 0.3em;
}

.stat-icon-green {
    color: #28a745;
    font-size: 1.6em;
    margin-bottom: 0.3em;
}

.stat-icon-yellow {
    color: #ffc107;
    font-size: 1.6em;
    margin-bottom: 0.3em;
}

.stat-icon-purple {
    color: #6f42c1;
    font-size: 1.6em;
    margin-bottom: 0.3em;
}

.stat-value {
    color: #2d3748;
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 0.2em;
}

.stat-label {
    color: #718096;
    font-size: 0.8em;
    font-weight: 500;
}

/* Message utilisateur */
.user-message {
    font-style: italic;
    color: #555;
    margin: 1em 0;
}

/* Form group dans modal d'édition */
.form-group.flex-1-right {
    flex: 1;
    margin-right: 0.5em;
}

.form-group.flex-1-left {
    flex: 1;
    margin-left: 0.5em;
}

/* Modal hidden par défaut */
.modal.hidden {
    display: none;
}

.modal.visible {
    display: flex;
}

/* Form inline */
.form-inline {
    display: inline;
}