/* ==========================================================================
   OFFRES D'EMPLOI - STYLES MODERNES
   ========================================================================== */

/* Variables CSS */
:root {
    --primary-color: #F24C0A;
    --secondary-color: #2c3e50;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-gray: #f8f9fa;
    --medium-gray: #6c757d;
    --dark-gray: #343a40;
    --border-color: #dee2e6;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 30px rgba(0,0,0,0.2);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */

.job-offers-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

.job-offers-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==========================================================================
   HEADER DE LA PAGE
   ========================================================================== */

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    background: white;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.page-title {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.page-title i {
    color: var(--primary-color);
    font-size: 2rem;
    display: inline-block;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    margin-right: 0.5rem;
}

.page-title i.fas,
.page-title i.fa-briefcase {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

.page-description {
    font-size: 1.1rem;
    color: var(--medium-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.user-welcome {
    color: var(--secondary-color);
    font-weight: 500;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--danger-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #c0392b;
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

/* ==========================================================================
   AUTHENTIFICATION REQUISE
   ========================================================================== */

.auth-required {
    text-align: center;
    padding: 4rem 2rem;
}

.auth-message {
    background: white;
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    max-width: 500px;
    margin: 0 auto;
}

.auth-message i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.auth-message h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.auth-message p {
    color: var(--medium-gray);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ==========================================================================
   FILTRES
   ========================================================================== */

.job-filters {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 2rem;
}

.filter-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(242, 76, 10, 0.1);
}

.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--medium-gray);
}

.filter-selects {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-selects select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    min-width: 150px;
}

.filter-selects select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* ==========================================================================
   GRILLE DES OFFRES
   ========================================================================== */

.job-offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* ==========================================================================
   CARTES D'OFFRES
   ========================================================================== */

.job-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.job-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.job-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.job-image {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.job-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-logo {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    padding: 1rem;
}

.job-placeholder {
    font-size: 3rem;
    color: var(--medium-gray);
}

.job-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.contract-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contract-cdi { background: #e8f5e8; color: #2d5a2d; }
.contract-cdd { background: #fff3cd; color: #856404; }
.contract-stage { background: #d1ecf1; color: #0c5460; }
.contract-alternance { background: #f8d7da; color: #721c24; }
.contract-freelance { background: #e2e3e5; color: #383d41; }

.date-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--medium-gray);
    font-size: 0.85rem;
}

.job-card-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.job-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.job-company,
.job-location,
.job-salary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--medium-gray);
    font-size: 0.9rem;
}

.job-company i,
.job-location i,
.job-salary i {
    color: var(--primary-color);
    width: 16px;
}

.job-excerpt {
    color: var(--medium-gray);
    line-height: 1.5;
    margin-top: 1rem;
}

.job-card-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

/* ==========================================================================
   BOUTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: center;
    justify-content: center;
}

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

.btn-primary:hover {
    background: #d63e08;
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

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

.btn-secondary:hover {
    background: var(--dark-gray);
    text-decoration: none;
    color: white;
}

/* ==========================================================================
   MODAL
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--medium-gray);
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--light-gray);
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ==========================================================================
   FORMULAIRE DE CANDIDATURE
   ========================================================================== */

.job-info {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.job-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--secondary-color);
}

.job-info p {
    margin: 0;
    color: var(--medium-gray);
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.required {
    color: var(--danger-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(242, 76, 10, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ==========================================================================
   UPLOAD DE FICHIER
   ========================================================================== */

.file-upload {
    position: relative;
}

.file-input-wrapper {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.file-input-wrapper:hover {
    border-color: var(--primary-color);
    background: rgba(242, 76, 10, 0.05);
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-display {
    pointer-events: none;
}

.file-input-display i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.file-input-display span {
    display: block;
    color: var(--medium-gray);
    font-size: 0.9rem;
}

/* ==========================================================================
   CHECKBOX PERSONNALISÉ
   ========================================================================== */

.consent {
    margin-top: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    line-height: 1.5;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ==========================================================================
   MESSAGE D'ABSENCE D'OFFRES
   ========================================================================== */

.no-jobs-found {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.no-jobs-found i {
    font-size: 4rem;
    color: var(--medium-gray);
    margin-bottom: 1rem;
}

.no-jobs-found h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.no-jobs-found p {
    color: var(--medium-gray);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

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

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

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .job-offers-page {
        padding: 1rem 0;
    }
    
    .page-header {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }
    
    .page-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .user-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .filter-selects {
        justify-content: stretch;
    }
    
    .filter-selects select {
        min-width: auto;
        flex: 1;
    }
    
    .job-offers-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .job-card-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .modal-footer {
        flex-direction: column-reverse;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.75rem;
    }
    
    .job-card-header,
    .job-card-body,
    .job-card-footer {
        padding: 1rem;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }
}

/* ==========================================================================
   LOADER ET ÉTATS
   ========================================================================== */

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}