/* History Page Styles */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.history-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.history-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group label {
  font-weight: 500;
}

.filter-group input,
.filter-group select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-item {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.history-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.history-item-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6c757d;
}

.history-item-meta {
  display: flex;
  gap: 0.75rem;
}

.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

.badge-entities {
  background: #e3f2fd;
  color: #1976d2;
}

.badge-time {
  background: #f3e5f5;
  color: #7b1fa2;
}

.history-item-text {
  color: #333;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.history-item-actions {
  display: flex;
  gap: 0.5rem;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #6c757d;
}

.empty-state i {
  color: #dee2e6;
  margin-bottom: 1rem;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  width: 90%;
  max-width: 800px;
  border-radius: 8px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-modal {
  font-size: 1.5rem;
  cursor: pointer;
  color: #6c757d;
}

.modal-body {
  padding: 1.5rem;
}

.detail-section {
  margin-bottom: 2rem;
}

.detail-section h4 {
  margin-bottom: 0.75rem;
  color: #495057;
}

.text-box {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid #dee2e6;
  max-height: 200px;
  overflow-y: auto;
}

.performance-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat {
  text-align: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 4px;
}

.stat-label {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: #495057;
}

.entity-type-group {
  margin-bottom: 1rem;
}

.entity-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.entity-badge {
  background: #e9ecef;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
}

.detail-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}
/* History Modal */
#historyModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

#historyModal .modal-card {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  padding: 20px;
  overflow: hidden;
}

.history-left {
  overflow-y: auto;
  max-height: 70vh;
}

.history-right {
  border-left: 2px solid #e2e8f0;
  padding-left: 20px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.history-table th {
  background: #f1f5f9;
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  position: sticky;
  top: 0;
}

.history-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.history-table tr:hover {
  background: #f8fafc;
}

.history-empty {
  text-align: center;
  padding: 40px !important;
  color: #94a3b8;
}

.entity-display {
  margin-top: 15px;
}

.entity-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 5px;
  margin-bottom: 5px;
  color: white;
}

.entity-badge.PER {
  background: var(--person);
}
.entity-badge.LOC {
  background: var(--location);
}
.entity-badge.ORG {
  background: var(--organization);
}
.entity-badge.DATE {
  background: var(--date);
}
.entity-badge.MONEY {
  background: var(--money);
}
