/**
 * Styles modernes pour la page des formations
 * Design responsive avec cartes et accordéons CSS
 */

/* ==================== Variables CSS ==================== */
:root {
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-secondary: #64748b;
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-fifa: #3b82f6;
    --color-fc: #8b5cf6;
    --color-fi: #06b6d4;
    --color-fa: #f59e0b;
    
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --text-muted: #64748b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    --transition: all 0.3s ease;
    
    /* Taille de police de base DOUBLÉE */
    --font-base: 1.25rem;      /* 20px - doublé depuis 10px de base */
    --font-small: 1.125rem;    /* 18px */
    --font-large: 1.5rem;      /* 24px */
}

/* ==================== Layout général ==================== */
.formations-index {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-size: var(--font-base);
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 3rem;           /* Doublé */
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.page-header .lead {
    font-size: 1.5rem;         /* Doublé */
    color: var(--text-muted);
    margin: 0;
}

/* ==================== Panel de recherche ==================== */
.search-panel {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.search-header h3 {
    margin: 0 0 1rem 0;
    font-size: 1.75rem;        /* Doublé */
    color: var(--text-color);
}

.search-form {
    margin: 0;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-field.full-width {
    grid-column: 1 / -1;
}

.search-field label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.375rem;
    font-size: var(--font-base);
}

.form-select,
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    transition: var(--transition);
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.875rem;
}

.checkbox-group .checkbox {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.checkbox-group label {
    margin: 0;
    font-weight: 500;
    cursor: pointer;
    font-size: var(--font-base);
}

.form-checkbox {
    cursor: pointer;
    width: 1.25rem;            /* Doublé */
    height: 1.25rem;           /* Doublé */
}

.search-actions {
    display: flex;
    justify-content: center;
}

/* ==================== Boutons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    font-size: var(--font-base);
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.5;
}

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

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--color-secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: var(--color-success-hover);
}

.btn-icon {
    padding: 0.5rem 1rem;
    font-size: var(--font-base);
}

.btn-block {
    width: 100%;
}

.action-icon {
    width: 28px;               /* Doublé */
    height: 28px;              /* Doublé */
    vertical-align: middle;
}

/* ==================== Sections ==================== */
.formations-section {
    margin-bottom: 2.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 2.25rem;        /* Doublé */
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    /* ajout laurent */
    background-color: #ccc;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: var(--font-small);
    font-weight: 600;
    color: white;
}

.badge-fifa {
    background: var(--color-fifa);
}

.badge-fc {
    background: var(--color-fc);
}

/* ==================== Composantes ==================== */
.composante-block {
    margin-bottom: 2rem;
    background: transparent; /* Pas de background pour éviter le bleu qui dépasse */
}

.composante-title {
    font-size: 1.75rem;        /* Doublé */
    font-weight: 600;
    color: var(--text-color);
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
}

/* ==================== Accordéons par pôle ==================== */
.pole-accordion {
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.pole-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.5rem;      /* Augmenté pour le texte plus grand */
    background: linear-gradient(to right, #f8fafc, #ffffff);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.pole-header:hover {
    background: var(--bg-light);
}

.pole-icon {
    font-size: 1rem;           /* Doublé */
    color: var(--color-primary);
    transition: transform 0.3s ease;
}

.pole-name {
    flex: 1;
    font-size: 1.5rem;         /* Doublé */
    font-weight: 600;
    color: var(--text-color);
}

.pole-count {
    font-size: var(--font-small);
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
}

.pole-content {
    display: none; /* Caché par défaut */
    overflow: hidden;
    background: var(--bg-white);
}

.pole-content.active {
    display: block;
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* ==================== Grille de formations ==================== */
.formations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

/* ==================== Cartes de formation ==================== */
.formation-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.formation-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.formation-card.already-applied {
    border-color: var(--color-success);
    background: linear-gradient(to bottom right, #ffffff, #f0fdf4);
}

.card-header {
    padding: 1.25rem 1.5rem;   /* Augmenté */
    background: linear-gradient(135deg, var(--bg-light), var(--bg-white));
    border-bottom: 1px solid var(--border-color);
}

.formation-title {
    font-size: 1.5rem;         /* Doublé */
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.625rem 0;
    line-height: 1.4;
}

.formation-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: var(--font-small);
    font-weight: 600;
    border-radius: var(--radius-sm);
    color: white;
}

.badge-fi {
    background: var(--color-fi);
}

.badge-fa {
    background: var(--color-fa);
}

.badge-fc {
    background: var(--color-fc);
}

.card-body {
    padding: 1.25rem 1.5rem;   /* Augmenté */
    flex: 1;
}

.formation-info {
    margin-bottom: 0.875rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
    font-size: var(--font-base);
}

.info-icon {
    font-size: 1.5rem;         /* Doublé */
    flex-shrink: 0;
}

.info-label {
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

.info-value {
    color: var(--text-color);
}

.formation-actions {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.card-footer {
    padding: 1rem 1.5rem;      /* Augmenté */
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .formations-index {
        padding: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.875rem;
    }
    
    .search-panel {
        padding: 1.5rem;
    }
    
    .search-grid {
        grid-template-columns: 1fr;
    }
    
    .formations-grid {
        grid-template-columns: 1fr;
    }
    
    .pole-header {
        padding: 0.875rem 1rem;
    }
    
    .pole-name {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        /* ajout laurent */
        background-color: #ccc;
    }
    
    .composante-title {
        font-size: 1.25rem;
    }
    
    .formation-actions {
        flex-direction: column;
    }
    
    .btn-icon {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header .lead {
        font-size: 1rem;
    }
    
    .checkbox-group {
        flex-direction: column;
    }
}

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

.formation-card {
    animation: slideDown 0.3s ease-out;
}

/* ==================== Statut des candidatures ==================== */
.candidature-status-info {
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 0.75rem;
}

.candidature-status {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: var(--font-small);
    font-weight: 500;
}

.status-open {
    background-color: #d1fae5;
    color: #065f46;
}

.status-closed {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-not-yet {
    background-color: #fef3c7;
    color: #92400e;
}

.candidature-status i {
    font-style: italic;
    font-weight: normal;
}

/* ==================== Print ==================== */
@media print {
    .search-panel,
    .card-footer,
    .formation-actions {
        display: none;
    }
    
    .pole-content {
        max-height: none !important;
    }
    
    .formation-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
