/* ================================================================
   JBM Job Fit — AI Compatibility Score
   ================================================================ */

/* ── Section Banner (inside .container.job-detail) ─────────── */
.jbm-fit-section {
    background: #0c0e1a;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: relative;
    overflow: hidden;
    z-index: 0;
}

/* Aurora gradient layer */
.jbm-fit-section::before {
    content: '';
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg at 50% 50%,
            rgba(99, 102, 241, 0.15) 0deg,
            rgba(139, 92, 246, 0.2) 60deg,
            rgba(6, 182, 212, 0.15) 120deg,
            rgba(236, 72, 153, 0.1) 180deg,
            rgba(99, 102, 241, 0.15) 240deg,
            rgba(6, 182, 212, 0.12) 300deg,
            rgba(99, 102, 241, 0.15) 360deg);
    animation: jbmAuroraRotate 12s linear infinite;
    z-index: -2;
}

/* Floating glow orbs */
.jbm-fit-section::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 140%;
    height: 140%;
    background:
        radial-gradient(ellipse 35% 50% at 15% 50%, rgba(99, 102, 241, 0.2) 0%, transparent 70%),
        radial-gradient(ellipse 30% 60% at 85% 30%, rgba(6, 182, 212, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 25% 40% at 50% 80%, rgba(236, 72, 153, 0.12) 0%, transparent 70%);
    animation: jbmOrbDrift 8s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes jbmAuroraRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes jbmOrbDrift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(3%, -4%) scale(1.05);
    }

    100% {
        transform: translate(-2%, 3%) scale(0.97);
    }
}

.jbm-fit-section__left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.jbm-fit-section__icon {
    font-size: 26px;
    flex-shrink: 0;
    line-height: 1;
}

.jbm-fit-section__text {
    min-width: 0;
}

.jbm-fit-section__title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 2px 0 !important;
    line-height: 1.3;
}

.jbm-fit-section__desc {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}

.jbm-fit-section__right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.jbm-fit-section__remaining {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 500;
}

.jbm-fit-section__remaining--analyzed {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.2);
    padding: 4px 11px;
    /* Adjust padding due to border */
}

.jbm-fit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: linear-gradient(135deg, #e94560 0%, #c23152 100%);
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.jbm-fit-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #f05e73 0%, #d43a5c 100%);
    color: #ffffff !important;
}

.jbm-fit-btn:active {
    transform: translateY(0);
}

.jbm-fit-btn__icon {
    font-size: 16px;
    line-height: 1;
}

.jbm-fit-btn--view {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

.jbm-fit-btn--view:hover {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
}

/* ── Modal Overlay ──────────────────────────────────────────── */
.jbm-fit-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: jbmFadeIn 0.25s ease-out;
}

.jbm-fit-overlay.active {
    display: flex;
}

/* ── Modal Container (2-column on desktop) ─────────────────── */
.jbm-fit-modal {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    animation: jbmSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.jbm-fit-modal__header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #eef0f4;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jbm-fit-modal__title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.jbm-fit-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f3f7;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
    transition: all 0.2s;
    flex-shrink: 0;
}

.jbm-fit-modal__close:hover {
    background: #e2e5ea;
    color: #333;
}

/* Two-column layout container */
.jbm-fit-modal__body {
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 0;
}

/* Left column — score + analysis */
.jbm-fit-col--left {
    padding: 24px;
    border-right: 1px solid #eef0f4;
    overflow-y: auto;
    max-height: calc(90vh - 130px);
}

/* Right column — suggested jobs */
.jbm-fit-col--right {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 130px);
    background: #f8f9fb;
}

.jbm-fit-modal__footer {
    padding: 14px 24px 18px;
    border-top: 1px solid #eef0f4;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ── Loading State ──────────────────────────────────────────── */
.jbm-fit-loading {
    text-align: center;
    padding: 48px 20px;
    grid-column: 1 / -1;
}

.jbm-fit-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid #eef0f4;
    border-top-color: #e94560;
    border-radius: 50%;
    animation: jbmSpin 0.8s linear infinite;
    margin: 0 auto 18px;
}

.jbm-fit-loading__text {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.jbm-fit-loading__text strong {
    color: #1a1a2e;
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

/* ── Score Circle ───────────────────────────────────────────── */
.jbm-fit-score {
    text-align: center;
    margin-bottom: 20px;
}

.jbm-fit-score__circle {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 10px;
}

.jbm-fit-score__circle svg {
    width: 110px;
    height: 110px;
    transform: rotate(-90deg);
}

.jbm-fit-score__circle svg circle {
    fill: none;
    stroke-width: 7;
    stroke-linecap: round;
}

.jbm-fit-score__track {
    stroke: #eef0f4;
}

.jbm-fit-score__fill {
    stroke: #e94560;
    stroke-dasharray: 0 999;
    transition: stroke-dasharray 1.5s cubic-bezier(0.4, 0, 0.2, 1),
        stroke 0.3s ease;
}

.jbm-fit-score__value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
}

.jbm-fit-score__value span {
    font-size: 16px;
    font-weight: 500;
    color: #999;
}

.jbm-fit-score__label {
    color: #888;
    font-size: 13px;
    margin: 0;
    font-weight: 500;
}

/* Score color variants */
.jbm-fit-score--high .jbm-fit-score__fill {
    stroke: #22c55e;
}

.jbm-fit-score--medium .jbm-fit-score__fill {
    stroke: #f59e0b;
}

.jbm-fit-score--low .jbm-fit-score__fill {
    stroke: #ef4444;
}

.jbm-fit-score--high .jbm-fit-score__value {
    color: #16a34a;
}

.jbm-fit-score--medium .jbm-fit-score__value {
    color: #d97706;
}

.jbm-fit-score--low .jbm-fit-score__value {
    color: #dc2626;
}

/* ── Summary ────────────────────────────────────────────────── */
.jbm-fit-summary {
    background: #f0f4ff;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.jbm-fit-summary p {
    margin: 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}

/* ── Criteria List ──────────────────────────────────────────── */
.jbm-fit-criteria {
    margin-bottom: 18px;
}

.jbm-fit-criteria__title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #eef0f4;
}

