
/* =====================================================
   ATHERIOT TRAVEL — MY JOBS
   Responsive bottom sheet | Global Light / Dark Themes
   ===================================================== */


/* =====================================================
   1. RESET & BASE
   ===================================================== */

.my-jobs-page,
.my-jobs-page *,
.my-jobs-page *::before,
.my-jobs-page *::after {
    box-sizing: border-box;
}

.my-jobs-page button {
    font: inherit;
}

.my-jobs-page button:focus-visible,
.my-jobs-page [role="button"]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}


/* =====================================================
   2. MY JOBS BOTTOM SHEET
   Matches Attendance sheet dimensions and animation
   ===================================================== */

.my-jobs-page {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 9999;

    display: flex;
    flex-direction: column;

    width: min(100%, 1050px);
    max-height: 92vh;
    max-height: 92dvh;

    background: var(--background);
    color: var(--text);

    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 24px 24px 0 0;

    box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.25);

    overflow: hidden;

    transform: translate(-50%, 100%);
    transition: transform 0.35s ease;
}

.my-jobs-page.active {
    transform: translate(-50%, 0);
}

.my-jobs-page[hidden] {
    display: none !important;
}


/* =====================================================
   3. HEADER
   ===================================================== */

.my-jobs-header {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    min-height: 76px;
    padding: 14px 22px;

    flex-shrink: 0;

    background: var(--surface);
    color: var(--heading);

    border-bottom: 1px solid var(--border);
}

.jobs-header-title {
    flex: 1;
    min-width: 0;
}

.jobs-header-title h2 {
    margin: 0;

    color: var(--heading);

    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
}

.jobs-header-title p {
    margin: 4px 0 0;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.4;
}


/* Header buttons */

.jobs-back-btn,
.jobs-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    flex-shrink: 0;

    padding: 0;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-secondary);
    color: var(--text);

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.jobs-back-btn:hover,
.jobs-refresh-btn:hover {
    background: var(--hover-bg);
    border-color: var(--input-border);
}

.jobs-back-btn i,
.jobs-refresh-btn i {
    width: 19px;
    height: 19px;
}


/* =====================================================
   4. FILTER CONTAINER
   ===================================================== */

.jobs-filter-container {
    display: flex;
    align-items: center;

    gap: 8px;

    padding: 13px 20px;

    flex-shrink: 0;

    width: calc(100% - 40px);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;


    background: var(--surface);
    border-bottom: 1px solid var(--border);

    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.jobs-filter-container::-webkit-scrollbar {
    display: none;
}


/* Filter buttons */

.job-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 38px;
    padding: 8px 13px;

    flex-shrink: 0;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface-secondary);
    color: var(--muted);

    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.job-filter i {
    width: 15px;
    height: 15px;
}

.job-filter span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 20px;
    height: 20px;

    padding: 0 5px;

    border-radius: 6px;

    background: var(--hover-bg);
    color: var(--muted);

    font-size: 11px;
    font-weight: 700;
}

.job-filter:hover {
    background: var(--hover-bg);
    color: var(--heading);
}

.job-filter.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.job-filter.active span {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}


/* =====================================================
   5. SCROLLABLE CONTENT
   ===================================================== */

.my-jobs-content {
    flex: 1;
    min-height: 0;

    padding: 18px 20px 25px;

    overflow-y: auto;
    overflow-x: hidden;

    background: var(--background);

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;
    scrollbar-color: var(--input-border) transparent;
}

.my-jobs-content::-webkit-scrollbar {
    width: 6px;
}

.my-jobs-content::-webkit-scrollbar-track {
    background: transparent;
}

.my-jobs-content::-webkit-scrollbar-thumb {
    background: var(--input-border);
    border-radius: 20px;
}


/* =====================================================
   6. JOB LIST HEADING
   ===================================================== */

.jobs-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin: 0 0 15px;
}

