/* ================================
   HISTORY PAGE STYLES
   ================================ */

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

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

.hstat-icon {
  font-size: 2rem;
}

.hstat-info {
  display: flex;
  flex-direction: column;
}

.hstat-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.hstat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Filters */
.history-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

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

.filter-tab {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.filter-tab.active {
  background: var(--accent-primary);
  color: #000;
}

.export-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.export-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.export-btn svg {
  width: 16px;
  height: 16px;
}

/* History Table */
.history-card {
  overflow: hidden;
}

.table-wrapper {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th {
  padding: 16px 20px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
}

.history-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.history-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

/* Type Badge */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.type-badge.deposit {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-primary);
}

.type-badge.withdraw {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.type-badge.profit {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-secondary);
}

/* Amount */
.amount-cell {
  font-family: var(--font-mono);
  font-weight: 600;
}

.amount-cell.positive {
  color: var(--accent-primary);
}

.amount-cell.negative {
  color: #ef4444;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.completed {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-primary);
}

.status-badge.pending {
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent-warning);
}

.status-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Date */
.date-cell {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Empty State in Table */
.history-card .empty-state {
  padding: 60px 20px;
}

.history-card .empty-state h3 {
  margin-bottom: 8px;
}

.history-card .empty-state p {
  margin-bottom: 20px;
}

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

@media (max-width: 600px) {
  .history-stats {
    grid-template-columns: 1fr;
  }
  
  .history-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-tabs {
    overflow-x: auto;
    justify-content: flex-start;
  }
  
  .export-btn {
    align-self: flex-end;
  }
  
  .history-table th,
  .history-table td {
    padding: 12px 16px;
  }
  
  .history-table th:nth-child(3),
  .history-table td:nth-child(3) {
    display: none;
  }
}
