/* ==========================================
   CRIHD POSTES PAGE - STYLES COMPLETS
   ========================================== */

/* ==========================================
   SECTION FILTRES DE RECHERCHE
   ========================================== */
.jobs-filter-section {
    padding: 60px 0;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
}

.filter-header {
    text-align: center;
    margin-bottom: 40px;
}

.filter-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
}

.filter-header p {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

.jobs-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.select2-container--default .select2-results__option--selected {
    background-color: #c53c3c !important;
    color: #FFF !important
}

.select2-results__option--selectable {
    color: #c53c3c !important;
    background-color: #fff !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable:not(.select2-results__option--selected) {
    background-color: rgba(197, 60, 60, .2) !important;
    border: 1px solid #c53c3c;
    color: rgba(197, 60, 60, .1)
}

li.select2-selection__choice {
    background-color: rgba(197, 60, 60, .1) !important;
    border: 1px solid rgba(197, 60, 60, .5) !important;
}

.select2-selection__choice__remove {
    color: #c53c3c !important;
    padding: 5px;
    border-right: 1px solid #c53c3c !important;
}

.select2-selection__choice__display {
    color: #c53c3c !important;
}


.filter-select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #2c3e50;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #c53c3c;
    box-shadow: 0 0 0 3px rgba(197, 60, 60, 0.1);
}

.filter-reset-btn {
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    height: fit-content;
}

.filter-reset-btn:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

/* ==========================================
   RÉSUMÉ DES RÉSULTATS
   ========================================== */
.results-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
}

#results-count {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.view-btn {
    background: white;
    border: 2px solid #e5e7eb;
    color: #6b7280;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover,
.view-btn.active {
    background: #c53c3c;
    border-color: #c53c3c;
    color: white;
}

/* ==========================================
   SECTION POSTES
   ========================================== */
.jobs-section {
    padding: 80px 0;
    background: white;
}

.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
}

.jobs-grid.list-view {
    grid-template-columns: 1fr;
    gap: 20px;
}

/* ==========================================
   CARTES D'EMPLOI
   ========================================== */
.job-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    overflow: hidden;
    border: 2px solid transparent;
    position: relative;
}

.job-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
    border-color: rgba(197, 60, 60, 0.2);
}

.job-card.featured {
    border-color: #c53c3c;
    background: linear-gradient(135deg, #c53c3c 0%, #a73030 100%);
    color: white;
}

.job-card.featured:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(197, 60, 60, 0.25);
}

/* ==========================================
   EN-TÊTE DU POSTE
   ========================================== */
.job-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.job-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.job-department,
.job-type {
    background: rgba(197, 60, 60, 0.1);
    color: #c53c3c;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.job-department {
    border-radius: 5px !important;
}
.job-card.featured .job-department {
    border: 1px solid #fff !important;
}
.job-card:not(.featured) .job-department {
    border: 1px solid #c53c3c !important;
}

.job-type {
    border-radius: 20px;
}

