/* =================================================================
   /assets/css/tools/auction-vote.css

   Styles for the Priority Auction vote page (public voter-facing).
   Loaded automatically by index.php via tool_definitions query.
   Extends tool-base.css (shared pv-* classes).

   Slider-only design with gold coin metaphor + animations.
   No #fff fallbacks — works in both light and dark themes.
   ================================================================= */

/* ── Coin SVG animation ── */
.auc-svg-coin {
    opacity: 0;
    animation: aucCoinDrop 0.35s ease-out forwards;
}

@keyframes aucCoinDrop {
    0%   { opacity: 0; transform: translateY(-12px); }
    60%  { opacity: 1; transform: translateY(2px); }
    100% { opacity: 1; transform: translateY(0); }
}

.auc-coin-stack-svg {
    display: block;
}

/* ── Small inline coin (pure CSS) ── */
.auc-coin-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe566 0%, #f7cb18 40%, #d4a800 100%);
    box-shadow: 0 1px 2px rgba(180, 140, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    vertical-align: middle;
    position: relative;
}

.auc-coin-sm::after {
    content: 'P';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: 800;
    color: rgba(180, 140, 0, 0.5);
}

/* ── Intro: coin scene ── */
.auc-intro-coins-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 1.25rem 0 0.75rem;
}

.auc-intro-coin-stack {
    display: flex;
    justify-content: center;
}

.auc-intro-coin-label {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.auc-intro-coin-label strong {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--peritiq-text-primary);
}

.auc-intro-coin-label span {
    font-size: 0.88rem;
    color: var(--peritiq-text-secondary);
    font-weight: 500;
}

.auc-intro-note {
    font-size: 0.78rem;
    color: var(--peritiq-text-secondary);
    margin: 0 0 0.5rem;
    line-height: 1.4;
    text-align: center;
}

/* ── Budget Bar (sticky top) ──
   IMPORTANT: use `inherit` bg so dark/light theme both work.
   The pv-card parent provides the correct bg context. */
.auc-vote-budget-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: inherit;
    padding: 12px 20px 8px;
    border-bottom: 1px solid var(--peritiq-border-primary);
}

.auc-vote-budget-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.auc-vote-budget-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--peritiq-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.auc-vote-budget-counter {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    transition: background 0.2s, color 0.2s;
}

.auc-vote-budget-counter.partial {
    background: rgba(0, 128, 133, 0.12);
    color: var(--peritiq-brand-primary);
}

.auc-vote-budget-counter.ready {
    background: rgba(0, 199, 199, 0.12);
    color: var(--peritiq-accent-signal);
}

.auc-vote-budget-track {
    height: 6px;
    background: var(--peritiq-border-primary);
    border-radius: 3px;
    overflow: hidden;
}

.auc-vote-budget-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.15s ease, background 0.2s ease;
}

.auc-vote-budget-fill.partial {
    background: linear-gradient(90deg, #f7cb18, #d4a800);
}

.auc-vote-budget-fill.ready {
    background: linear-gradient(90deg, var(--peritiq-accent-signal), var(--peritiq-accent-signal));
}

/* ── Items List ── */
.auc-vote-items-list {
    padding: 10px 20px;
}

/* ── Individual Item ── */
.auc-vote-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--peritiq-border-primary);
}

.auc-vote-item:last-child {
    border-bottom: none;
}

.auc-vote-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}

.auc-vote-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--peritiq-text-primary);
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}

.auc-vote-item-pts {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--peritiq-text-primary);
    flex-shrink: 0;
}

.auc-vote-item-pts strong {
    font-size: 0.95rem;
    font-weight: 700;
    min-width: 20px;
    text-align: right;
}

.auc-vote-item-desc {
    font-size: 0.78rem;
    color: var(--peritiq-text-secondary);
    line-height: 1.45;
    margin: 2px 0 6px;
}

/* ── Slider Row ── */
.auc-vote-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.auc-vote-slider {
    flex: 1;
    min-width: 0;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--peritiq-border-primary);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

/* Webkit (Chrome/Safari/Edge) thumb — coin style */
.auc-vote-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ffe566 0%, #f7cb18 40%, #d4a800 100%);
    border-radius: 50%;
    cursor: grab;
    border: 3px solid var(--peritiq-background-secondary);
    box-shadow: var(--peritiq-shadow-sm), 0 0 0 1px rgba(212,168,0,0.25);
    transition: transform 0.1s, box-shadow 0.1s;
}

.auc-vote-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: var(--peritiq-shadow-sm), 0 0 0 2px rgba(0,128,133,0.3);
}

.auc-vote-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
}

