/* Variables CSS pour les thèmes */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --text-light: #f8f9fa;
    --text-dark: #212529;
    --border-color: #dee2e6;
    --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: var(--light-bg);
    color: var(--text-dark);
    transition: all 0.3s ease;
}

/* Header et navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

/* Cartes et conteneurs */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Tableaux */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--secondary-color);
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

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

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

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

/* Boutons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-1px);
}

/* Filtres et recherche */
.filter-section {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

/* Statuts */
.status-active {
    color: var(--success-color);
    font-weight: 600;
}

.status-inactive {
    color: var(--danger-color);
    font-weight: 600;
}

.status-expired {
    color: var(--warning-color);
    font-weight: 600;
}

/* Loading spinner */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 2rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Styles pour la nouvelle interface */

/* Avatar circles */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    background-color: var(--primary-color);
    color: white;
}

/* Empty state */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

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

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 2rem;
}

.loading-spinner p {
    margin-top: 1rem;
    color: var(--text-muted);
}

/* Sortable headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable-header:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sortable-header i {
    opacity: 0.5;
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

.sortable-header:hover i {
    opacity: 0.8;
}

/* Stats cards */
.card h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 300;
}

.card.bg-primary h3,
.card.bg-success h3,
.card.bg-warning h3,
.card.bg-info h3 {
    color: white !important;
}

/* Table responsive improvements */
@media (max-width: 768px) {
    .table-responsive table {
        font-size: 0.8rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .avatar-circle {
        width: 32px;
        height: 32px;
        font-size: 0.7rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    /* Amélioration de l'affichage mobile */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Amélioration des formulaires */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Alertes dans les modals */
.alert-info {
    border: none;
    background-color: rgba(13, 110, 253, 0.1);
}

/* Footer */
footer {
    margin-top: auto;
}

/* Amélioration des boutons */
.btn {
    transition: all 0.2s ease-in-out;
}

.btn:active {
    transform: scale(0.98);
}

/* Styles pour les états de statut */
.status-active {
    color: var(--success-color);
    font-weight: 600;
}

.status-inactive {
    color: var(--danger-color);
    font-weight: 600;
}

.status-expired {
    color: var(--warning-color);
    font-weight: 600;
}

/* Badges améliorés */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Pagination améliorée */
.btn-outline-secondary:disabled {
    opacity: 0.6;
}

/* Tooltips pour les boutons d'action */
.btn-group .btn {
    position: relative;
}

/* Animation pour les nouvelles lignes */
@keyframes highlightNew {
    0% { background-color: rgba(40, 167, 69, 0.2); }
    100% { background-color: transparent; }
}

.highlight-new {
    animation: highlightNew 2s ease;
}

/* Styles pour le dark mode des nouveaux éléments */
body.dark-mode .sortable-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .card.bg-light {
    background-color: #2d3748 !important;
    color: var(--text-light);
}

body.dark-mode .form-text {
    color: #a0aec0;
}

body.dark-mode .alert-info {
    background-color: rgba(144, 205, 244, 0.1);
    color: #bee3f8;
}

body.dark-mode footer {
    background-color: #1a202c !important;
}

/* Amélioration de la responsive */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
    }
    
    .filter-section .row {
        margin-bottom: -0.5rem;
    }
    
    .filter-section .col-md-2,
    .filter-section .col-md-4 {
        margin-bottom: 0.5rem;
    }
}