/* History Page Styles */
.history-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.history-header h1 {
    font-size: 2.5rem;
    color: var(--dark);
}

.history-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-range {
    display: flex;
    gap: 8px;
    background: var(--light);
    border-radius: 8px;
    padding: 4px;
}

.btn-date {
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--gray);
    font-family: var(--font-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-date:hover {
    color: var(--primary);
    background: white;
}

.btn-date.active {
    background: var(--primary);
    color: white;
}

.history-filters {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    box-shadow: var(--shadow);
}

.filter-section h3 {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 16px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--gray);
    font-size: 0.95rem;
}

.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--light-gray);
    border-radius: 4px;
    cursor: pointer;
}

.asset-search {
    position: relative;
    margin-bottom: 16px;
}

.asset-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.asset-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--light-gray);
    border-radius: 6px;
    font-family: var(--font-primary);
}

.asset-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.filter-actions {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: var(--light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
}

.stat-info {
    flex: 1;
}

.stat-label {
    display: block;
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-value.positive {
    color: var(--success);
}

.stat-value.negative {
    color: var(--danger);
}

.history-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.history-table th {
    text-align: left;
    padding: 20px 16px;
    color: var(--gray);
    font-weight: 500;
    border-bottom: 1px solid var(--light-gray);
    white-space: nowrap;
}

.history-table td {
    padding: 20px 16px;
    border-bottom: 1px solid var(--light-gray);
    white-space: nowrap;
}

.history-table tbody tr:hover {
    background: var(--light);
}

.date {
    display: block;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 4px;
}

.time {
    display: block;
    color: var(--gray);
    font-size: 0.85rem;
}

.tx-type {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tx-type.trade.buy {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.tx-type.trade.sell {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.tx-type.deposit {
    background: rgba(10, 132, 255, 0.1);
    color: var(--primary);
}

.tx-type.withdrawal {
    background: rgba(255, 107, 53, 0.1);
    color: var(--accent);
}

.tx-type.staking {
    background: rgba(168, 85, 247, 0.1);
    color: #8B5CF6;
}

.asset-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.asset-icon {
    width: 32px;
    height: 32px;
    background: var(--light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1rem;
}

.asset-icon.usd {
    background: var(--success);
    color: white;
}

.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status.failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status.cancelled {
    background: rgba(107, 114, 128, 0.1);
    color: var(--gray);
}

.btn-details {
    width: 36px;
    height: 36px;
    border: 1px solid var(--light-gray);
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gray);
}

.btn-details:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.btn-pagination {
    padding: 10px 20px;
    border: 1px solid var(--light-gray);
    background: white;
    border-radius: 6px;
    color: var(--dark);
    font-family: var(--font-primary);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-pagination:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 8px;
}

.page-number {
    width: 40px;
    height: 40px;
    border: 1px solid var(--light-gray);
    background: white;
    border-radius: 6px;
    color: var(--dark);
    font-family: var(--font-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-number:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-number.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-dots {
    color: var(--gray);
    padding: 0 8px;
}

/* Responsive History */
@media (max-width: 1200px) {
    .history-filters {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .history-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .date-range {
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .btn-date {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .history-filters {
        grid-template-columns: 1fr;
    }
    
    .history-stats {
        grid-template-columns: 1fr;
    }
    
    .history-table-container {
        overflow-x: auto;
    }
    
    .history-table {
        font-size: 0.8rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 12px;
    }
}