/* Design moderne pour les tableaux de barème */

/* Container de la section barème */
.bareme-section {
    margin-top: 3rem;
}

.bareme-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1.5rem;
}

.bareme-title i {
    font-size: 1.6rem;
    color: #dc3545;
}

/* Carte du tableau moderne */
.table-card-modern {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.table-card-modern:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

/* En-tête de la carte avec gradient */
.table-card-header-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem 2rem;
    border: none;
    position: relative;
    overflow: hidden;
}

/* Variante CARFO */
.table-card-header-modern.header-carfo {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 50%, #bd2130 100%);
}

.table-card-header-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' fill-opacity='0.1' d='M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

.table-card-header-modern h5 {
    color: white;
    font-weight: 600;
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
    z-index: 1;
}

.table-card-header-modern i {
    font-size: 1.5rem;
    opacity: 0.9;
}

/* Corps de la carte */
.table-card-body-modern {
    padding: 2rem;
}

/* Tableau moderne */
.table-modern {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

/* En-tête du tableau */
.table-modern thead {
    position: relative;
}

.table-modern thead tr {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.table-modern thead th {
    padding: 1.2rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2d3748;
    border: none;
    border-bottom: 3px solid #dc3545;
    position: relative;
    vertical-align: middle;
    text-align: center;
}

.table-modern thead th:first-child {
    border-radius: 10px 0 0 0;
}

.table-modern thead th:last-child {
    border-radius: 0 10px 0 0;
}

/* Icônes dans les en-têtes */
.table-modern thead th i {
    margin-right: 0.5rem;
    color: #dc3545;
}

/* Corps du tableau */
.table-modern tbody tr {
    transition: all 0.3s ease;
    background: white;
}

.table-modern tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.table-modern tbody tr:hover {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.05) 0%, rgba(220, 53, 69, 0.02) 100%);
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.table-modern tbody td {
    padding: 1rem;
    border: none;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
    font-size: 1rem;
    color: #4a5568;
    text-align: center;
    font-weight: 500;
}

/* Mise en évidence des montants */
.table-modern tbody td:nth-child(3) {
    font-weight: 700;
    color: #dc3545;
    font-size: 1.1rem;
}

/* Bordures arrondies pour la dernière ligne */
.table-modern tbody tr:last-child td:first-child {
    border-radius: 0 0 0 10px;
}

.table-modern tbody tr:last-child td:last-child {
    border-radius: 0 0 10px 0;
}

/* Container responsive */
.table-responsive-modern {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

/* Scrollbar personnalisée */
.table-responsive-modern::-webkit-scrollbar {
    height: 8px;
}

.table-responsive-modern::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.table-responsive-modern::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-radius: 10px;
}

.table-responsive-modern::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

/* Note informative avec design moderne */
.table-note-modern {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left: 4px solid #dc3545;
    border-radius: 10px;
    padding: 1.2rem 1.5rem;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

.table-note-modern::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(220, 53, 69, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.table-note-modern p {
    margin: 0;
    color: #2d3748;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.table-note-modern strong {
    color: #dc3545;
    font-weight: 700;
}

.table-note-modern i {
    color: #dc3545;
    margin-right: 0.5rem;
}

/* Badge pour les valeurs spéciales */
.badge-pension {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Animation d'entrée pour les lignes du tableau */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-modern tbody tr {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.table-modern tbody tr:nth-child(1) { animation-delay: 0.1s; }
.table-modern tbody tr:nth-child(2) { animation-delay: 0.2s; }
.table-modern tbody tr:nth-child(3) { animation-delay: 0.3s; }
.table-modern tbody tr:nth-child(4) { animation-delay: 0.4s; }
.table-modern tbody tr:nth-child(5) { animation-delay: 0.5s; }
.table-modern tbody tr:nth-child(6) { animation-delay: 0.6s; }
.table-modern tbody tr:nth-child(7) { animation-delay: 0.7s; }
.table-modern tbody tr:nth-child(8) { animation-delay: 0.8s; }
.table-modern tbody tr:nth-child(9) { animation-delay: 0.9s; }
.table-modern tbody tr:nth-child(10) { animation-delay: 1s; }

/* Responsive Design */
@media (max-width: 992px) {
    .table-card-header-modern h5 {
        font-size: 1.15rem;
    }
    
    .table-modern thead th,
    .table-modern tbody td {
        font-size: 0.9rem;
        padding: 0.9rem 0.7rem;
    }
}

@media (max-width: 768px) {
    .table-card-header-modern {
        padding: 1.2rem 1.5rem;
    }
    
    .table-card-header-modern h5 {
        font-size: 1rem;
    }
    
    .table-card-body-modern {
        padding: 1rem;
    }
    
    .table-modern thead th {
        padding: 0.7rem 0.4rem;
        font-size: 0.7rem;
        letter-spacing: 0.3px;
    }
    
    .table-modern thead th i {
        display: block;
        margin: 0 0 0.3rem 0;
        font-size: 1rem;
    }
    
    .table-modern tbody td {
        padding: 0.7rem 0.4rem;
        font-size: 0.75rem;
        word-break: break-word;
    }
    
    /* Réduire la taille des montants en rouge sur mobile */
    .table-modern tbody td:nth-child(3) {
        font-size: 0.85rem;
    }
    
    /* Emoji plus petit sur mobile */
    .table-modern tbody td:nth-child(3)::before {
        font-size: 0.7rem;
    }
    
    .table-note-modern {
        padding: 1rem;
    }
    
    .table-note-modern p {
        font-size: 0.85rem;
    }
    
    .bareme-title {
        font-size: 1.3rem;
    }
    
    /* Scrollbar plus visible sur mobile */
    .table-responsive-modern::-webkit-scrollbar {
        height: 10px;
    }
    
    /* Badge plus petit */
    .badge-plus {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
}

@media (max-width: 576px) {
    .table-card-header-modern {
        padding: 1rem;
    }
    
    .table-card-header-modern h5 {
        font-size: 0.9rem;
    }
    
    .table-card-body-modern {
        padding: 0.5rem;
    }
    
    .table-responsive-modern {
        /* Afficher un indicateur de scroll */
        box-shadow: inset -10px 0 10px -10px rgba(0,0,0,0.1);
    }
    
    .table-modern {
        min-width: 600px; /* Largeur minimale pour garder le tableau lisible */
    }
    
    .table-modern thead th {
        padding: 0.6rem 0.3rem;
        font-size: 0.65rem;
        white-space: nowrap;
    }
    
    .table-modern tbody td {
        padding: 0.6rem 0.3rem;
        font-size: 0.7rem;
        white-space: nowrap;
    }
    
    .table-modern tbody td:nth-child(3) {
        font-size: 0.75rem;
    }
    
    .table-note-modern {
        padding: 0.8rem;
    }
    
    .table-note-modern p {
        font-size: 0.8rem;
        line-height: 1.5;
    }
    
    .bareme-title {
        font-size: 1.1rem;
    }
    
    .bareme-title i {
        font-size: 1rem;
    }
    
    /* Animation désactivée sur très petits écrans pour performance */
    .table-modern tbody tr {
        animation: none;
        opacity: 1;
    }
}

/* Indicateur visuel de scroll horizontal */
.table-responsive-modern {
    position: relative;
}

.table-responsive-modern::after {
    content: '← Faites défiler →';
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

@media (max-width: 768px) {
    .table-responsive-modern::after {
        opacity: 1;
        animation: pulseScroll 2s ease-in-out infinite;
    }
}

@keyframes pulseScroll {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

/* Effet de surbrillance pour les colonnes importantes */
.table-modern tbody td:nth-child(3)::before {
    content: '💰';
    margin-right: 0.3rem;
    font-size: 0.9rem;
}

/* Style alternatif avec icônes */
.table-modern.with-icons tbody td:first-child::before {
    content: '📊';
    margin-right: 0.5rem;
}

/* Indicateur de "et plus" */
.badge-plus {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
}

