/* =====================================================================
 * MoversBoard — Grid View
 *
 * Container:   .jobs-grid                (auto-fill grid, 340px min)
 * Card:        .job-card                 (vertical block of: top, route,
 *                                         meta, footer + absolute status badge)
 * Sub-parts:   .job-type-badge, .job-id, .job-price, .job-route,
 *              .route-point/city/state/zip/arrow, .job-meta, .meta-item,
 *              .job-card-footer, .job-posted, .job-actions, .job-card-status
 *
 * The same .job-card markup is reused by List view; List only changes the
 * orientation via .list-view modifier (see list-view.css).
 * ===================================================================== */

/* ---------- Container grid ---------- */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}

/* ---------- Card shell ---------- */
.job-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.job-card:hover {
    border-color: #d1d5db;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.job-card:active { transform: translateY(0); }

/* ---------- Top row: type badge + id + price ---------- */
.job-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.job-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.badge-load     { background: var(--blue-light);   color: var(--blue);   }
.badge-pickup   { background: var(--orange-light); color: var(--orange); }
.badge-delivery { background: var(--green-light);  color: var(--green);  }

.job-id {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.job-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* ---------- Route block ---------- */
.job-route {
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-point {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.route-city {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-state {
    font-size: 12px;
    color: var(--text-secondary);
}

.route-zip {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.route-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

/* ---------- Meta row (date, size, weight, distance) ---------- */
.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.meta-item svg { flex-shrink: 0; opacity: 0.6; }

/* ---------- Footer: posted-time + Details button ---------- */
.job-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.job-posted {
    font-size: 12px;
    color: var(--text-muted);
}

.job-actions { display: flex; gap: 4px; }

/* ---------- Status badge (absolute, top-right) ---------- */
.job-card-status {
    position: absolute;
    top: 0;
    right: 0;
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0 var(--radius-lg) 0 var(--radius);
}

.status-open       { background: var(--green-light);  color: var(--green);      }
.status-pending    { background: var(--orange-light); color: var(--orange);     }
.status-in-transit { background: var(--blue-light);   color: var(--blue);       }
.status-completed  { background: var(--accent-light); color: var(--text-muted); }
.status-requested  { background: #eff6ff;             color: #1d4ed8;           }
.status-accepted   { background: #ecfeff;             color: #0e7490;           }
.status-cancelled  { background: #fef2f2;             color: #b91c1c;           }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .jobs-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

@media (max-width: 768px) {
    .jobs-grid { grid-template-columns: 1fr; }
}
