/* ==========================================================================
   Star Hire - reputation, stars, ranks, review skill votes and review forms.
   Layered on top of style.css; reuses the theme custom properties.
   ========================================================================== */

/* Stars ------------------------------------------------------------------- */

.stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
}

.star {
    font-size: 1rem;
    line-height: 1;
}

.star.on {
    color: var(--amber);
    text-shadow: 0 0 6px rgba(255, 194, 61, 0.35);
}

.star.off {
    color: var(--muted);
    opacity: 0.45;
}

.stars-lg .star {
    font-size: 1.55rem;
}

.star-value {
    margin-left: 7px;
    font-size: 0.82rem;
    color: var(--muted);
}

/* Rank badges ------------------------------------------------------------- */

.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--muted);
    white-space: nowrap;
    vertical-align: middle;
}

.rank-badge.rank-lg {
    padding: 4px 14px;
    font-size: 0.82rem;
}

.rank-unrated {
    color: var(--muted);
    border-color: rgba(127, 147, 168, 0.4);
    background: rgba(127, 147, 168, 0.08);
}

.rank-rookie {
    color: #b6c4d4;
    border-color: rgba(182, 196, 212, 0.5);
    background: rgba(182, 196, 212, 0.10);
}

.rank-citizen {
    color: #8fe6ff;
    border-color: rgba(53, 214, 255, 0.5);
    background: rgba(53, 214, 255, 0.10);
}

.rank-freelancer {
    color: #9df0c2;
    border-color: rgba(61, 220, 132, 0.5);
    background: rgba(61, 220, 132, 0.10);
}

.rank-veteran {
    color: #ffd28a;
    border-color: rgba(255, 194, 61, 0.55);
    background: rgba(255, 194, 61, 0.12);
}

.rank-elite {
    color: #ffb38a;
    border-color: rgba(255, 138, 30, 0.55);
    background: rgba(255, 138, 30, 0.12);
}

.rank-legend {
    color: #ffffff;
    border-color: rgba(53, 214, 255, 0.75);
    background: linear-gradient(135deg, rgba(53, 214, 255, 0.22), rgba(255, 138, 30, 0.22));
    box-shadow: 0 0 12px rgba(53, 214, 255, 0.25);
}

/* Skill chips (review skill votes) --------------------------------------- */

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    font-size: 0.74rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--text);
    white-space: nowrap;
}

.skill-chip .skill-chip-vote {
    font-weight: 700;
    line-height: 1;
}

.skill-chip.pos {
    color: #9df0c2;
    border-color: rgba(61, 220, 132, 0.45);
    background: rgba(61, 220, 132, 0.10);
}

.skill-chip.neg {
    color: #ff9aa5;
    border-color: rgba(255, 77, 94, 0.45);
    background: rgba(255, 77, 94, 0.10);
}

/* Skill tracks ------------------------------------------------------------ */

.skill-tracks {
    display: grid;
    gap: 14px;
}

.skill-track {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-2);
}

.skill-track-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.skill-name {
    font-weight: 600;
    color: #eaf3fb;
}

.skill-rank {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--muted);
    white-space: nowrap;
}

.skill-rank.pos {
    color: #9df0c2;
    border-color: rgba(61, 220, 132, 0.5);
    background: rgba(61, 220, 132, 0.12);
}

.skill-rank.neg {
    color: #ff9aa5;
    border-color: rgba(255, 77, 94, 0.5);
    background: rgba(255, 77, 94, 0.12);
}

.skill-rank.neutral {
    color: var(--muted);
    border-color: rgba(127, 147, 168, 0.4);
    background: rgba(127, 147, 168, 0.08);
}

/* Bipolar skill bar: 50 red slots (left) | center | 50 green slots (right).
   With 50 segments per side the slots are thin and tightly packed so the two
   halves together still span the full bar width. */

.skill-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.skill-bar-side {
    display: flex;
    flex: 1 1 0;
    gap: 1px;
    min-width: 0;
}

.skill-bar-center {
    flex: 0 0 auto;
    width: 2px;
    height: 16px;
    border-radius: 1px;
    background: var(--line);
}

.skill-seg {
    flex: 1 1 0;
    height: 8px;
    min-width: 0;
    border-radius: 1px;
    background: rgba(127, 147, 168, 0.16);
    transition: background 0.12s ease, box-shadow 0.12s ease;
}

.skill-seg.on.pos {
    background: var(--green);
    box-shadow: 0 0 5px rgba(61, 220, 132, 0.4);
}

.skill-seg.on.neg {
    background: var(--red);
    box-shadow: 0 0 5px rgba(255, 77, 94, 0.4);
}

.skill-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--muted);
}

.skill-meta-score {
    font-weight: 700;
    color: var(--text);
}