.jobs-list-heading h3 {
    margin: 0;

    color: var(--heading);

    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.jobs-list-heading span {
    color: var(--muted);

    font-size: 12px;
    text-align: right;
}


/* =====================================================
   7. JOB LIST
   ===================================================== */

.my-jobs-list {
    display: flex;
    flex-direction: column;

    gap: 12px;

    width: 100%;
    min-width: 0;
}


/* =====================================================
   8. JOB CARD
   ===================================================== */

.my-job-card {
    display: flex;
    align-items: center;

    gap: 14px;

    width: 100%;
    min-width: 0;

    padding: 16px;

    background: var(--surface);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 14px;

    box-shadow: var(--shadow);

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.my-job-card:hover {
    background: var(--hover-bg);
    border-color: var(--input-border);

    box-shadow: var(--shadow);
}

.my-job-card:active {
    transform: scale(0.995);
}


/* Job icon */

.my-job-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;
    flex-shrink: 0;

    border-radius: 13px;

    background: var(--empty-icon-bg);
    color: var(--empty-icon-color);

    font-size: 20px;
}


/* Job information */

.my-job-info {
    flex: 1;
    min-width: 0;
}


/* Job title and status */

.my-job-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    min-width: 0;
    margin-bottom: 9px;
}

.my-job-name {
    min-width: 0;
    margin: 0;

    color: var(--heading);

    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;

    overflow-wrap: anywhere;
}


/* =====================================================
   9. JOB STATUS BADGES
   ===================================================== */

.my-job-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 24px;
    padding: 4px 9px;

    flex-shrink: 0;

    border-radius: 20px;

    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;

    white-space: nowrap;
}


/* Assigned / Pending */

.my-job-status.status-assigned,
.my-job-status.status-pending {
    background: rgba(8, 123, 255, 0.10);
    color: var(--primary);
}


/* Accepted */

.my-job-status.status-accepted {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
}


/* In progress */

.my-job-status.status-in_progress {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}


/* On hold */

.my-job-status.status-on_hold {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}


/* Completed */

.my-job-status.status-completed {
    background: rgba(107, 114, 128, 0.13);
    color: var(--muted);
}


/* Cancelled */

.my-job-status.status-cancelled {
    background: rgba(220, 53, 69, 0.12);
    color: var(--danger);
}


/* Dark theme status contrast */

body.dark .my-job-status.status-assigned,
body.dark .my-job-status.status-pending {
    color: #60a5fa;
}

body.dark .my-job-status.status-accepted {
    color: #38bdf8;
}

body.dark .my-job-status.status-in_progress {
    color: #4ade80;
}

body.dark .my-job-status.status-on_hold {
    color: #fbbf24;
}

body.dark .my-job-status.status-cancelled {
    color: #f87171;
}


/* =====================================================
   10. JOB METADATA
   ===================================================== */

.my-job-meta {
    display: flex;
    flex-direction: column;

    gap: 6px;

    min-width: 0;
}

.my-job-meta > div {
    display: flex;
    align-items: center;

    gap: 8px;

    min-width: 0;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.5;
}

.my-job-meta i {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 14px;
    height: 14px;
    flex-shrink: 0;

    color: var(--muted);

    font-size: 12px;
}

.my-job-meta span {
    min-width: 0;

    overflow-wrap: anywhere;
}


/* Scheduled date and time */

.my-job-meta .my-job-schedule {
    color: var(--primary);
    font-weight: 600;
}


/* Right arrow */

.my-job-arrow {
    flex-shrink: 0;

    color: var(--muted);

    font-size: 14px;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.my-job-card:hover .my-job-arrow {
    color: var(--primary);
    transform: translateX(3px);
}


/* =====================================================
   11. EMPTY STATE
   ===================================================== */

.jobs-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 240px;

    padding: 30px 20px;

    text-align: center;

    background: var(--surface);

    border: 1px dashed var(--empty-border);
    border-radius: 14px;
}

.jobs-empty-state[hidden] {
    display: none !important;
}

.jobs-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 64px;
    height: 64px;

    margin-bottom: 15px;

    border-radius: 18px;

    background: var(--empty-icon-bg);
    color: var(--empty-icon-color);

    font-size: 28px;
}

.jobs-empty-icon i {
    width: 29px;
    height: 29px;
}

.jobs-empty-state h3 {
    margin: 0 0 7px;

    color: var(--heading);

    font-size: 16px;
    font-weight: 700;
}

.jobs-empty-state p {
    max-width: 330px;

    margin: 0;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.6;
}


/* =====================================================
   12. FOOTER NOTE
   ===================================================== */

