/* ===============================
   🌐 GLOBAL
=================================*/
body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f7f6fb;
    margin: 0;
    color: #333;
    line-height: 1.6;
}

/* ===============================
   🔝 NAVBAR
=================================*/
nav, .topbar {
    background: #4c1d95;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

nav h1, .brand {
    margin: 0;
    font-size: 1.5em;
    font-weight: bold;
}

nav a, .topbar a {
    color: white;
    text-decoration: none;
    margin-left: 15px;
    font-weight: 500;
}

nav a:hover, .topbar a:hover {
    text-decoration: underline;
}

/* ===============================
   🧩 CARD & CONTENT
=================================*/
.card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 1100px;
    margin: 40px auto;
    text-align: left;
}

/* ===============================
   🎯 FORMS (générique)
=================================*/
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="file"],
form input[type="tel"] {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

form label {
    font-weight: 600;
    color: #333;
}

.btn {
    background: #4c1d95;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.btn:hover {
    background: #5b21b6;
}

/* ===============================
   💼 TABLES (Liste d’offres)
=================================*/
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 25px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.table-container th,
.table-container td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.table-container th {
    background: #4c1d95;
    color: #fff;
}

/* ✅ Lignes alternées */
.table-container table tbody tr:nth-child(odd) {
    background: #ffffff;
}
.table-container table tbody tr:nth-child(even) {
    background: #f3e8ff;
}

/* Hover */
.table-container table tbody tr:hover {
    background: #ede9fe;
    transition: background-color 0.2s ease-in-out;
}

.table-container td {
    word-break: break-word;
}

/* ===============================
   📊 Résumé résultats
=================================*/
.results-info {
    margin-top: 15px;
    color: #4c1d95;
    font-weight: 500;
}

/* ===============================
   💡 PAGINATION
=================================*/
.smart-pagination {
    margin: 25px 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.page-btn,
.smart-pagination span {
    display: inline-block;
    padding: 7px 13px;
    border: 1px solid #4c1d95;
    border-radius: 10px;
    background-color: white;
    color: #4c1d95;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.25s ease-in-out;
    min-width: 34px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.page-btn:hover {
    background-color: #4c1d95;
    color: white;
    transform: translateY(-1px);
}

.page-btn.active,
.smart-pagination span.active {
    background-color: #4c1d95;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.dots {
    color: #999;
    padding: 0 5px;
}

/* ===============================
   💼 JOB DETAIL PAGE
=================================*/
.job-detail-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 20px;
}

.job-detail-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 30px 40px;
    max-width: 750px;
    width: 100%;
    text-align: left;
}

.job-detail-card h1.job-title {
    color: #4c1d95;
    text-align: center;
    margin-bottom: 10px;
}

.job-section {
    margin-top: 25px;
}

.job-section h2 {
    color: #4c1d95;
    font-size: 1.1em;
    margin-bottom: 8px;
    border-bottom: 2px solid #ede9fe;
    padding-bottom: 4px;
}

.job-description p {
    color: #444;
    line-height: 1.7;
    white-space: pre-line;
}

.job-contact {
    background: #f8f5ff;
    border-left: 4px solid #4c1d95;
    border-radius: 6px;
    padding: 15px 20px;
}

.btn-return {
    display: inline-block;
    background: #4c1d95;
    color: white;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 30px;
}

.btn-return:hover {
    background: #5b21b6;
}

/* ===============================
   ⚙️ FOOTER
=================================*/
footer {
    background: #ede9fe;
    color: #4c1d95;
    text-align: center;
    padding: 15px;
    font-size: 14px;
    margin-top: 40px;
    border-top: 1px solid #ddd;
}

/* ===============================
   👤 REGISTER / LOGIN FORMS
=================================*/
.register-card {
    max-width: 650px;
    margin: 60px auto;
}

.register-card input[type="text"],
.register-card input[type="email"],
.register-card input[type="tel"],
.register-card input[type="password"],
.register-card input[type="file"] {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

.register-card label {
    font-weight: 600;
    color: #333;
}

.register-card .btn {
    width: 100%;
    text-align: center;
    font-size: 16px;
}

.card h3 {
    color: #4c1d95;
    margin-top: 25px;
    border-bottom: 2px solid #ede9fe;
    padding-bottom: 5px;
}

.card ul {
    margin-left: 20px;
    line-height: 1.7;
}

/* ===============================
   ⚡ FLASH MESSAGES (fusionnés)
=================================*/
.flash-messages-global, .flash-messages {
    margin: 20px auto;
    max-width: 900px;
    padding: 0 20px;
}

.flash {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.flash.success {
    background: #e6f4ea;
    color: #1e7e34;
    border-left: 4px solid #28a745;
}

.flash.error {
    background: #fdecea;
    color: #d93025;
    border-left: 4px solid #d93025;
}

.flash.info {
    background: #f0f4ff;
    color: #1a56db;
    border-left: 4px solid #1a56db;
}

/* ===============================
   🧾 ERREURS FORMULAIRES
=================================*/
.error-message {
    color: #d93025;
    font-size: 13px;
    margin-top: 3px;
    margin-bottom: 10px;
}

input:invalid {
    border-color: #d93025;
}

/* ===============================
   📱 RESPONSIVE
=================================*/
@media (max-width: 768px) {
    nav, .topbar {
        flex-direction: column;
        text-align: center;
    }
    nav h1 {
        margin-bottom: 10px;
    }

    .card {
        margin: 20px;
        padding: 20px;
    }

    .table-container {
        border-radius: 10px;
        box-shadow: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -10px;
        padding: 0 10px;
    }

    .table-container table {
        width: 100%;
        min-width: 600px;
        font-size: 13px;
    }

    .table-container th,
    .table-container td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    .smart-pagination {
        gap: 5px;
        flex-wrap: wrap;
    }

    .page-btn,
    .smart-pagination span {
        font-size: 13px;
        padding: 6px 10px;
        border-radius: 8px;
        min-width: 28px;
    }

    .job-detail-card {
        margin: 20px;
        padding: 20px;
    }

    h1.job-title {
        font-size: 20px;
    }

    .job-section h2 {
        font-size: 16px;
    }

    .btn-return {
        display: block;
        width: 80%;
        margin: 25px auto 0;
    }
}

@media (max-width: 600px) {
    .two-cols {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .table-container table {
        min-width: 500px;
    }

    .table-container th,
    .table-container td {
        font-size: 12px;
    }
}

/* ===============================
   📱 OPTIMISATION MOBILE JOBS LIST
=================================*/
@media (max-width: 768px) {
    .job-table,
    .job-table thead,
    .job-table tbody,
    .job-table th,
    .job-table td,
    .job-table tr {
        display: block;
        width: 100%;
    }

    .job-table thead { display: none; }

    .job-table tr {
        margin-bottom: 12px;
        background: #fdfcff;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        padding: 10px 12px;
        border-left: 5px solid #4c1d95;
    }

    .job-table td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid #eee;
        font-size: 15px;
    }

    .job-table td::before {
        content: attr(data-label);
        flex: 1;
        font-weight: 600;
        color: #4c1d95;
        margin-right: 8px;
    }

    .job-table td:last-child {
        border-bottom: none;
    }

    .job-table tr:nth-child(even) {
        background: #f5edff;
    }

    .job-table a {
        color: #4c1d95;
        font-weight: 600;
        text-decoration: none;
    }

    .job-table a:hover {
        text-decoration: underline;
    }
}
