/* ============================================================
   qp-sidebar.css
   New quiz player sidebar styles.
   All classes prefixed qps- to avoid collisions with player.css
   ============================================================ */

/* ── Wrapper ── */
.qps-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ── Top bar ── */
.qps-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 2px 10px;
}

.qps-quiz-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.qps-share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: #1D9E75;
    border: 1.5px solid #1D9E75;
    border-radius: 8px;
    padding: 7px 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s;
    flex-shrink: 0;
}
.qps-share-btn:hover {
    background: #fff;
    color: #1D9E75;
    border-color: #1D9E75;
}
.qps-share-btn:active { transform: scale(0.97); }

/* ── Card ── */
.qps-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.qps-accent {
    height: 3px;
    width: 100%;
}
.qps-accent.diff-easy   { background: #1D9E75; }
.qps-accent.diff-medium { background: #EF9F27; }
.qps-accent.diff-hard   { background: #E24B4A; }

.qps-inner {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.qps-sep {
    height: 1px;
    background: #f3f4f6;
    margin: 0 -16px;
    width: calc(100% + 32px);
}

/* ── Timer ── */
.qps-timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* player.js adds .warning / .danger to id="timer" */
#timer.warning .qps-ring-fg { stroke: #EF9F27 !important; }
#timer.danger  .qps-ring-fg { stroke: #E24B4A !important; }

.qps-ring-wrap {
    position: relative;
    width: 112px;
    height: 112px;
}

.qps-ring-svg {
    width: 112px;
    height: 112px;
    transform: rotate(-90deg);
}

.qps-ring-track {
    fill: none;
    stroke: #f0f0f4;
    stroke-width: 6;
}

.qps-ring-fg {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke 0.5s ease;
}

.qps-ring-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    line-height: 1;
}

.qps-timer-val {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.qps-timer-lbl {
    font-size: 9px;
    color: #9ca3af;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.qps-timer-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.qps-t-stat { text-align: center; }

.qps-t-val {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    font-variant-numeric: tabular-nums;
}

.qps-t-lbl {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 1px;
}

.qps-t-div {
    width: 1px;
    height: 28px;
    background: #e5e7eb;
}

/* ── Stats row ── */
.qps-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.qps-stat {
    background: #f9fafb;
    border-radius: 8px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.qps-stat svg {
    width: 15px;
    height: 15px;
    color: #7c73d8;
}

.qps-stat-v {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
}

.qps-stat-l {
    font-size: 9px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ── Difficulty ── */
.qps-diff-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qps-diff-key {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.qps-diff-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qps-diff-bars {
    display: flex;
    align-items: flex-end;
    gap: 2.5px;
    height: 14px;
}

.qps-dbar {
    width: 5px;
    border-radius: 2px;
    background: #e5e7eb;
}

.qps-dbar-1 { height: 5px; }
.qps-dbar-2 { height: 9px; }
.qps-dbar-3 { height: 14px; }

.qps-diff-bars.diff-easy   .qps-dbar.lit { background: #1D9E75; }
.qps-diff-bars.diff-medium .qps-dbar.lit { background: #EF9F27; }
.qps-diff-bars.diff-hard   .qps-dbar.lit { background: #E24B4A; }

.qps-diff-text { font-size: 12px; font-weight: 600; }
.qps-diff-text.diff-easy   { color: #0F6E56; }
.qps-diff-text.diff-medium { color: #854F0B; }
.qps-diff-text.diff-hard   { color: #A32D2D; }

/* ── Map header ── */
.qps-map-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qps-map-title {
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qps-map-frac {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a2e;
}

/* ── Dot layout (≤ 6 questions) ── */
.qps-dots {
    display: flex;
    align-items: center;
    width: 100%;
}

.qps-dot-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.qps-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 1;
}

.qps-dot:hover { border-color: #a5b4fc; }

.qps-dot.active {
    background: #7c73d8;
    border-color: #7c73d8;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(124,115,216,0.18);
}

.qps-dot.answered {
    background: #534AB7;
    border-color: #534AB7;
    color: #fff;
}

.qps-dot-connector {
    height: 1px;
    flex: 1;
    background: #e5e7eb;
    margin-top: 0;
}

.qps-dot-connector.answered { background: #7c73d8; }

/* ── Grid layout (7+ questions) ── */
.qps-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.qps-cell {
    aspect-ratio: 1;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.15s;
}

.qps-cell:hover { border-color: #c4b5fd; }

.qps-cell.active {
    background: #7c73d8;
    border-color: #534AB7;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(124,115,216,0.2);
}

.qps-cell.answered {
    background: #ede9fe;
    border-color: #a5b4fc;
    color: #3730a3;
}

/* ── Legend ── */
.qps-legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.qps-leg {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #9ca3af;
}

.qps-leg-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    border: 1px solid transparent;
}

.qps-leg-dot.active   { background: #7c73d8; border-color: #534AB7; }
.qps-leg-dot.answered { background: #ede9fe; border-color: #a5b4fc; }
.qps-leg-dot.pending  { background: #f9fafb; border-color: #e5e7eb; }

/* ── Completion bar ── */
.qps-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qps-bar-track {
    flex: 1;
    height: 4px;
    background: #f3f4f6;
    border-radius: 99px;
    overflow: hidden;
}

.qps-bar-fill {
    height: 100%;
    background: #7c73d8;
    border-radius: 99px;
    transition: width 0.6s ease;
}

.qps-bar-pct {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    min-width: 30px;
    text-align: right;
}

.qps-ans-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
}

.qps-ans-row strong {
    font-weight: 600;
    color: #1a1a2e;
}