.jobs-footer-note {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-top: 18px;
    padding: 12px 14px;

    border-radius: 10px;

    background: var(--surface-secondary);
    color: var(--muted);

    font-size: 12px;
    line-height: 1.5;
}

.jobs-footer-note i {
    flex-shrink: 0;

    width: 15px;
    height: 15px;
}


/* =====================================================
   13. RESPONSIVE — TABLET
   ===================================================== */

@media (max-width: 768px) {

    .my-jobs-page {
        width: 100%;
        max-height: 92vh;
        max-height: 92dvh;

        border-radius: 22px 22px 0 0;
    }

    .my-jobs-header {
        padding: 13px 17px;
    }

    .jobs-filter-container {
        padding: 11px 15px;
    }

    .my-jobs-content {
        padding: 16px 15px 22px;
    }

    .my-job-card {
        padding: 14px;
        gap: 12px;
    }

}


/* =====================================================
   14. RESPONSIVE — MOBILE
   ===================================================== */

@media (max-width: 480px) {

    .my-jobs-page {
        max-height: 94vh;
        max-height: 94dvh;

        border-radius: 20px 20px 0 0;
    }

    .my-jobs-header {
        min-height: 68px;
        padding: 11px 13px;
        gap: 10px;
    }

    .jobs-header-title h2 {
        font-size: 19px;
    }

    .jobs-header-title p {
        font-size: 12px;
    }

    .jobs-back-btn,
    .jobs-refresh-btn {
        width: 38px;
        height: 38px;
    }

    .jobs-filter-container {
        gap: 7px;
        padding: 10px 12px;
    }

    .job-filter {
        min-height: 36px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .my-jobs-content {
        padding: 14px 12px 20px;
    }

    .jobs-list-heading {
        margin-bottom: 12px;
    }

    .jobs-list-heading h3 {
        font-size: 16px;
    }

    .jobs-list-heading span {
        font-size: 11px;
    }

    .my-jobs-list {
        gap: 10px;
    }

    .my-job-card {
        gap: 10px;
        padding: 12px;
        border-radius: 12px;
    }

    .my-job-icon {
        width: 42px;
        height: 42px;
        border-radius: 11px;
        font-size: 18px;
    }

    .my-job-name {
        font-size: 14px;
    }

    .my-job-status {
        min-height: 22px;
        padding: 3px 7px;
        font-size: 9px;
    }

    .my-job-meta {
        gap: 5px;
    }

    .my-job-meta > div {
        gap: 6px;
        font-size: 11px;
    }

    .my-job-arrow {
        font-size: 12px;
    }

}


/* =====================================================
   15. RESPONSIVE — VERY NARROW SCREENS
   ===================================================== */

@media (max-width: 350px) {

    .my-jobs-header {
        padding-inline: 10px;
    }

    .jobs-filter-container {
        padding-inline: 9px;
    }

    .my-jobs-content {
        padding-inline: 9px;
    }

    .job-filter {
        gap: 5px;
        padding-inline: 8px;
        font-size: 11px;
    }

    .my-job-card {
        gap: 8px;
        padding: 10px;
    }

    .my-job-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .my-job-top {
        flex-wrap: wrap;
        gap: 5px;
    }

    .my-job-name {
        font-size: 13px;
    }

    .my-job-status {
        font-size: 9px;
    }

    .my-job-meta > div {
        font-size: 10px;
    }

    .jobs-list-heading span {
        display: none;
    }

}


/* =====================================================
   16. REDUCED MOTION
   ===================================================== */

@media (prefers-reduced-motion: reduce) {

    .my-jobs-page,
    .my-jobs-page *,
    .my-jobs-page *::before,
    .my-jobs-page *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

}



/* ==========================================
   MY JOBS — FULL SCREEN ON Below 1000px
========================================== */

@media (max-width: 1000px) {

    .my-jobs-page {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        min-height: 100%;
        border-radius: 0;
        border: none;

        /* Closed position */
        transform: translateY(100%);
    }

    .my-jobs-page.active {
        /* Open position */
        transform: translateY(0);
    }

}


.my-jobs-overlay {
    position: fixed;
    inset: 0;
    z-index: 9997;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.my-jobs-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