.jbm-fit-criteria__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fafbfc;
    margin-bottom: 6px;
    transition: background 0.2s;
}

.jbm-fit-criteria__item:hover {
    background: #f1f3f7;
}

.jbm-fit-criteria__icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    margin-top: 1px;
}

.jbm-fit-criteria__info {
    flex: 1;
    min-width: 0;
}

.jbm-fit-criteria__name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 2px 0;
}

.jbm-fit-criteria__detail {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

.jbm-fit-criteria__badge {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
}

.jbm-fit-criteria__badge--match {
    background: #dcfce7;
    color: #16a34a;
}

.jbm-fit-criteria__badge--partial {
    background: #fef3c7;
    color: #d97706;
}

.jbm-fit-criteria__badge--mismatch {
    background: #fee2e2;
    color: #dc2626;
}

/* ── Tips Section ───────────────────────────────────────────── */
.jbm-fit-tips {
    margin-bottom: 14px;
}

.jbm-fit-tips__title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.jbm-fit-tips__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.jbm-fit-tips__list li {
    position: relative;
    padding: 4px 0 4px 18px;
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
}

.jbm-fit-tips__list li::before {
    content: '•';
    position: absolute;
    left: 4px;
    color: #e94560;
    font-size: 16px;
    line-height: 1.2;
}

.jbm-fit-tips--strengths li::before {
    color: #22c55e;
}

/* ── Suggested Jobs (Right Column) ─────────────────────────── */
.jbm-fit-suggested__title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jbm-fit-suggested__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.jbm-fit-job-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none !important;
    display: block;
    transition: all 0.2s ease;
}

.jbm-fit-job-card:hover {
    border-color: #c7d2fe;
    background: #f8f9ff;
    transform: translateY(-1px);
}

.jbm-fit-job-card__title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 6px 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.jbm-fit-job-card:hover .jbm-fit-job-card__title {
    color: #4f46e5;
}

.jbm-fit-job-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 11px;
    color: #64748b;
}

.jbm-fit-job-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.jbm-fit-suggested__empty {
    text-align: center;
    padding: 30px 16px;
    color: #94a3b8;
    font-size: 13px;
}

.jbm-fit-suggested__empty-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
}

/* ── Action Buttons ─────────────────────────────────────────── */
.jbm-fit-btn--resume {
    padding: 9px 18px;
    background: linear-gradient(135deg, #e94560 0%, #c23152 100%);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.jbm-fit-btn--resume:hover {
    transform: translateY(-1px);
    color: #fff !important;
}

.jbm-fit-btn--close {
    padding: 9px 18px;
    background: #f1f3f7;
    color: #475569 !important;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s;
}

.jbm-fit-btn--close:hover {
    background: #e2e5ea;
}

/* ── No Resume / Not Logged In State ────────────────────────── */
.jbm-fit-noresume {
    text-align: center;
    padding: 32px 20px;
    grid-column: 1 / -1;
}

.jbm-fit-noresume__icon {
    font-size: 48px;
    margin-bottom: 14px;
    display: block;
}

.jbm-fit-noresume__title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px 0;
}

.jbm-fit-noresume__desc {
    font-size: 16px;
    color: #64748b;
    margin: 0 0 22px 0;
    line-height: 1.5;
}

/* ── Error State ────────────────────────────────────────────── */
.jbm-fit-error {
    grid-column: 1 / -1;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes jbmFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes jbmSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes jbmSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Responsive — Mobile ───────────────────────────────────── */
@media (max-width: 768px) {
    .jbm-fit-section {
        flex-direction: column;
        text-align: center;
        padding: 16px 18px;
        gap: 12px;
    }

    .jbm-fit-section__left {
        flex-direction: column;
        gap: 6px;
    }

    .jbm-fit-section__title {
        font-size: 15px;
    }

    .jbm-fit-section__desc {
        display: none;
    }

    .jbm-fit-section__right {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .jbm-fit-section__remaining {
        font-size: 11px;
    }

    .jbm-fit-btn {
        width: 100%;
        justify-content: center;
    }

    .jbm-fit-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .jbm-fit-modal__header {
        padding: 16px 18px 12px;
    }

    .jbm-fit-modal__title {
        font-size: 16px;
    }

    /* Stack columns on mobile */
    .jbm-fit-modal__body {
        grid-template-columns: 1fr;
    }

    .jbm-fit-col--left {
        padding: 18px;
        border-right: none;
        border-bottom: 1px solid #eef0f4;
        max-height: none;
    }

    .jbm-fit-col--right {
        padding: 18px;
        max-height: none;
    }

    .jbm-fit-modal__footer {
        padding: 12px 18px 16px;
        flex-direction: column;
    }

    .jbm-fit-modal__footer .jbm-fit-btn--resume,
    .jbm-fit-modal__footer .jbm-fit-btn--close {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .jbm-fit-score__circle {
        width: 100px;
        height: 100px;
    }

    .jbm-fit-score__circle svg {
        width: 100px;
        height: 100px;
    }

    .jbm-fit-score__value {
        font-size: 28px;
    }

    /* Compact job cards on mobile */
    .jbm-fit-job-card {
        padding: 12px 14px;
    }

    .jbm-fit-job-card__meta {
        gap: 4px 10px;
    }
}