/* Désactiver le hero sticky sur cette page */
.hero-banner {
    position: relative !important;
    top: auto !important;
    z-index: 1 !important;
}

/* Styles spécifiques aux formations */

main {
    width: 100%;
    margin: 0;
    padding: 0 2rem;
}

.container-content {
    max-width: 1400px;
    margin: 0 auto;
}

.search-section {
    background: #fff;
    padding: 1rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 78, 146, 0.1);
}

.search-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 300px;
    padding: 1rem 1.5rem;
    border: 2px solid #e1e8ed;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-input:focus {
    outline: none;
    border-color: #004e92;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 78, 146, 0.1);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: #fff;
    border: 2px solid #e1e8ed;
    color: #666;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, #004e92, #0066cc);
    color: #fff;
    border-color: #004e92;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 78, 146, 0.3);
}

.stats-bar {
    display: flex;
    justify-content: space-around;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e1e8ed;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #004e92;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

.section {
    color: #004e92;
    font-size: 2.2rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
    position: relative;
}

.section::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #004e92, #0066cc);
    border-radius: 2px;
}

.grid {
    display: grid;
    /* Colonnes fixes pour empêcher l'étirement quand il y a moins de cartes */
    grid-template-columns: repeat(auto-fill, 410px);
    gap: 2rem;
    margin-bottom: 3rem;
    justify-content: center;
    /* centrer le dernier rang */
}

/* Responsive: une seule colonne en mobile */
@media (max-width: 820px) {
    .grid {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }
}

.card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 78, 146, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(135deg, #004e92, #0066cc);
}

.card[data-type="CAP"]::before {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
}

.card[data-type="Bac Pro"]::before {
    background: linear-gradient(135deg, #1565c0, #1976d2);
}

.card[data-type="BTS"]::before {
    background: linear-gradient(135deg, #d32f2f, #f44336);
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 1.5rem 1.5rem 1rem;
    position: relative;
}

.badges-container {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    flex-wrap: nowrap;
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    white-space: nowrap;
}

.badge.cap {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #2e7d32;
    border: 2px solid #2e7d32;
}

.badge.bac-pro {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border: 2px solid #1565c0;
}

.badge.bts {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #d32f2f;
    border: 2px solid #d32f2f;
}

.badge.initial {
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    color: white;
    border: 2px solid #1976d2;
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
}

.badge.initial i {
    margin-right: 0.25rem;
    font-size: 0.85rem;
}

.badge.apprentissage {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
    border: 2px solid #4caf50;
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
}

.badge.apprentissage i {
    margin-right: 0.25rem;
    font-size: 0.85rem;
}

.card h3 {
    color: #000428;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.card p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Limiter le nombre de lignes pour stabiliser la hauteur des sections */
.card-header h3,
.card-header p,
.formation-details p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-header h3 {
    /* Titre: 2 lignes max */
    -webkit-line-clamp: 2;
}

.card-header p {
    /* Description courte: 2 lignes max */
    -webkit-line-clamp: 2;
}

.formation-details {
    padding: 0 1.5rem;
    margin-top: auto;
}

.formation-details h6 {
    color: #004e92;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.formation-details h6 i {
    font-size: 0.8rem;
}

.formation-details p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: #555;
}

/* Durée (1ère <p>): 1 ligne max */
.formation-details p:nth-of-type(1) {
    -webkit-line-clamp: 1;
}

/* Stage (2ème <p>): 2 lignes max */
.formation-details p:nth-of-type(2) {
    -webkit-line-clamp: 2;
}

/* Objectifs (3ème <p>): 3 lignes max */
.formation-details p:nth-of-type(3) {
    -webkit-line-clamp: 3;
}

.card-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
}

.btn-formation {
    background: linear-gradient(135deg, #004e92, #0066cc);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    position: relative;
    overflow: hidden;
}

.card[data-type="CAP"] .btn-formation {
    background: linear-gradient(135deg, #1565c0, #1976d2);
}

.card[data-type="Bac Pro"] .btn-formation {
    background: linear-gradient(135deg, #1565c0, #1976d2);
}

.card[data-type="BTS"] .btn-formation {
    background: linear-gradient(135deg, #1565c0, #1976d2);
}

.btn-formation::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-formation:hover::before {
    left: 100%;
}

.btn-formation:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 78, 146, 0.4);
}

.btn-formation:active {
    transform: translateY(-1px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    overflow: auto;
    padding: 2rem 1rem;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 20px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #004e92, #0066cc);
    color: #fff;
    padding: 1.2rem 2rem;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.modal-badges {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.modal-badges .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid;
}

.modal-badges .badge i {
    font-size: 0.8rem;
}

/* Styles spécifiques pour les badges des modales - mêmes couleurs que les tuiles */
.modal-badges .badge.cap {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #2e7d32;
    border: 2px solid #2e7d32;
}

.modal-badges .badge.bac-pro {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border: 2px solid #1565c0;
}

.modal-badges .badge.bts {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #d32f2f;
    border: 2px solid #d32f2f;
}

.modal-badges .badge.initial {
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    color: white;
    border: 2px solid #1976d2;
}

.modal-badges .badge.apprentissage {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
    border: 2px solid #4caf50;
}

.modal-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
    font-weight: 700;
}

.modal-header .badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section h3 {
    color: #004e92;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-section h3 i {
    font-size: 1rem;
}

.modal-section ul {
    list-style: none;
    padding-left: 0;
}

.modal-section li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding-left: 1.5rem;
}

.modal-section li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #004e92;
    font-weight: bold;
}

/* Mise en page en 2 colonnes pour certaines sections */
.modal-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.modal-column {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #004e92;
}

.modal-column h3 {
    color: #004e92;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-column h3 i {
    font-size: 1rem;
}

.modal-column ul {
    list-style: none;
    padding-left: 0;
}

.modal-column li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
    padding-left: 1.5rem;
}

.modal-column li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color, #004e92);
    font-weight: bold;
}

.modal-column li:last-child {
    border-bottom: none;
}

/* Responsive pour les colonnes */
@media (max-width: 768px) {
    main {
        padding: 0 1rem;
    }

    .modal-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-content {
        max-width: 95%;
    }
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: #f8f9fa;
}

.btn-onisep {
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-onisep:hover {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.btn-onisep[disabled] {
    background: #cbd5e1;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.8;
    box-shadow: none;
}

.btn-close {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

footer {
    background: #000428;
    color: #fff;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    font-size: .95rem;
}

/* Responsive */
@media(max-width:768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar .container {
        padding: 0 1rem;
    }

    .hero-background {
        height: 25vh;
        min-height: 180px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .navbar-nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-input {
        min-width: auto;
    }

    .filter-buttons {
        gap: 0.25rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .stats-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
}

/* Les animations sont maintenant gérées par modern-theme.css et animations.js */