/* Styles pour la page de gestion des tarifs */

/* Saisons */
.saisons-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.saisons-nav span {
    color: #6b7280;
    font-weight: 500;
}

.saison-btn {
    padding: 8px 16px;
    background: #f3f4f6;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.saison-btn:hover {
    background: #e5e7eb;
}

.saison-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Boutons d'action */
.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text-color);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
}

.btn-danger:hover {
    background: #fecaca;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.add-saison-btn {
    padding: 6px 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

/* Légende des actions */
.action-legend {
    background: #f9fafb;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
}

.action-legend h5 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--primary-color);
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 5px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-item button {
    cursor: default;
    opacity: 1;
}

.legend-item span {
    font-size: 0.9rem;
    color: #4b5563;
}

/* Grille des tarifs */
.tarifs-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.tarif-card {
    background: #f9fafb;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    width: 100%;
    margin-bottom: 10px; /* Ajoute un peu d'espace supplémentaire entre les cartes */
}

.tarif-card h3 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.2rem; /* Taille légèrement réduite pour plus de place */
    display: flex;
    align-items: center;
}

/* Ajout d'icônes pour différencier les types de tarifs */
.tarif-card h3:before {
    font-family: "Font Awesome 5 Free";
    margin-right: 10px;
    font-weight: 900;
}

.tarif-card.cotisation h3:before {
    content: "\f007"; /* Icône utilisateur */
    color: #4f46e5; /* Couleur pour les cotisations */
}

.tarif-card.ffc h3:before {
    content: "\f206"; /* Icône vélo */
    color: #059669; /* Couleur pour FFC */
}

.tarif-card.ufolep h3:before {
    content: "\f091"; /* Icône trophée */
    color: #d97706; /* Couleur pour UFOLEP */
}

.tarif-card.fsgt h3:before {
    content: "\f5a2"; /* Icône montagne */
    color: #7c3aed; /* Couleur pour FSGT */
}

.tarif-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Assure une largeur égale des colonnes */
}

.tarif-table th {
    text-align: left;
    padding: 8px;
    border-bottom: 2px solid #e5e7eb;
    color: var(--text-color);
    position: relative; /* Pour le tri */
}

.tarif-table td {
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle; /* Centre verticalement le contenu */
}

/* Répartition des largeurs pour les colonnes */
.tarif-table th:nth-child(1), .tarif-table td:nth-child(1) { /* Colonne Catégorie */
    width: 25%;
}

.tarif-table th:nth-child(2), .tarif-table td:nth-child(2) { /* Colonne Option */
    width: 20%;
}

.tarif-table th:nth-child(3), .tarif-table td:nth-child(3) { /* Colonne Tranche d'âge */
    width: 25%;
}

.tarif-table th:nth-child(4), .tarif-table td:nth-child(4) { /* Colonne Montant */
    width: 15%;
}

.tarif-table th:nth-child(5), .tarif-table td:nth-child(5) { /* Colonne Actions */
    width: 15%;
    text-align: center; /* Centre les boutons d'action */
}

.tarif-table tr:last-child td {
    border-bottom: none;
}

.tarif-table .actions {
    display: flex;
    gap: 8px;
    justify-content: center; /* Centre les boutons */
}

/* Message d'état vide */
.empty-state {
    text-align: center;
    padding: 40px;
    background: #f9fafb;
    border-radius: 10px;
    margin: 20px 0;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 20px;
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto; /* Permet le défilement de la page entière si nécessaire */
}

.modal-content {
    background-color: white;
    margin: 2% auto; /* Réduit à 2% pour monter la modal plus haut */
    padding: 20px;
    border-radius: 20px;
    max-width: 800px; /* Augmenté pour plus d'espace horizontal */
    width: 95%; /* S'assure que la modal est suffisamment large */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: visible; /* Supprime le défilement interne */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px; /* Encore plus réduit */
    border-bottom: 1px solid #f0f0f0; /* Légère séparation visuelle */
    padding-bottom: 10px;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px; /* Encore plus réduit pour gagner de l'espace vertical */
    margin-bottom: 10px; /* Ajoute un peu d'espace en bas de la grille */
}

.form-group {
    margin-bottom: 8px; /* Encore plus réduit */
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 3px; /* Réduit de 5px à 3px */
    font-weight: 500;
    font-size: 0.9rem; /* Légèrement plus petit */
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 6px; /* Encore plus réduit pour gagner de l'espace vertical */
    border: 1px solid #e5e7eb;
    border-radius: 6px; /* Légèrement réduit */
    font-size: 0.92rem;
    height: auto; /* S'assure que la hauteur est déterminée par le contenu */
}

.form-group textarea {
    height: 60px; /* Hauteur réduite pour la zone de texte */
    resize: vertical;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px; /* Réduit */
    border-top: 1px solid #f0f0f0; /* Légère séparation visuelle */
    padding-top: 10px;
}

/* Confirmation de suppression */
.delete-confirmation {
    margin: 15px 0; /* Réduit de 20px à 15px */
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-confirmation input[type="checkbox"] {
    width: auto;
}

/* Texte d'aide */
.form-text {
    display: block;
    margin-top: 2px; /* Réduit de 4px à 2px */
    font-size: 0.8rem; /* Plus petit */
    color: #6b7280;
}

/* Alertes */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    position: relative;
}

.alert-danger {
    background-color: #fee2e2;
    color: #dc2626;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

.alert-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* Styles pour les petits écrans */
@media (max-width: 768px) {    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .saisons-nav {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .saison-btn {
        width: 100%;
        text-align: center;
    }
    
    .modal-content {
        margin: 2% auto;
        padding: 15px;
        width: 95%;
    }
    
    /* Ajustements pour les tables sur mobile */
    .tarif-table, .tarif-table thead, .tarif-table tbody, .tarif-table th, .tarif-table td, .tarif-table tr {
        display: block;
    }
    
    .tarif-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .tarif-table tr {
        border: 1px solid #e5e7eb;
        margin-bottom: 10px;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .tarif-table td {
        border: none;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        padding-left: 50%;
        text-align: left;
        min-height: 30px;
    }
    
    .tarif-table td:before {
        position: absolute;
        top: 8px;
        left: 8px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
    }
    
    /* Étiquettes de colonne pour le responsive */
    .tarif-table td:nth-of-type(1):before { content: "Catégorie"; }
    .tarif-table td:nth-of-type(2):before { content: "Option"; }
    .tarif-table td:nth-of-type(3):before { content: "Tranche d'âge"; }
    .tarif-table td:nth-of-type(4):before { content: "Montant"; }
    .tarif-table td:nth-of-type(5):before { content: "Actions"; }
    
    /* Adaptations pour les tableaux avec moins de colonnes */
    .tarif-table.no-option td:nth-of-type(2):before { content: "Tranche d'âge"; }
    .tarif-table.no-option td:nth-of-type(3):before { content: "Montant"; }
    .tarif-table.no-option td:nth-of-type(4):before { content: "Actions"; }
    
    /* Formulaire sur mobile */
    .form-grid {
        grid-template-columns: 1fr;
    }
}