﻿/* ============================
   JOBS LIST PAGE - jobList.css
   ============================ */
button:focus {
    outline: none;
}

/* Hero Section */
.jobs-hero {
    background: linear-gradient(135deg, var(--brand-softer) 0%, var(--brand-soft) 100%);
    padding: 10px 0 30px;
}

    .jobs-hero h1 {
        font-size: 38px;
        font-weight: 700;
        color: #1e293b;
        line-height: 1.2;
    }

    .jobs-hero p {
        color: #64748b;
        font-size: 16px;
        margin-top: 10px;
    }

/* Hero Illustration */
.hero-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Search Bar - three separate fields */
.hero-wrapper {
    background-color: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px solid rgb(var(--brand-rgb) / 0.09);
}
.hero-search-wrap {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 14px;
/*    margin-top: 30px;*/
}

    .hero-search-wrap .search-field {
        background: #fff;
        border-radius: 10px;
/*        box-shadow: 0 4px 24px rgba(0,0,0,0.08);*/
        border: 1px solid #ddd;
        padding: 10px 14px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .hero-search-wrap .search-field-keyword {
        flex: 2 1 320px;
    }

    .hero-search-wrap .search-field-location {
        flex: 1 1 200px;
    }

    .hero-search-wrap .search-icon {
        color: #94a3b8;
        flex-shrink: 0;
    }

    .hero-search-wrap .search-field svg {
        color: #94a3b8;
        flex-shrink: 0;
    }

    .hero-search-wrap input {
        border: none;
        outline: none;
        flex: 1;
        min-width: 0;
        font-size: 15px;
        color: #334155;
        background: transparent;
    }

        .hero-search-wrap input::placeholder {
            color: #94a3b8;
        }

    .hero-search-wrap .btn-search {
        color: #fff;
        border: none;
        border-radius: 10px;
        padding: 12px 28px;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
        transition: background 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex: 0 0 auto;
    }

        .hero-search-wrap .btn-search:hover {
            background: var(--brand-hover);
        }

.field-clear-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    color: #94a3b8;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.2s, color 0.2s;
}

    .field-clear-btn:hover {
        background: #e2e8f0;
        color: #475569;
    }

.search-field.has-value .field-clear-btn {
    display: flex;
}

/* Popular Tags */
.popular-tags {
    margin-top: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

    .popular-tags span {
        font-size: 13px;
        color: #000;
        font-weight: 500;
    }

    .popular-tags .tag-pill {
        background: rgb(var(--brand-rgb) / 0.08);
        border-radius: 20px;
        padding: 4px 14px;
        font-size: 13px;
        color: #475569;
        cursor: pointer;
        transition: all 0.2s;
    }

        .popular-tags .tag-pill:hover {
            background: var(--brand);
            color: #fff;
            border-color: var(--brand);
        }

/* Main Layout */
.jobs-main {
    padding: 36px 0 60px;
    background: #fff;
    min-height: 70vh;
}

/* =====================
   FILTERS SIDEBAR
   ===================== */
.filters-sidebar {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px solid #dddddd8a;
/*    box-shadow: 0 2px 12px rgba(0,0,0,0.06);*/
    position: sticky;
    top: 20px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

    .filters-header h5 {
        font-size: 16px;
        font-weight: 700;
        color: #1e293b;
        margin: 0;
    }

    .filters-header a {
        font-size: 13px;
        text-decoration: none;
        font-weight: 500;
    }

    .filters-header a:hover {
        color: var(--brand);
    }

        .filters-close-btn {
            background: none;
            border: none;
            color: #94a3b8;
            padding: 0;
            margin-left: 14px;
            display: flex;
            align-items: center;
            cursor: pointer;
        }

            .filters-close-btn:hover {
                color: var(--brand);
            }

#filters-backdrop {
    display: none;
}

/* ===== Mobile off-canvas sidebar ===== */
@media (max-width: 991px) {
    #filters-col {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 300px;
        max-width: 85vw;
        z-index: 1050;
        padding: 0;
        background: #f8fafc;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform 0.3s ease;
        box-shadow: 8px 0 30px rgba(0,0,0,0.15);
    }

        #filters-col.show-offcanvas {
            transform: translateX(0);
        }

    .filters-sidebar {
        position: static;
        box-shadow: none;
        padding: 20px 20px 40px;
        border-radius: 0;
        min-height: 100%;
    }

    #filters-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

        #filters-backdrop.show {
            opacity: 1;
            visibility: visible;
        }
}

