/* History Page */

.back-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #374151;
    border-radius: 8px;
    transition: background 0.2s;
    text-decoration: none;
    display: flex;
}

.back-btn:hover {
    background: #f3f4f6;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

/* Stats Card */
.stats-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    text-align: center;
}

.stat-item {
    padding: 12px 8px;
    border-radius: 12px;
    background: #f9fafb;
}

.stat-item.highlight {
    background: #eff6ff;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-item.highlight .stat-value {
    color: #3b82f6;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 4px;
}

/* Filter Section */
.filter-section {
    display: flex;
    gap: 8px;
}

.month-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #374151;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.month-select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.history-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.item-left {
    flex: 1;
    min-width: 0;
}

.item-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.item-summary {
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 12px;
}

.item-direction {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

.item-direction.up {
    color: #16a34a;
}

.item-direction.down {
    color: #dc2626;
}

.item-confidence {
    font-size: 0.8rem;
    font-weight: 400;
    color: #9ca3af;
}

.item-result {
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
}

.result-badge.correct {
    background: #dcfce7;
    color: #166534;
}

.result-badge.wrong {
    background: #fef2f2;
    color: #991b1b;
}

.result-badge.pending {
    background: #f3f4f6;
    color: #6b7280;
}

.change {
    font-size: 0.8rem;
    font-weight: 600;
}

.change.positive {
    color: #16a34a;
}

.change.negative {
    color: #dc2626;
}

.loading-text {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 480px) {
    .item-summary {
        max-width: 140px;
    }

    .stat-value {
        font-size: 1.3rem;
    }
}
