/* ===== History Page Styles ===== */

.history-page {
    padding: calc(var(--nav-height) + 80px) 0 60px;
    min-height: 100vh;
}

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

.header-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-content p {
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* ===== Filters ===== */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.filters-left {
    display: flex;
    gap: 16px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-muted);
}

.filter-group select {
    padding: 8px 32px 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b7b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 250px;
}

.search-box i {
    color: var(--text-muted);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all var(--transition-normal);
}

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

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.total {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.stat-icon.high-risk {
    background: rgba(239, 68, 68, 0.1);
    color: var(--risk-critical);
}

.stat-icon.safe {
    background: rgba(34, 197, 94, 0.1);
    color: var(--risk-low);
}

.stat-icon.avg {
    background: rgba(234, 179, 8, 0.1);
    color: var(--risk-medium);
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== History List ===== */
.history-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
}

.history-list {
    padding: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    transition: background var(--transition-fast);
}

.history-item:hover {
    background: var(--bg-secondary);
}

.history-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.history-icon.audio {
    background: rgba(34, 197, 94, 0.1);
    color: var(--risk-low);
}

.history-icon.video {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.history-icon.image {
    background: rgba(249, 115, 22, 0.1);
    color: var(--risk-high);
}

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

.history-name {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.history-score {
    text-align: center;
    padding: 8px 16px;
    border-radius: 10px;
    min-width: 70px;
}

.history-score.low {
    background: rgba(34, 197, 94, 0.1);
}

.history-score.medium {
    background: rgba(234, 179, 8, 0.1);
}

.history-score.high {
    background: rgba(249, 115, 22, 0.1);
}

.history-score.critical {
    background: rgba(239, 68, 68, 0.1);
}

.history-score .score-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
}

.history-score.low .score-value { color: var(--risk-low); }
.history-score.medium .score-value { color: var(--risk-medium); }
.history-score.high .score-value { color: var(--risk-high); }
.history-score.critical .score-value { color: var(--risk-critical); }

.history-score .score-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.history-label {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 140px;
    text-align: center;
}

.history-label.low {
    background: rgba(34, 197, 94, 0.1);
    color: var(--risk-low);
}

.history-label.medium {
    background: rgba(234, 179, 8, 0.1);
    color: var(--risk-medium);
}

.history-label.high {
    background: rgba(249, 115, 22, 0.1);
    color: var(--risk-high);
}

.history-label.critical {
    background: rgba(239, 68, 68, 0.1);
    color: var(--risk-critical);
}

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

.action-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Empty State */
.empty-state {
    padding: 80px 40px;
    text-align: center;
}

.empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 900px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .filters-bar {
        flex-direction: column;
        gap: 16px;
    }
    
    .filters-left {
        width: 100%;
    }
    
    .filters-right {
        width: 100%;
    }
    
    .search-box {
        width: 100%;
    }
    
    .history-item {
        flex-wrap: wrap;
    }
    
    .history-label {
        display: none;
    }
}