@media (min-width: 992px) {
    .filters-close-btn {
        display: none !important;
    }
}

.filter-group {
    border-top: 1px solid #f1f5f9;
    padding: 18px 0;
}

    .filter-group:last-child {
        padding-bottom: 0;
    }

.filter-group-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

    .filter-group-title span {
        font-size: 14px;
        font-weight: 600;
        color: #334155;
    }

    .filter-group-title svg {
        color: #94a3b8;
        transition: transform 0.2s;
    }

.collapsible .filter-group-title {
    cursor: pointer;
    user-select: none;
}

.filter-group-body {
    max-height: 1000px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.2s ease;
}

.collapsible .filter-group-title.collapsed svg {
    transform: rotate(-90deg);
}

.collapsible .filter-group-title.collapsed + .filter-group-body {
    max-height: 0;
    opacity: 0;
    margin: 0;
}

/* Sort By */
.sort-select {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    color: #475569;
    outline: none;
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center, #fff;
}

/* Checkboxes */
.filter-checkbox-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

    .filter-checkbox-item label {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        color: #475569;
        cursor: pointer;
        margin: 0;
    }

    .filter-checkbox-item input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: var(--brand);
        cursor: pointer;
        flex-shrink: 0;
    }

    .filter-checkbox-item .count {
        font-size: 12px;
        color: #94a3b8;
        background: #f1f5f9;
        border-radius: 10px;
        padding: 1px 8px;
    }

.show-more-btn {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

/* Location Search */
.location-filter-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 9px 12px 9px 34px;
    font-size: 14px;
    color: #475569;
    outline: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat left 10px center;
    margin-bottom: 12px;
}

/* Salary Range */
.salary-range-wrap {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

    .salary-range-wrap input {
        width: 50%;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 8px 10px;
        font-size: 13px;
        color: #475569;
        outline: none;
    }

/* =====================
   JOB LIST AREA
   ===================== */
.jobs-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

    .jobs-list-header .result-count {
        font-size: 15px;
        color: #475569;
    }

.list-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-toggle-filters {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    height: 36px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

    .btn-toggle-filters:hover {
        border-color: var(--brand);
        color: var(--brand);
    }

    .btn-toggle-filters.active {
        background: var(--brand);
        border-color: var(--brand);
        color: #fff;
    }

.view-toggle {
    display: flex;
    gap: 1px;
    background-color: #dddddd8a;
    padding: 3px;
    border-radius: 6px;
}

    .view-toggle button {
        background: #eee;
        border: 1px solid #dddddd8a;
        border-radius: 4px;
        width: 50px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #94a3b8;
        cursor: pointer;
        transition: all 0.2s;
    }

    .view-toggle button.active {
        background: #fff;
        color: var(--brand);
    }

    .view-toggle button:hover {
        color: var(--brand);
    }

/* Job Card */
.jd-job-card-new {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #dddddd8a;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    display: flex;
    align-items: stretch;
    gap: 16px;
}

    .jd-job-card-new:hover {
        box-shadow: 0 6px 24px rgb(var(--brand-rgb) / 0.12);
        transform: translateY(-2px);
        border-color: rgb(var(--brand-rgb) / 0.21);
    }

    .jd-job-card-new.govt-job {
        background: rgb(var(--accent-rgb) / 0.05);
        border-left: 3px solid var(--accent);
    }

    .jd-job-card-new.featured-job {
        background: #F4F3FE;
        border-left: 3px solid #7367F0;
    }

    .jd-job-card-new.jd-featured-job {
        background: #FDF1F1;
        border-left: 3px solid #FF0000;
    }

/* Company Logo */
.badge_btn {
    display: none;
}

.card-logo-wrap {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 1px solid #eee;
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

    .card-logo-wrap img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

/* Card Body */
.card-body-new {
    flex: 1;
    min-width: 0;
}

.card-top-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-title-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.card-job-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    display: block;
}

    .card-job-title:hover {
        color: var(--brand);
    }

.card-company-name {
    font-size: 14px;
    color: var(--brand);
    font-weight: 500;
    display: flex;
    align-items: start;
    gap: 4px;
    margin-top: 2px;
}

    .card-company-name svg {
        color: var(--brand);
    }

/* Badge */
.job-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    flex-shrink: 0;
    display: inline-block;
    margin-bottom: 6px;
}

    .job-badge.new {
        background: #dcfce7;
        color: #16a34a;
    }

    .job-badge.hot {
        background: #fee2e2;
        color: #dc2626;
    }

    .job-badge.govt {
        background: var(--brand-soft);
        color: var(--brand);
    }

    .job-badge.featured {
        background: #ede9fe;
        color: #7c3aed;
    }

/* Meta Row */
.card-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    align-items: center;
}

