/* === History component (gen-4, gen-5, history.html) === */
.history-title i {
    color: var(--primary);
    font-size: 1.2rem;
}
.btn-refresh {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}
.btn-refresh:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}
.btn-refresh:active {
    transform: translateY(0);
}
.btn-refresh i {
    transition: transform 0.3s ease;
}
.btn-refresh:hover i {
    transform: rotate(180deg);
}
.history-container > p {
    color: #6b7280;
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}
#historyList {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.history-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}
.history-item:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
    transform: translateX(4px);
}
.history-item:hover::before {
    transform: scaleY(1);
}
.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}
.history-item-title {
    margin: 0;
    color: var(--dark);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    flex: 1;
    line-height: 1.4;
}
.history-item-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.history-item-badge.ready {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #86efac;
}
.history-item-badge.processing {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}
.history-item-badge i {
    font-size: 0.7rem;
}
.history-item-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: #6b7280;
    flex-wrap: wrap;
    align-items: center;
}
.history-item-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
}
.history-item-meta-item i {
    color: var(--primary);
    font-size: 0.9rem;
}
.history-item-plan {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #475569;
    font-weight: 500;
}

@media (max-width: 768px) {
    .history-container {
        padding: 20px;
        margin-top: 20px;
    }
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .history-title {
        font-size: 1.1rem;
    }
    .btn-refresh {
        width: 100%;
        justify-content: center;
    }
    .history-item {
        padding: 16px;
    }
    .history-item-header {
        flex-direction: column;
        gap: 10px;
    }
    .history-item-badge {
        align-self: flex-start;
    }
    .history-item-meta {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}
