/* ============================================================
   salary.css — styles ONLY for the /salary/ page additions.
   Loaded AFTER style.css and programs.css (the comparison
   component lives in programs.css and is reused here).
   Currently contains: the interactive salary explorer
   (percentile bar + expandable pay-factor list).
   ============================================================ */

.salary-section {
    padding: 4rem 0;
    background: #fff;
}

.salary-section .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.salary-section h2 {
    text-align: center;
    margin-bottom: 0.75rem;
}

.salary-section-description {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 2rem;
    color: #5a6a7a;
}

/* ---------- US / State toggle pills ---------- */
.salary-range-toggle {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.salary-toggle {
    font-family: 'Sora', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.55rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 999px;
    background: #fff;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.2s ease;
}

.salary-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.salary-toggle.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ---------- Percentile bar ---------- */
.salary-range {
    display: none;
}

.salary-range.active {
    display: block;
    animation: salaryFade 0.25s ease;
}

@keyframes salaryFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.salary-bar {
    position: relative;
    height: 150px;
    margin: 0 3rem;
}

.salary-bar-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 12px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: linear-gradient(90deg, #cfe8d9 0%, #2e9e5b 100%);
}

/* Each marker is a dot on the track with its value + percentile label,
   alternating above/below the track so labels never collide. */
.salary-marker {
    position: absolute;
    top: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Sora', sans-serif;
    white-space: nowrap;
}

.salary-marker-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #2e9e5b;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.salary-marker-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: #2c3e50;
}

.salary-marker-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a97a5;
}

/* "below" markers: dot on the track, text underneath */
.salary-marker.below {
    margin-top: -7px;
}

.salary-marker.below .salary-marker-value { order: 2; margin-top: 0.35rem; }
.salary-marker.below .salary-marker-dot   { order: 1; }
.salary-marker.below .salary-marker-label { order: 3; }

/* "above" markers: text on top, dot on the track */
.salary-marker.above {
    transform: translateX(-50%) translateY(-100%);
    margin-top: 7px;
}

.salary-marker.above .salary-marker-value { order: 2; margin-bottom: 0.35rem; }
.salary-marker.above .salary-marker-label { order: 1; }
.salary-marker.above .salary-marker-dot   { order: 3; }

/* The median gets the emphasis */
.salary-marker.median .salary-marker-dot {
    width: 18px;
    height: 18px;
    border-color: var(--primary-color);
}

.salary-marker.median .salary-marker-value {
    font-size: 1.15rem;
    color: var(--primary-color);
}

.salary-marker.median .salary-marker-label {
    color: var(--primary-color);
}

.salary-range-source {
    text-align: center;
    font-size: 0.85rem;
    color: #8a97a5;
    margin: 0.5rem 0 0;
}

/* ---------- Pay-factor rows ---------- */
.salary-factors-title {
    text-align: center;
    margin: 2.5rem 0 1.25rem;
    color: #2c3e50;
}

.salary-factor {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.salary-factor:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.salary-factor-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.95rem 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Sora', sans-serif;
    text-align: left;
}

.salary-factor-icon {
    color: var(--primary-color);
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.salary-factor-label {
    flex: 1;
    font-size: 1.02rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Impact badge */
.salary-impact {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
}

.salary-impact.high   { background: #e2f4e9; color: #1f7a43; }
.salary-impact.medium { background: #e3edfb; color: #2b5ea8; }
.salary-impact.varies { background: #fcf1d7; color: #9a6f0a; }

.salary-chevron {
    color: #8a97a5;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.salary-factor.open .salary-chevron {
    transform: rotate(180deg);
}

/* Expandable explanation */
.salary-factor-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fff;
    border-top: 1px solid transparent;
}

.salary-factor.open .salary-factor-detail {
    max-height: 260px;
    border-top-color: var(--border-color);
}

.salary-factor-detail p {
    margin: 0;
    padding: 0.9rem 1.25rem;
    font-size: 0.95rem;
    color: #4a5a6a;
}

/* Caveat note under the whole component */
.salary-note {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 0.95rem;
    color: #5a6a7a;
}

.salary-note:empty {
    display: none;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .salary-bar {
        margin: 0 2.5rem;
        height: 130px;
    }

    .salary-marker-value {
        font-size: 0.78rem;
    }

    .salary-marker.median .salary-marker-value {
        font-size: 0.95rem;
    }

    .salary-marker-label {
        font-size: 0.62rem;
    }

    .salary-factor-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .salary-impact {
        font-size: 0.72rem;
    }

    .salary-toggle {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
}