.meta-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #64748b;
}

    .meta-chip svg {
        flex-shrink: 0;
    }

/* Tags Row */
.card-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.card-tag {
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 6px;
}

    .card-tag.more {
        background: #e0f2fe;
        color: #0369a1;
        border: 1px solid #bae6fd;
    }

/* Card Right */
.card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    align-self: stretch;
}

.card-time-ago {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-bookmark {
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-bookmark:hover {
        background: #f0f9ff;
        border-color: var(--brand);
        color: var(--brand);
    }

.btn-apply-now {
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    white-space: nowrap;
}

    .btn-apply-now:hover {
        background: var(--brand-hover);
        color: #fff;
        text-decoration: none;
    }

.btn-details-now {
    background: #fff;
    border: 1px solid var(--brand);
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

    .btn-details-now:hover {
        background: var(--brand);
        color: #fff;
        text-decoration: none;
    }

/* =====================
   GRID VIEW
   ===================== */
#jb-list.grid-view {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

    #jb-list.grid-view .jd-job-card-new {
        margin-bottom: 0;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    #jb-list.grid-view .card-logo-wrap {
        flex: 0 0 auto;
    }

    #jb-list.grid-view .card-body-new {
        flex: 1 1 0;
        min-width: 0;
    }

    #jb-list.grid-view .card-right {
/*        flex: 1 1 100%;*/
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-top: 14px;
    }

@media (max-width: 1200px) {
    #jb-list.grid-view {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    #jb-list.grid-view {
        grid-template-columns: 1fr;
    }
}

/* Not Found */
#not_found {
    text-align: center;
    padding: 60px 20px;
}

    #not_found svg {
        max-width: 220px;
        margin-bottom: 20px;
    }

#no_res_value {
    font-size: 18px;
    color: #94a3b8;
}

/* Pagination */
.pagination-wrap {
    margin-top: 30px;
}

.pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    padding: 0;
    margin: 0;
    list-style: none;
}

    .pagination ul li {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 500;
        color: #475569;
        background: #fff;
        border: 1px solid #e2e8f0;
        cursor: pointer;
        user-select: none;
        transition: all 0.2s;
    }

        .pagination ul li.active,
        .pagination ul li:hover {
            background: var(--brand);
            border-color: var(--brand);
            color: #fff;
        }

        .pagination ul li.btn {
            width: auto;
            padding: 0 16px;
            border-radius: 10px;
        }

        .pagination ul li.dots {
            border: none;
            background: transparent;
            cursor: default;
        }

