/* ===== History Page ===== */
.page-history { animation: fadeIn 0.4s ease; }

.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.filter-tab {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    color: var(--text-secondary);
    transition: all var(--transition);
    cursor: pointer;
}

.filter-tab:hover { color: var(--text-primary); }

.filter-tab.active {
    background: var(--accent);
    color: #fff;
    font-weight: 550;
}

.filter-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
}

.filter-search input {
    border: none;
    background: none;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
    width: 160px;
}

.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.view-btn {
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all var(--transition);
}

.view-btn:hover { color: var(--text-primary); }
.view-btn.active { background: var(--glass); color: var(--text-primary); }

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

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    cursor: pointer;
}

.history-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.history-thumb {
    width: 64px; height: 64px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 11px;
    overflow: hidden;
}

.history-thumb img,
.history-thumb video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #000;
}

.history-thumb-placeholder {
    padding: 0 6px;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}

.history-info { flex: 1; }

.history-title {
    font-size: 13.5px;
    font-weight: 550;
    margin-bottom: 4px;
}

.history-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.history-credit {
    color: var(--accent);
    font-weight: 600;
}

.history-type-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 550;
}

.badge-model { background: rgba(233,30,99,0.12); color: var(--accent); }
.badge-tryon { background: rgba(124,77,255,0.12); color: var(--accent3); }
.badge-photoset { background: rgba(33,150,243,0.12); color: #2196f3; }
.badge-ecommerce { background: rgba(76,175,80,0.12); color: var(--success); }
.badge-grass { background: rgba(255,152,0,0.14); color: #ff9800; }
.badge-fission { background: rgba(0,188,212,0.14); color: #00acc1; }
.badge-video { background: rgba(255,107,53,0.12); color: var(--accent2); }

.history-actions {
    display: flex;
    gap: 6px;
}

/* History grid view */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.history-grid-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
}

.history-grid-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.history-grid-thumb {
    height: 160px;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    position: relative;
    overflow: hidden;
}

.history-grid-thumb img,
.history-grid-thumb video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #000;
}

.history-grid-badge {
    position: absolute;
    top: 8px; left: 8px;
    z-index: 2;
}

.history-grid-info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-grid-info h4 {
    font-size: 12.5px;
    font-weight: 550;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-grid-info span {
    font-size: 11px;
    color: var(--text-muted);
}

.history-grid-actions {
    padding: 0 10px 10px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.page-btn {
    width: 36px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.page-btn:hover { border-color: var(--accent); color: var(--accent); }

.page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 12px;
    color: var(--text-secondary);
}
