/* ============================================
   ElevateCV AI — AI ATS Job Match Analyzer CSS
   Design System: Dark SaaS Glassmorphism
   ============================================ */

/* ── Backdrop Overlay ──────────────────────── */
.jm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 20, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms ease;
}

.jm-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* ── Modal Dialog Container ────────────────── */
.jm-modal {
    background: #0F172A;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75);
    width: 880px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    transform: scale(0.95) translateY(12px);
    transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.jm-modal-overlay.is-open .jm-modal {
    transform: scale(1) translateY(0);
}

/* ── Modal Header ──────────────────────────── */
.jm-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 26px;
    background: #111827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.jm-modal__title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jm-modal__title-wrap svg {
    color: #10b981;
}

.jm-modal__title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.jm-modal__subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin: 2px 0 0;
}

.jm-modal__close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 150ms ease;
}

.jm-modal__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* ── Modal Body ────────────────────────────── */
.jm-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* ── Input Form Split Layout ───────────────── */
.jm-form-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.jm-resume-overview {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jm-overview-title {
    font-size: 13px;
    font-weight: 700;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jm-overview-item {
    font-size: 12.5px;
    color: #cbd5e1;
    line-height: 1.5;
}

.jm-overview-item strong {
    color: #ffffff;
}

/* ── Score Gauge & Metrics Header ──────────── */
.jm-score-header {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.jm-gauge-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

.jm-gauge-svg {
    transform: rotate(-90deg);
    width: 90px;
    height: 90px;
}

.jm-gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.jm-gauge-fill {
    fill: none;
    stroke: url(#jmGradient);
    stroke-width: 8;
    stroke-dasharray: 251.2;
    stroke-dashoffset: 251.2;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.jm-gauge-val {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: #34d399;
}

.jm-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    flex: 1;
}

.jm-metric-card {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: center;
}

.jm-metric-val {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
}

.jm-metric-label {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    font-weight: 600;
}

/* ── Keywords Section (Matched & Missing Chips) ── */
.jm-keywords-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.jm-keyword-box {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
}

.jm-keyword-box__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.jm-keyword-box__title--matched { color: #34d399; }
.jm-keyword-box__title--missing { color: #f87171; }

.jm-chips-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.jm-kw-chip {
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.jm-kw-chip--matched {
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #6ee7b7;
}

.jm-kw-chip--missing {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #fca5a5;
}

/* ── Section Scores Progress Bars ───────────── */
.jm-section-scores {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px;
}

.jm-section-scores__title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 14px;
}

.jm-score-row {
    margin-bottom: 10px;
}

.jm-score-row:last-child {
    margin-bottom: 0;
}

.jm-score-row__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.jm-score-bar-bg {
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.jm-score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    border-radius: 4px;
    width: 0;
    transition: width 800ms ease;
}

/* ── Modal Footer Actions ──────────────────── */
.jm-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 26px;
    background: #111827;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}

.jm-footer__left, .jm-footer__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn--jm-primary {
    background: linear-gradient(135deg, #10B981 0%, #3B82F6 100%);
    color: #ffffff;
    border: none;
    padding: 9px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.35);
    transition: all 150ms ease;
}

.btn--jm-primary:hover {
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.5);
    transform: translateY(-1px);
}

.btn--jm-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 150ms ease;
}

.btn--jm-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* ── Shimmer Skeleton ──────────────────────── */
.jm-skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 37%, rgba(255, 255, 255, 0.04) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: 8px;
}

.jm-skeleton--card { height: 90px; margin-bottom: 14px; }

/* ── Responsive adjustments ────────────────── */
@media (max-width: 768px) {
    .jm-modal {
        width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .jm-form-split, .jm-keywords-container {
        grid-template-columns: 1fr;
    }

    .jm-score-header {
        flex-direction: column;
        text-align: center;
    }

    .jm-modal__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .jm-footer__left, .jm-footer__right {
        width: 100%;
        justify-content: space-between;
    }
}