/* Responsive */
@media (max-width: 991px) {
    .filters-sidebar {
        margin-bottom: 24px;
        position: static;
    }

    .jobs-hero h1 {
        font-size: 28px;
    }

    .card-right {
        flex-direction: row;
        align-items: center;
        width: 100%;
    }

    .jd-job-card-new {
        flex-direction: column;
    }
    .logo_badge_btn {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
    .badge_btn{
        display: flex;
        flex-direction: column;
        align-items: end;
    }
    .hide-badge-btn{
        display: none;
    }

/*    .card-logo-wrap {
        width: 48px;
        height: 48px;
    }*/
}

@media (max-width: 576px) {
    .hero-search-wrap .search-field-keyword,
    .hero-search-wrap .search-field-location {
        flex: 1 1 100%;
    }

    .hero-search-wrap .btn-search {
        width: 100%;
        justify-content: center;
    }

    .card-meta-row {
        gap: 10px;
    }
    .list-header-actions{
        width: 100%;
    }
}

/* Subtle loading state while a filter/search AJAX is in flight */
#jb-list.is-loading {
    opacity: .55;
    pointer-events: none;
    transition: opacity .12s ease;
}

/* ============================
   JOB DETAILS MODAL (crawled jobs)
   Layout: .job-modal is a flex COLUMN —
     [close] + [.job-modal-scroll (flex:1, scrolls)] + [footer (pinned)]
   so the action button is always reachable and only the body scrolls.
   ============================ */
body.modal-open {
    overflow: hidden;
    /* keep iOS from scrolling the page behind the sheet */
    touch-action: none;
}

.job-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 32px 20px;
}

.job-modal-overlay.open {
    display: flex;
}

.job-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    /* Grow into the space when there is some, stay comfortable when there isn't. */
    max-width: 860px;
    max-height: calc(100vh - 64px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: jmIn .18s ease;
}

/* Wider screens → wider dialog */
@media (min-width: 1280px) {
    .job-modal { max-width: 1000px; }
}

@media (min-width: 1600px) {
    .job-modal { max-width: 1120px; }
}

@keyframes jmIn {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

/* Scrollable body region */
.job-modal-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 28px 30px 8px;
}

.job-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #f3f4f6;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #4b5563;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background .15s ease;
}

.job-modal-close:hover { background: #e5e7eb; }

.job-modal-loading { display: flex; justify-content: center; padding: 60px 0; }

.jm-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: jmSpin .8s linear infinite;
}

@keyframes jmSpin { to { transform: rotate(360deg); } }

.job-modal-error { padding: 50px 10px; text-align: center; color: #9aa4b2; font-size: 16px; }

/* Header */
.jm-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    /* leave room for the close button */
    padding-right: 46px;
}

.jm-logo img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    background: #fff;
    padding: 4px;
}

.jm-head-text { flex: 1; min-width: 0; }

