/**
 * YESORNOWHEEL.NET - History & Statistics Stylesheet
 * Decision History list, Statistics progress bars, and Series Tracker.
 */

/* Series Tracker for Best-of Modes */
.series-tracker {
    background: var(--surface);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: 0 0 16px var(--accent-glow);
    animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.series-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.series-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.round-badge {
    background: var(--accent-primary);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.series-tally {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.tally-item {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tally-yes { color: var(--yes-color); }
.tally-no { color: var(--no-color); }
.tally-maybe { color: var(--maybe-color); }

.tally-num {
    font-size: 1.2rem;
    font-family: var(--font-display);
    font-weight: 900;
}

.series-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.series-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
    transition: width 0.3s ease;
}

/* Statistics Overview Card */
.stats-card,
.history-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.section-card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-header,
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.stats-total-pill {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stats-bars-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-bar-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-bar-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
}

.stat-label-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    color: #ffffff;
}

.stat-badge-yes { background: var(--yes-color); }
.stat-badge-no { background: var(--no-color); }
.stat-badge-maybe { background: var(--maybe-color); }

.stat-count-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.stat-percent-label {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--text-primary);
}

.stat-track {
    width: 100%;
    height: 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-fill-yes { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-fill-no { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.stat-fill-maybe { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* History List & Controls */
.history-action-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-import-label {
    cursor: pointer;
    margin: 0;
}

.history-list-wrapper {
    min-height: 120px;
}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    gap: 12px;
    transition: border-color var(--transition-fast);
}

.history-item:hover {
    border-color: var(--border-strong);
}

.history-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.history-outcome-tag {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    color: #ffffff;
    flex-shrink: 0;
}

.history-outcome-tag.outcome-yes { background: var(--yes-color); }
.history-outcome-tag.outcome-no { background: var(--no-color); }
.history-outcome-tag.outcome-maybe { background: var(--maybe-color); }

.history-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.history-question {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.history-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-history-action {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.btn-history-action:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.btn-history-action.btn-del:hover {
    color: var(--no-color);
}

/* Empty State */
.history-empty {
    text-align: center;
    padding: 36px 16px;
}

.empty-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.empty-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-sub {
    font-size: 0.88rem;
    color: var(--text-secondary);
    max-width: 340px;
    margin: 0 auto;
}
