/**
 * jsa_gather_flow.css
 * Shared styles for the JSA Recommendation step and Gather Your Team step.
 * Used by both prejob_brief.css and prejob_brief_nsc.css via <link> in templates.
 */

/* ── Step containers ──────────────────────────────────────────────────────── */

#jsaRecommendations,
#gatherTeamStep {
    padding: 20px;
}

/* Override flow-header alignment for these steps.
   prejob_brief_nsc.css already uses left-align globally; prejob_brief.css uses
   centered, so we scope the correction here for non-NSC without breaking NSC. */
#jsaRecommendations .flow-header,
#gatherTeamStep .flow-header {
    text-align: left;
    padding: 16px 0;
}

#jsaRecommendations .flow-header h3,
#gatherTeamStep .flow-header h3 {
    width: auto;
    margin: 0;
}

#jsaRecommendations .flow-header p,
#gatherTeamStep .flow-header p {
    padding: 0;
}

/* ── JSA Recommendation cards ─────────────────────────────────────────────── */

.jsa-rec-card {
    /* Button reset — overrides browser defaults when rendered as <button> */
    border: none;
    font: inherit;
    width: 100%;
    text-align: left;
    /* Card appearance */
    background: white;
    border-left: 4px solid var(--secondary-blue, #365ac7);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: box-shadow 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.jsa-rec-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.jsa-rec-card-body {
    flex: 1;
    min-width: 0;
}

.jsa-rec-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--grey-900, #1a1a1a);
    margin-bottom: 8px;
    white-space: normal;
    overflow: visible;
}

.jsa-rec-card-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.jsa-rec-pill {
    background: var(--grey-100, #f8f9fa);
    color: var(--grey-700, #3d3d3d);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.jsa-rec-card-chevron {
    flex-shrink: 0;
    margin-left: 12px;
    width: 24px;
    height: 24px;
    opacity: 0.5;
}

.jsa-rec-none-wrap {
    text-align: center;
    margin-top: 20px;
    padding-bottom: 8px;
}

/* ── Gather Your Team illustration ───────────────────────────────────────── */

.gather-team-illustration {
    display: flex;
    justify-content: center;
    margin: 8px auto 20px;
}

.gather-team-illustration img {
    width: 226px;
    max-width: min(226px, 86vw);
    height: auto;
    display: block;
    object-fit: contain;
}

/* ── Sparkle animations ───────────────────────────────────────────────────── */

/* Full-width flex row so the 24px sparkle centers.
   SparkleAnimation's .sparkle-container defaults to width:24px, so we override
   the container to be full-width and centre the child icon. */
.jsa-loading-sparkle.sparkle-container,
.gather-sparkle-wrap.sparkle-container {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    height: auto !important;
    min-height: 80px;
    /* No !important on display — SparkleAnimation.hide() sets display:none inline */
    display: flex;
    justify-content: center;
    align-items: center;
}

.jsa-loading-sparkle.sparkle-container .sparkle-icon,
.gather-sparkle-wrap.sparkle-container .sparkle-icon {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px;
    max-height: 24px;
    flex-shrink: 0;
}

.jsa-loading-sparkle {
    min-height: 80px;
}

.gather-sparkle-wrap {
    text-align: center;
    padding: 12px 0;
    min-height: 80px;
}

/* ── CTA buttons ──────────────────────────────────────────────────────────── */

.gather-continue-wrap {
    margin-top: 24px;
    text-align: center;
}

/* "None fit" and "Continue" — override primary green with midnight blue.
   All other interaction states (focus ring, disabled, ripple) come from
   ui-button.primary in button.css. */
.ui-button.primary.jsa-rec-none-btn,
.ui-button.primary.gather-continue-btn {
    width: 100%;
    background-color: var(--blue-midnight, #01232C);
}

.ui-button.primary.jsa-rec-none-btn:hover,
.ui-button.primary.gather-continue-btn:hover {
    background-color: #02374a;
}

.ui-button.primary.jsa-rec-none-btn:active,
.ui-button.primary.gather-continue-btn:active {
    background-color: #011e27;
}

/* Disabled: freeze appearance — cursor shows not-allowed, no color shift on hover/active */
.ui-button.primary.gather-continue-btn:disabled {
    background-color: var(--blue-midnight, #01232C);
    color: white;
    opacity: 0.4;
    cursor: not-allowed;
}

.ui-button.primary.gather-continue-btn:disabled:hover,
.ui-button.primary.gather-continue-btn:disabled:active {
    background-color: var(--blue-midnight, #01232C);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media screen and (max-width: 700px) {
    #jsaRecommendations .flow-header h3,
    #gatherTeamStep .flow-header h3 {
        width: 100%;
    }

    /* Pin "None fit" and "Continue" to the bottom of the viewport on mobile */
    .jsa-rec-none-wrap,
    .gather-continue-wrap {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 12px 20px;
        background: white;
        z-index: 100;
    }

    /* Add matching bottom padding to the step container so content doesn't
       disappear behind the fixed button */
    #jsaRecommendations,
    #gatherTeamStep {
        padding-bottom: 88px;
    }
}