/* Firefox thumb */
.auc-vote-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ffe566 0%, #f7cb18 40%, #d4a800 100%);
    border-radius: 50%;
    cursor: grab;
    border: 3px solid var(--peritiq-background-secondary);
    box-shadow: var(--peritiq-shadow-sm);
}

.auc-vote-slider::-moz-range-thumb:active {
    cursor: grabbing;
}

.auc-vote-slider::-moz-range-track {
    height: 6px;
    background: var(--peritiq-border-primary);
    border-radius: 3px;
    border: none;
}

/* Focus ring for a11y */
.auc-vote-slider:focus-visible {
    outline: 2px solid rgba(0, 128, 133, 0.5);
    outline-offset: 4px;
    border-radius: 3px;
}

.auc-vote-pct {
    font-size: 0.72rem;
    color: var(--peritiq-text-secondary);
    min-width: 32px;
    text-align: right;
    flex-shrink: 0;
}

/* ── Submit Actions ── */
.auc-vote-actions {
    padding: 14px 20px;
    border-top: 1px solid var(--peritiq-border-primary);
    display: flex;
    justify-content: center;
}

.auc-vote-submit {
    min-width: 220px;
}

.auc-vote-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Review Screen — coins only ── */
.auc-review-list {
    margin-bottom: 0.5rem;
}

.auc-review-item {
    padding: 12px 0;
}

.auc-review-item + .auc-review-item {
    border-top: 1px solid var(--peritiq-border-primary);
}

.auc-review-item-zero {
    opacity: 0.45;
}

.auc-review-item-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    width: 100%;
}

.auc-review-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--peritiq-text-primary);
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auc-review-item-pts {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    flex-shrink: 0;
    min-width: 70px;
    justify-content: flex-end;
    text-align: right;
}

.auc-review-item-pts strong {
    font-size: 1rem;
    font-weight: 700;
    color: var(--peritiq-text-primary);
}

.auc-review-pct {
    font-size: 0.72rem;
    color: var(--peritiq-text-secondary);
    font-weight: 400;
}

/* Animated coin dots */
.auc-review-coins-row {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.auc-review-coin {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe566 0%, #f7cb18 40%, #d4a800 100%);
    box-shadow: 0 1px 2px rgba(180, 140, 0, 0.3);
    opacity: 0;
    animation: aucCoinPop 0.25s ease-out forwards;
}

@keyframes aucCoinPop {
    0%   { opacity: 0; transform: scale(0.3); }
    70%  { transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}

.auc-review-no-coins {
    font-size: 0.75rem;
    color: var(--peritiq-text-secondary);
    opacity: 0.5;
}

/* Total row */
.auc-review-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 8px;
    margin-top: 4px;
    font-size: 0.88rem;
}

.auc-review-total-label {
    font-weight: 600;
    color: var(--peritiq-text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

.auc-review-total-value {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--peritiq-text-primary);
    min-width: 70px;
    justify-content: flex-end;
    text-align: right;
}

.auc-review-total-value strong {
    font-weight: 700;
    font-size: 1rem;
}

/* ── Complete: coin celebration ── */
.auc-complete-coins {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .auc-vote-budget-bar {
        padding: 10px 16px 6px;
    }

    .auc-vote-items-list {
        padding: 8px 16px;
    }

    .auc-vote-item-title {
        font-size: 0.84rem;
    }

    .auc-vote-slider::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }

    .auc-vote-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }

    .auc-vote-actions {
        padding: 12px 16px;
    }

    .auc-vote-submit {
        width: 100%;
    }
}

/* ── Tablet ── */
@media (min-width: 481px) and (max-width: 768px) {
    .auc-vote-slider {
        min-width: 120px;
    }
}

/* ═══ AUCTION RESULTS — KPI STRIP ═══
   Matches assumption-results.css cross-validation strip visual weight */
.auc-kpi-strip {
    display: flex;
    gap: 6px;
    margin-bottom: 1.25rem;
}

.auc-kpi-box {
    flex: 1;
    background: var(--peritiq-background-secondary);
    border: 1px solid var(--peritiq-border-primary);
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
    transition: border-color 0.15s;
}

.auc-kpi-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--peritiq-text-primary);
}

