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

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 1rem;
    font-size: 0.8rem;
}

.history-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.history-item:hover {
    border-color: var(--accent-color);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.history-content {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.history-meta .completed-badge {
    color: #22c55e;
    font-weight: 600;
}

.history-meta .progress-badge {
    color: var(--accent-color);
    font-weight: 600;
}

.history-progress-bar {
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.history-progress-fill {
    height: 100%;
    background: var(--accent-color);
    transition: width 0.2s ease;
}

.history-delete {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.history-delete:hover {
    color: var(--anchor-color);
    background: rgba(239, 68, 68, 0.1);
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Error State */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--anchor-color);
    border-radius: var(--radius);
    padding: 1rem;
    color: var(--anchor-color);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message::before {
    content: "⚠";
    font-size: 1.25rem;
}

/* Success State */
.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid #22c55e;
    border-radius: var(--radius);
    padding: 1rem;
    color: #16a34a;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-message::before {
    content: "✓";
    font-size: 1.25rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Word Transition */
@keyframes wordTransition {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.word-transition {
    animation: wordTransition 0.15s ease;
}