.skill-meta-sep {
    opacity: 0.6;
}

/* Reputation panel -------------------------------------------------------- */

.reputation-head {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.reputation-score {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reputation-avg {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
    color: var(--amber);
}

.reputation-count {
    font-size: 0.82rem;
    color: var(--muted);
}

.reputation-divider {
    border: none;
    border-top: 1px solid var(--line);
    margin: 18px 0;
}

/* Review list ------------------------------------------------------------- */

.review-list {
    display: grid;
    gap: 12px;
}

.review-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-2);
}

.review-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.review-meta {
    margin-left: auto;
}

.review-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Review form ------------------------------------------------------------- */

.review-form {
    display: grid;
    gap: 18px;
}

.review-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-stars {
    position: relative;
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 2px;
}

.review-stars input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.review-stars label {
    cursor: pointer;
    padding: 0 2px;
    font-size: 1.85rem;
    line-height: 1;
    color: var(--muted);
    transition: color 0.12s ease, text-shadow 0.12s ease;
}

.review-stars label::before {
    content: "\2606";
}

.review-stars label:hover::before,
.review-stars label:hover ~ label::before,
.review-stars input:checked ~ label::before {
    content: "\2605";
    color: var(--amber);
    text-shadow: 0 0 8px rgba(255, 194, 61, 0.35);
}

.review-stars input:focus-visible + label {
    outline: none;
    box-shadow: var(--glow-cyan);
    border-radius: 4px;
}

.skill-vote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
}

.skill-vote {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-2);
}

.skill-vote-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.skill-vote-options {
    display: inline-flex;
    gap: 6px;
}

.review-skill-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    font-size: 0.82rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-2);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.review-skill-option:hover {
    border-color: var(--cyan-dim);
}

.review-skill-option.pos {
    border-left: 3px solid rgba(61, 220, 132, 0.6);
}

.review-skill-option.neg {
    border-left: 3px solid rgba(255, 77, 94, 0.6);
}

.review-skill-option input {
    accent-color: var(--cyan);
    flex: 0 0 auto;
}

.review-skill-option:has(input:checked) {
    border-color: var(--cyan);
    box-shadow: var(--glow-cyan);
}

.review-skill-option.pos:has(input:checked) {
    color: #9df0c2;
    border-color: rgba(61, 220, 132, 0.7);
}

.review-skill-option.neg:has(input:checked) {
    color: #ff9aa5;
    border-color: rgba(255, 77, 94, 0.7);
}

/* Inline reputation fragments on cards ------------------------------------ */

.rep-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Review vote buttons (green / grey / red) -------------------------------- */

.vote-buttons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vote-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-2);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.vote-btn input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.vote-btn > span {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: currentColor;
    opacity: 0.5;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.vote-btn.up {
    color: var(--green);
}

.vote-btn.none {
    color: var(--muted);
}

.vote-btn.down {
    color: var(--red);
}

.vote-btn:hover {
    border-color: var(--cyan-dim);
}

.vote-btn.up:has(input:checked) {
    border-color: rgba(61, 220, 132, 0.75);
    background: rgba(61, 220, 132, 0.12);
    box-shadow: 0 0 8px rgba(61, 220, 132, 0.35);
}

.vote-btn.none:has(input:checked) {
    border-color: rgba(127, 147, 168, 0.75);
    background: rgba(127, 147, 168, 0.14);
}

.vote-btn.down:has(input:checked) {
    border-color: rgba(255, 77, 94, 0.75);
    background: rgba(255, 77, 94, 0.12);
    box-shadow: 0 0 8px rgba(255, 77, 94, 0.35);
}

.vote-btn:has(input:checked) > span {
    opacity: 1;
    transform: scale(1.05);
}

.vote-btn:has(input:focus-visible) {
    outline: none;
    box-shadow: var(--glow-cyan);
}

/* Anonymous note, own-review title and the manual live-reload button ------- */

.anonymous-note {
    font-style: italic;
}

.review-title {
    font-weight: 600;
    color: #eaf3fb;
}

[data-live-reload] {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 900;
    box-shadow: var(--glow-cyan);
}

[data-live-reload][hidden] {
    display: none !important;
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 560px) {
    .skill-track {
        padding: 10px 12px;
    }

    .skill-bar {
        gap: 3px;
    }

    .skill-bar-side {
        gap: 1px;
    }

    .skill-seg {
        height: 7px;
        border-radius: 1px;
    }

    .skill-vote-grid {
        grid-template-columns: 1fr;
    }

    .skill-vote {
        flex-wrap: wrap;
    }

    .reputation-head {
        gap: 12px;
    }

    .reputation-avg {
        font-size: 1.4rem;
    }
}