.auc-kpi-label {
    font-size: 0.62rem;
    color: var(--peritiq-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.auc-kpi-danger {
    border-color: rgba(231, 76, 60, 0.3);
}

.auc-kpi-danger .auc-kpi-value {
    color: #e74c3c;
}

.auc-kpi-warn {
    border-color: rgba(0, 128, 133, 0.4);
}

.auc-kpi-warn .auc-kpi-value {
    color: var(--peritiq-brand-primary);
}

/* ═══ AUCTION RESULTS — CARD VARIANTS ═══ */
.auc-card-polarized {
    border-color: rgba(231, 76, 60, 0.2) !important;
}

/* ═══ RESPONSIVE — KPI STRIP ═══ */
@media (max-width: 480px) {
    .auc-kpi-strip {
        gap: 4px;
    }

    .auc-kpi-box {
        padding: 6px 4px;
    }

    .auc-kpi-value {
        font-size: 0.95rem;
    }

    .auc-kpi-label {
        font-size: 0.58rem;
    }
}

/* ═══ SHARED RESULT COMPONENTS ═══
   Reused from assumption-results.css — these classes power the grouped
   card layout. If assumption-results.css is loaded globally, these
   act as safe fallbacks; otherwise they're self-contained.
   ================================================================= */

/* Voter meta */
.av-voter-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--peritiq-text-secondary);
    margin-bottom: 1.25rem;
}

.av-voter-meta .material-symbols-outlined {
    font-size: 0.95rem;
    opacity: 0.6;
}

/* AI refresh button (header-right position) */
.av-ai-refresh {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.75rem !important;
    opacity: 0.6;
    transition: opacity 0.15s;
    margin-left: auto;
}

.av-ai-refresh:hover {
    opacity: 1;
}

.av-ai-refresh .material-symbols-outlined {
    font-size: 0.95rem !important;
}

/* AI placeholder */
.av-ai-placeholder {
    text-align: center;
    padding: 0.75rem;
}

.av-ai-placeholder p {
    font-size: 0.82rem;
    color: var(--peritiq-text-secondary);
    margin: 0 0 0.75rem;
}

/* Grouped sections */
.av-group {
    margin-bottom: 1rem;
}

.av-group:last-child {
    margin-bottom: 0;
}

.av-group-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--peritiq-border-primary);
}

.av-group-header .material-symbols-outlined {
    font-size: 1rem;
}

.av-group-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--peritiq-text-secondary);
}

.av-group-count {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    margin-left: auto;
}

/* Group colors — reuse assumption patterns */
.av-group-validated .av-group-header .material-symbols-outlined,
.av-group-validated .av-group-count { color: var(--peritiq-accent-signal); }
.av-group-validated .av-group-count { background: rgba(0, 199, 199, 0.1); }

.av-group-blind_spots .av-group-header .material-symbols-outlined,
.av-group-blind_spots .av-group-count { color: #e74c3c; }
.av-group-blind_spots .av-group-count { background: rgba(231, 76, 60, 0.1); }

.av-group-unresolved .av-group-header .material-symbols-outlined,
.av-group-unresolved .av-group-count { color: var(--peritiq-text-secondary); }
.av-group-unresolved .av-group-count { background: var(--peritiq-surface-overlay); }

/* Item cards */
.av-assumption-card {
    background: var(--peritiq-background-secondary);
    border: 1px solid var(--peritiq-border-primary);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    transition: border-color 0.15s;
}

.av-assumption-card:hover {
    border-color: var(--peritiq-border-primary);
}

.av-assumption-card:last-child {
    margin-bottom: 0;
}

.av-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.av-card-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.av-card-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--peritiq-text-primary);
    line-height: 1.35;
}

/* Classification pill */
.av-cls-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    width: fit-content;
}

.av-cls-pill .material-symbols-outlined {
    font-size: 0.75rem;
}

.av-cls-pill.av-pill-blind_spots {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* Score badge */
.av-score-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Distribution bar */
.av-dist-bar {
    display: flex;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
    gap: 1px;
    background: var(--peritiq-border-primary);
}

.av-dist-seg {
    height: 100%;
    border-radius: 1px;
    transition: width 0.3s ease;
    min-width: 2px;
}

/* Scores row */
.av-scores-row {
    display: flex;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--peritiq-text-secondary);
    margin-top: 4px;
}

/* Flat/warning block */
.av-flat-warn {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    margin-top: 1rem;
    padding: 10px 12px;
    background: rgba(231, 76, 60, 0.05);
    border: 1px solid rgba(231, 76, 60, 0.15);
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--peritiq-text-secondary);
}

.av-flat-warn .material-symbols-outlined {
    font-size: 0.95rem;
    color: #e74c3c;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Responsive */
@media (max-width: 480px) {
    .av-assumption-card {
        padding: 8px 10px;
    }

    .av-card-top {
        flex-direction: column;
        gap: 4px;
    }

    .av-score-badge {
        align-self: flex-start;
    }

    .av-scores-row {
        flex-wrap: wrap;
        gap: 6px;
    }
}
