/* =============================================================================
   AFFILIATE MANAGEMENT - CSS
   Page de gestion des partenaires affiliés pour iMagin.K
   ============================================================================= */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --transition: all 0.3s ease;
}

/* =============================================================================
   ACCORDÉON DES CANDIDATURES
   ============================================================================= */

.accordion-button {
    background-color: var(--light-color);
    border: none;
    border-radius: 0.5rem;
    padding: 1.25rem;
    transition: var(--transition);
    box-shadow: none;
    font-weight: 500;
}

.accordion-button:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.accordion-button:not(.collapsed):hover {
    background-color: #0056b3;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.accordion-button::after {
    margin-left: auto;
    margin-right: 1rem;
    color: inherit;
}

.accordion-item {
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.5rem !important;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: var(--transition);
}

.accordion-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.accordion-body {
    padding: 2rem;
    background-color: #fff;
}

/* Détails de paiement */
.accordion-body pre {
    font-family: 'Courier New', monospace;
    background-color: var(--light-color);
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--dark-color);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Boutons d'action dans l'accordéon */
.accordion-body .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.accordion-body .btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

.accordion-body .btn-success:hover {
    background-color: #1e7e34;
    border-color: #1c7430;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.accordion-body .btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
}

.accordion-body .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.accordion-body .btn-outline-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.3);
}

/* =============================================================================
   TABLEAU DES AFFILIÉS ACTIFS
   ============================================================================= */

.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.table thead.table-dark {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color);
}

.table thead th {
    border: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 1.2rem 1rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition);
    border: none;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
    transform: scale(1.01);
}

.table tbody td {
    padding: 1.2rem 1rem;
    vertical-align: middle;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Badges dans le tableau */
.table .badge {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 50px;
}

/* Groupe de boutons d'actions */
.btn-group .btn {
    border-radius: 0.375rem !important;
    margin: 0 2px;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-group .btn:hover {
    transform: translateY(-2px) scale(1.1);
}

.btn-group .btn i {
    font-size: 0.875rem;
}

.btn-outline-primary:hover {
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-outline-info:hover {
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-outline-warning:hover {
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* =============================================================================
   CARTES DE STATISTIQUES RAPIDES
   ============================================================================= */

.card {
    border-radius: 1rem;
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.card.border-primary:hover {
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.2);
}

.card.border-warning:hover {
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.2);
}

.card.border-success:hover {
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.2);
}

.card.border-info:hover {
    box-shadow: 0 10px 30px rgba(23, 162, 184, 0.2);
}

.card-body {
    padding: 2rem 1.5rem;
}

.card-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-text.small {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Icônes des cartes statistiques */
.card-body i.fa-2x {
    transition: var(--transition);
}

.card:hover .card-body i.fa-2x {
    transform: scale(1.2);
}

/* =============================================================================
   EN-TÊTES DE SECTIONS
   ============================================================================= */

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: none;
    font-weight: 600;
}

.card-header.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%) !important;
}

.card-header.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.card-header .badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    border-radius: 50px;
}

.card-header .btn-light {
    font-weight: 600;
    border-radius: 0.5rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.card-header .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

/* =============================================================================
   ÉTATS VIDES
   ============================================================================= */

.text-center.py-5 {
    padding: 3rem 1.5rem !important;
}

.text-center.py-5 i.fa-3x {
    opacity: 0.6;
    margin-bottom: 1.5rem !important;
}

.text-center.py-5 h5 {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.text-center.py-5 p {
    color: var(--secondary-color);
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto;
}

/* =============================================================================
   ANIMATIONS D'APPARITION/DISPARITION
   ============================================================================= */

.fade-out {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-in {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* =============================================================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================================================================= */

/* Smartphones */
@media (max-width: 576px) {
    .accordion-body {
        padding: 1rem;
    }
    
    .accordion-body .row > .col-md-4 {
        margin-top: 2rem;
    }
    
    .accordion-body .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .card-header .btn-light {
        margin-top: 1rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin: 2px 0;
        border-radius: 0.375rem !important;
    }
    
    .card-title {
        font-size: 2rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Tablettes */
@media (min-width: 577px) and (max-width: 768px) {
    .accordion-body .btn {
        margin-bottom: 0.5rem;
    }
    
    .card-title {
        font-size: 2.2rem;
    }
}

/* Ordinateurs */
@media (min-width: 769px) {
    .accordion-body .col-md-4 .btn {
        margin-bottom: 0.75rem;
    }
}

/* =============================================================================
   ACCESSIBILITÉ
   ============================================================================= */

.btn:focus {
    outline: 2px solid transparent;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.accordion-button:focus {
    z-index: 3;
    outline: 2px solid transparent;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Mode sombre (si nécessaire) */
@media (prefers-color-scheme: dark) {
    .accordion-body pre {
        background-color: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
}