* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  background: linear-gradient(135deg, #dc3545 0%, #6f42c1 100%);
  color: white;
  padding: 30px;
  border-radius: 10px;
  margin-bottom: 30px;
  text-align: center;
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
}

.summary {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.summary h2 {
  color: #dc3545;
  margin-bottom: 15px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-number {
  font-size: 2em;
  font-weight: bold;
  color: #dc3545;
}

.stat-subtitle {
  font-size: 0.8em;
  color: #666;
  margin-top: 5px;
  font-style: italic;
}

.filters {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-weight: 600;
  margin-bottom: 5px;
  color: #555;
}

.filter-group select,
.filter-group input {
  padding: 10px;
  border: 2px solid #e1e5e9;
  border-radius: 5px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: #dc3545;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.category-btn {
  padding: 8px 16px;
  border: 2px solid #dc3545;
  background: white;
  color: #dc3545;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.category-btn.active {
  background: #dc3545;
  color: white;
}

.category-btn:hover {
  background: #dc3545;
  color: white;
}

.results-container {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.results-header {
  background: #f8f9fa;
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.results-count {
  font-weight: 600;
  color: #dc3545;
}

.export-btn {
  padding: 10px 20px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  margin-left: 10px;
}

.export-btn:hover {
  background: #218838;
}

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

.results-table th {
  background: #f8f9fa;
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #e9ecef;
  position: sticky;
  top: 0;
  font-size: 13px;
  z-index: 10;
}

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

.results-table tr:hover {
  background: #f8f9fa;
}

.term-cell {
  font-family: "Courier New", monospace;
  font-weight: 500;
  max-width: 250px;
  word-wrap: break-word;
}

.category-tag {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.typo {
  background: #ffebee;
  color: #c62828;
}
.synonym {
  background: #fff3e0;
  color: #ef6c00;
}
.missing {
  background: #e8f5e8;
  color: #2e7d32;
}
.unknown {
  background: #f3e5f5;
  color: #7b1fa2;
}
.spacing {
  background: #e3f2fd;
  color: #1565c0;
}
.plural {
  background: #fce4ec;
  color: #ad1457;
}
.formatting {
  background: #fff8e1;
  color: #f57f17;
}
.incomplete {
  background: #fce4ec;
  color: #c2185b;
}
.missing-assortment {
  background: #e8f5e8;
  color: #2e7d32;
}
.bbd {
  background: #fff3e0;
  color: #ef6c00;
}
.seasonal {
  background: #e3f2fd;
  color: #1565c0;
}
.not-available {
  background: #ffebee;
  color: #c62828;
}

.impact-critical {
  color: #dc3545;
  font-weight: bold;
}
.impact-high {
  color: #fd7e14;
  font-weight: bold;
}
.impact-medium {
  color: #ffc107;
  font-weight: bold;
}
.impact-low {
  color: #28a745;
}

.issue-highlight {
  background: #ffeb3b;
  padding: 1px 3px;
  border-radius: 2px;
}

.row-number {
  color: #6c757d;
  font-size: 12px;
  text-align: center;
  width: 50px;
}

.proposed-fix {
  color: #28a745;
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.no-change {
  color: #6c757d;
  font-style: italic;
}

.no-change:hover {
  color: #495057;
  font-style: normal;
}

.loading {
  text-align: center;
  padding: 50px;
  color: #666;
}

.no-results {
  text-align: center;
  padding: 50px;
  color: #666;
  font-style: italic;
}

.results-table-container {
  max-height: fit-content;
  overflow-y: scroll;
  height: 80vh;
}

@media (max-width: 768px) {
  .filter-row {
    grid-template-columns: 1fr;
  }

  .results-table {
    font-size: 12px;
  }

  .results-table th,
  .results-table td {
    padding: 6px 4px;
  }
}
/* Checkbox styling */
.fix-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #28a745;
  transition: transform 0.1s ease;
}

.fix-checkbox:hover {
  transform: scale(1.1);
}

.fixed-row {
  background-color: #f8fff8 !important;
  opacity: 0.7;
}

.fixed-row .term-cell {
  text-decoration: line-through;
  color: #666;
}

/* Inline editing */
.editable-term {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
  min-height: 20px;
  display: inline-block;
  width: 100%;
}

.editable-term:hover {
  background-color: #f0f8ff;
  border: 1px dashed #007bff;
}

.editable-term.editing {
  background-color: white;
  border: 2px solid #007bff;
  outline: none;
}

.edit-indicator {
  font-size: 10px;
  color: #007bff;
  margin-left: 5px;
  opacity: 0;
  transition: opacity 0.2s;
}

.editable-term:hover .edit-indicator {
  opacity: 1;
}
/* Editable category styling */
.category-container {
  position: relative;
  display: inline-block;
}

.editable-category {
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.editable-category:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.category-edit-indicator {
  font-size: 8px;
  margin-left: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.editable-category:hover .category-edit-indicator {
  opacity: 1;
}

.category-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 2px solid #007bff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 180px;
  max-height: 200px;
  overflow-y: auto;
}

.category-option {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-option:hover {
  background-color: #f8f9fa;
}

.category-option.current {
  background-color: #e3f2fd;
  font-weight: bold;
}

.category-option .category-preview {
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.category-dropdown-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  color: white;
  font-weight: bold;
  font-size: 14px;
  border-radius: 12px 12px 0 0;
  text-align: center;
}
/* Multiple category support */
.add-category-btn {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: #28a745;
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  margin-left: 5px;
  transition: all 0.2s;
}

.add-category-btn:hover {
  background: #218838;
  transform: scale(1.1);
}

.category-remove {
  margin-left: 4px;
  color: #dc3545;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.category-tag:hover .category-remove {
  opacity: 1;
}

.category-remove:hover {
  color: #c82333;
  transform: scale(1.2);
}

.category-container .category-tag {
  margin-right: 4px;
  margin-bottom: 2px;
  display: inline-block;
}
/* Firebase status indicator */
.firebase-status {
  display: inline-flex;
  align-items: center;
  margin-right: 15px;
  font-size: 12px;
  color: #666;
}

.status-indicator {
  margin-right: 5px;
  font-size: 10px;
}

.status-indicator.connected {
  color: #28a745;
}

.status-indicator.disconnected {
  color: #dc3545;
}

.status-indicator.checking {
  color: #ffc107;
}
/* Bulk operations styling */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #e3f2fd;
  border-radius: 6px;
  border: 1px solid #2196f3;
  position: relative;
  z-index: 1000;
}

.bulk-count {
  font-weight: 600;
  color: #1976d2;
  font-size: 14px;
}

.bulk-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.bulk-btn:not(.secondary) {
  background: #2196f3;
  color: white;
}

.bulk-btn:not(.secondary):hover {
  background: #1976d2;
}

.bulk-btn.secondary {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.bulk-btn.secondary:hover {
  background: #e0e0e0;
}

/* Select all checkbox */
.select-all-checkbox {
  margin-right: 5px;
  cursor: pointer;
  transform: scale(1.1);
}

.select-all-label {
  font-size: 11px;
  cursor: pointer;
}

/* Row selection checkboxes */
.row-select-checkbox {
  cursor: pointer;
  transform: scale(1.1);
  transition: transform 0.1s ease;
}

.row-select-checkbox:hover {
  transform: scale(1.2);
}

/* Improve checkbox click area */
.results-table td:first-child {
  padding: 12px 8px;
}

.results-table td:nth-child(2) {
  padding: 12px 8px;
}

/* Row selection styling */
.results-table tr.selected {
  background-color: #e3f2fd !important;
  border-left: 3px solid #2196f3;
}

.results-table tr.selected:hover {
  background-color: #bbdefb !important;
}

/* Progress bar styling */
.progress-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #8bc34a);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 12px;
  font-weight: 600;
  color: #4caf50;
  text-align: center;
}

/* Small UI improvements */
.category-tag {
  transition: all 0.2s ease;
}

.category-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fix-checkbox:checked {
  transform: scale(1.1);
}

.results-table tr {
  transition: background-color 0.1s ease;
}

/* Bulk category dropdown */
.bulk-category-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 2px solid #2196f3;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  min-width: 280px;
  max-height: 400px;
  overflow-y: auto;
}

.bulk-category-dropdown .category-option {
  padding: 14px 18px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.bulk-category-dropdown .category-option:hover {
  background-color: #f8f9fa;
  transform: translateX(4px);
  border-left: 3px solid #2196f3;
}
/* Bulk term editor styling */
.bulk-term-editor {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 2px solid #2196f3;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  min-width: 400px;
  max-width: 550px;
}

.bulk-editor-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  color: white;
  font-weight: bold;
  font-size: 15px;
  border-radius: 10px 10px 0 0;
}

.bulk-editor-content {
  padding: 20px;
}

.bulk-editor-options {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.bulk-editor-options:hover {
  background-color: #f8f9fa;
}

.bulk-editor-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  min-width: 120px;
  cursor: pointer;
}

.bulk-editor-options input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  transition: border-color 0.2s ease;
}

.bulk-editor-options input[type="text"]:focus {
  outline: none;
  border-color: #2196f3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.bulk-editor-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
}

.bulk-editor-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.bulk-editor-btn.apply {
  background: #4caf50;
  color: white;
}

.bulk-editor-btn.apply:hover {
  background: #45a049;
}

.bulk-editor-btn.cancel {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.bulk-editor-btn.cancel:hover {
  background: #e0e0e0;
}

/* Improve column spacing */
.results-table th:first-child,
.results-table td:first-child {
  width: 60px;
  text-align: center;
}

.results-table th:nth-child(2),
.results-table td:nth-child(2) {
  width: 60px;
  text-align: center;
}
/* Enhanced bulk category dropdown */
.category-action-section {
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.category-action-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.category-action-header {
  padding: 12px 18px 8px 18px;
  font-size: 12px;
  font-weight: bold;
  color: #666;
  text-transform: uppercase;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  margin: 0 -18px 8px -18px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.bulk-category-dropdown .category-option[data-action="add"] span:first-child {
  color: #28a745;
  font-weight: 600;
}

.bulk-category-dropdown
  .category-option[data-action="remove"]
  span:first-child {
  color: #dc3545;
  font-weight: 600;
}

.bulk-category-dropdown
  .category-option[data-action="replace"]
  span:first-child {
  color: #007bff;
  font-weight: 600;
}