.jm-head-text h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 4px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.jm-company { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.jm-meta { font-size: 13.5px; color: #6b7280; margin-top: 4px; }

.jm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; }

.jm-chip {
    color: var(--brand);
    background-color: rgb(var(--brand-rgb) / 0.08);
    font-size: 12.5px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 20px;
}

/* Two-column body on wide screens (single column when the side col is empty) */
.jm-grid { display: grid; grid-template-columns: 1fr; }

@media (min-width: 900px) {
    .jm-grid:not(.no-side) {
        grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
        column-gap: 34px;
    }
    /* the divider reads better as one rule across the whole row */
    .jm-grid:not(.no-side) .jm-col-side .jm-section:first-child { border-top-color: #f0f1f4; }
}

.jm-col-main, .jm-col-side { min-width: 0; }

.jm-section { padding: 20px 0; border-top: 1px solid #f0f1f4; }
.jm-section h4 { font-size: 15px; font-weight: 700; color: #1f2937; margin: 0 0 10px; }

.jm-section p {
    font-size: 14.5px;
    color: #4b5563;
    line-height: 1.6;
    margin: 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.jm-section ul { margin: 0; padding-left: 18px; }
.jm-section ul li { font-size: 14px; color: #4b5563; line-height: 1.55; margin-bottom: 6px; overflow-wrap: anywhere; }

.jm-skills { display: flex; flex-wrap: wrap; gap: 8px; }

.jm-skill {
    background: #f3f4f6;
    color: #4b5563;
    font-size: 12.5px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 8px;
}

    .jm-skill.must {
        background: rgb(var(--accent-rgb) / 0.1);
        color: var(--brand);
    }

/* Footer — pinned (flex sibling, never overlaps content) */
.job-modal-footer {
    flex: 0 0 auto;
    background: #fff;
    padding: 14px 30px;
    border-top: 1px solid #eef0f3;
    display: flex;
    justify-content: flex-end;
}

.btn-login-apply {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 26px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
    min-height: 46px;
}

.btn-login-apply:hover { background: var(--brand-hover); }

/* ---- Tablet ---- */
@media (max-width: 900px) {
    .job-modal-overlay { padding: 24px 16px; }
    .job-modal { max-height: calc(100vh - 48px); }
    .job-modal-scroll { padding: 26px 24px 8px; }
    .job-modal-footer { padding: 14px 24px; }
}

/* ---- Phone: full-screen sheet ---- */
@media (max-width: 640px) {
    .job-modal-overlay { padding: 0; align-items: stretch; }

    .job-modal {
        max-width: none;
        border-radius: 0;
        /* dynamic viewport unit avoids the iOS URL-bar gap; vh is the fallback */
        height: 100vh;
        height: 100dvh;
        max-height: none;
        animation: jmSheetIn .2s ease;
    }

    .job-modal-scroll {
        padding: 20px 18px 8px;
        /* clear the notch / status bar area */
        padding-top: max(20px, env(safe-area-inset-top));
    }

    .job-modal-close { top: 10px; right: 10px; }

    .jm-header { gap: 12px; padding-right: 44px; }
    .jm-logo img { width: 52px; height: 52px; }
    .jm-head-text h3 { font-size: 19px; }
    .jm-company { font-size: 14px; }

    .job-modal-footer {
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        justify-content: stretch;
    }

    .btn-login-apply { width: 100%; justify-content: center; }
}

@keyframes jmSheetIn {
    from { transform: translateY(24px); opacity: .6; }
    to   { transform: none; opacity: 1; }
}

/* Short landscape phones — keep the footer reachable, trim vertical padding */
@media (max-height: 460px) and (max-width: 900px) {
    .job-modal-scroll { padding-top: 14px; }
    .jm-section { padding: 14px 0; }
    .jm-chips { margin: 12px 0 0; }
}

/* Respect reduced-motion; also guarantees the sheet never sits mid-transform
   if the entry animation is interrupted. */
@media (prefers-reduced-motion: reduce) {
    .job-modal { animation: none !important; }
    .jm-spinner { animation-duration: 1.6s; }
}

/* ============================
   TOUCH ERGONOMICS
   Phones/tablets: enlarge hit areas that are fine for a mouse but
   fiddly for a thumb. Desktop styling is untouched.
   ============================ */
@media (max-width: 991px) {
    .popular-tags .tag-pill {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

    .filters-close-btn {
        width: 40px;
        height: 40px;
        justify-content: center;
        margin-left: 6px;
        margin-right: -8px;
    }

    .show-more-btn {
        min-height: 40px;
        padding: 8px 0;
    }

    .btn-bookmark {
        width: 38px;
        height: 38px;
    }

    /* whole row is tappable, not just the 16px checkbox */
    .filter-checkbox-item label {
        min-height: 38px;
        flex: 1;
    }

    .view-toggle button {
        height: 38px;
        min-width: 46px;
    }

    .pagination ul li {
        width: 42px;
        height: 42px;
    }

    .pagination ul li.btn {
        width: auto;
        min-width: 42px;
    }

    /* iOS zooms the page when a focused input is under 16px */
    .location-filter-input,
    .salary-range-wrap input,
    .sort-select,
    .hero-search-wrap input {
        font-size: 16px;
    }
}


/* Pagination entries and search pills are real links (crawlable); keep their old look */
.pagination ul li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}
.pagination ul li.btn a { padding: 0 2px; }
a.tag-pill,
a.tag-pill:hover { text-decoration: none; }