.job-card.featured .job-department,
.job-card.featured .job-type {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.stage-type {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.job-card.featured .stage-type {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.job-urgency {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 12px;
}

.job-urgency.urgent {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.job-urgency.new {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.job-urgency.featured-badge {
    background: rgba(255, 193, 7, 0.1);
    color: #f59e0b;
}

.job-card.featured .job-urgency {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ==========================================
   CONTENU DU POSTE
   ========================================== */
.job-content {
    padding: 0 24px 24px;
}

.job-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 16px;
    line-height: 1.3;
}

.job-card.featured .job-title {
    color: white;
}

.job-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.job-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.job-card.featured .job-detail {
    color: rgba(255, 255, 255, 0.9);
}

.job-detail i {
    color: #c53c3c;
    width: 16px;
}

.job-card.featured .job-detail i {
    color: white;
}

.job-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 20px;
}

.job-card.featured .job-description {
    color: rgba(255, 255, 255, 0.9);
}

/* ==========================================
   COMPÉTENCES
   ========================================== */
.job-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.skill-tag {
    background: #f3f4f6;
    color: #4b5563;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
}

.job-card.featured .skill-tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ==========================================
   PIED DE POSTE
   ========================================== */
.job-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f3f4f6;
    padding-top: 16px;
}

.job-card.featured .job-footer {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.job-posted {
    font-size: 12px;
    color: #9ca3af;
}

.job-card.featured .job-posted {
    color: rgba(255, 255, 255, 0.8);
}

.job-apply-btn {
    background: #c53c3c;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.job-apply-btn:hover {
    background: #a73030;
    transform: translateX(4px);
}

.job-card.featured .job-apply-btn {
    background: white;
    color: #c53c3c;
}

.job-card.featured .job-apply-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #a73030;
}

/* ==========================================
   PAGINATION
   ========================================== */
.jobs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 40px 0;
}
.jobs-pagination a {
    text-decoration: none !important;
}

.pagination-btn {
    background: white;
    border: 2px solid #e5e7eb;
    color: #6b7280;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
}

.pagination-btn:hover:not(:disabled) {
    background: #c53c3c;
    border-color: #c53c3c;
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-number {
    background: white;
    border: 2px solid #e5e7eb;
    color: #6b7280;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
    border-radius: 8px;
}

.page-number:hover,
.page-number.active {
    background: #c53c3c;
    border-color: #c53c3c;
    color: white;
}

/* ==========================================
   CANDIDATURE SPONTANÉE
   ========================================== */
.spontaneous-application-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

.application-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    align-items: center;
}

.application-text h2 {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
    line-height: 1.2;
}

.application-text p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 32px;
}

.application-benefits {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.benefit-item i {
    color: #22c55e;
    font-size: 16px;
}

.application-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.spontaneous-btn,
.alert-btn {
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.spontaneous-btn {
    background: #c53c3c;
    color: white;
    border-color: #c53c3c;
}

.spontaneous-btn:hover {
    background: #a73030;
    border-color: #a73030;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(197, 60, 60, 0.3);
}

.alert-btn {
    background: transparent;
    color: white;
    border-color: white;
}

.alert-btn:hover {
    background: white;
    color: #2c3e50;
    transform: translateY(-2px);
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.job-card {
    animation: slideInUp 0.6s ease-out forwards;
}

.job-card:nth-child(1) { animation-delay: 0.1s; }
.job-card:nth-child(2) { animation-delay: 0.2s; }
.job-card:nth-child(3) { animation-delay: 0.3s; }
.job-card:nth-child(4) { animation-delay: 0.4s; }
.job-card:nth-child(5) { animation-delay: 0.5s; }
.job-card:nth-child(6) { animation-delay: 0.6s; }

/* ==========================================
   VUE LISTE
   ========================================== */
.jobs-grid.list-view .job-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 20px 24px;
}

.jobs-grid.list-view .job-header {
    padding: 0;
    margin-bottom: 12px;
}

.jobs-grid.list-view .job-content {
    padding: 0;
}

.jobs-grid.list-view .job-footer {
    border: none;
    padding: 0;
    margin-left: 24px;
}

.jobs-grid.list-view .job-skills {
    margin-bottom: 0;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 1024px) {
    .jobs-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 24px;
    }

    .application-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .application-actions {
        flex-direction: row;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .jobs-filter-section {
        padding: 40px 0;
    }

    .jobs-filters {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .filter-reset-btn {
        justify-self: center;
        width: fit-content;
    }

    .results-summary {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .jobs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .job-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .job-details {
        flex-direction: column;
    }

    .job-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .application-actions {
        flex-direction: column;
        width: 100%;
    }

    .spontaneous-btn,
    .alert-btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .filter-header h2 {
        font-size: 24px;
    }

    .job-title {
        font-size: 18px;
    }

    .job-card {
        margin: 0 -8px;
    }

    .jobs-section {
        padding: 60px 0;
    }

    .spontaneous-application-section {
        padding: 60px 0;
    }

    .application-text h2 {
        font-size: 24px;
    }

    .jobs-pagination {
        flex-direction: column;
        gap: 16px;
    }

    .pagination-numbers {
        order: -1;
    }
}

/* ==========================================
   ÉTATS DE FILTRE
   ========================================== */
.job-card.filtered-out {
    opacity: 0.3;
    transform: scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
}

.job-card.filtered-in {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    transition: all 0.3s ease;
}

/* ==========================================
   ACCESSIBILITÉ
   ========================================== */
.job-card:focus-within,
.filter-select:focus,
.job-apply-btn:focus,
.spontaneous-btn:focus,
.alert-btn:focus {
    outline: 3px solid #c53c3c;
    outline-offset: 2px;
}

.view-btn:focus {
    outline: 2px solid #c53c3c;
    outline-offset: 2px;
}

/* ==========================================
   OPTIMISATIONS DE PERFORMANCE
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    .job-card,
    .job-apply-btn,
    .spontaneous-btn,
    .alert-btn {
        animation: none;
        transition: none;
    }

    .job-card:hover,
    .job-apply-btn:hover {
        transform: none;
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
    .jobs-filter-section,
    .jobs-pagination,
    .spontaneous-application-section {
        display: none;
    }

    .jobs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .job-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .job-apply-btn {
        display: none;
    }
}