/* Styles pour les cards */
.description-text {
    display: -webkit-box;          /* Chrome, Safari, Edge */
    -webkit-line-clamp: 3;         /* Nombre de lignes à afficher */
    -webkit-box-orient: vertical;  
    overflow: hidden;
    text-overflow: ellipsis;
    
    line-height: 1.6em;            /* Hauteur de ligne */
    max-height: 4.8em;             /* 1.6em * 3 lignes */
    
    /* Fallback pour Firefox */
    display: block;
    display: -moz-box;
    -moz-box-orient: vertical;
}

.card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2) !important;
}

.card-img-top {
    /*height: 250px;*/
    object-fit: cover;
}

/* Modal overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Contenu de la modal */
.modal-content-custom {
    position: relative;
    max-width: 900px;
    margin: 50px auto;
    background: white;
    border-radius: 15px;
    padding: 0;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(50px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bouton de fermeture */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.close-btn:hover {
    background: #f8f9fa;
    transform: rotate(90deg);
}

/* Boutons de navigation */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.nav-btn:hover {
    background: #f8f9fa;
    transform: translateY(-50%) scale(1.1);
}

.nav-btn.prev {
    left: -25px;
}

.nav-btn.next {
    right: -25px;
}

/* Image de la modal */
.modal-image {
    width: 100%;
    /*height: 400px;*/
    object-fit: cover;
    border-radius: 15px 15px 0 0;
}

/* Corps de la modal */
.modal-body-custom {
    padding: 40px;
}

.modal-title-custom {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
}

.candidate-indicator {
    text-align: center;
    padding: 10px;
    margin-top: 20px;
    color: #999;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content-custom {
        margin: 20px auto;
    }
    
    .nav-btn.prev {
        left: 10px;
    }
    
    .nav-btn.next {
        right: 10px;
    }
    
    .modal-image {
        height: 250px;
    }
    
    .modal-body-custom {
        padding: 20px;
    }
    
    .modal-title-custom {
        font-size: 1.5rem;
    }
    
    .modal-description {
        font-size: 1rem;
    }
}