/* Order ID Tool Specific Styles */
/* Scoped to safeguard against global conflicts, though we use specific classes */

/* View Visibility Control */
.order-id-view-hidden {
  display: none !important;
}

.order-id-view-visible {
  display: block !important;
}

.order-id-container {
  max-width: 2200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  color: var(--text-primary, #e5e7eb);
}

.order-id-header {
  text-align: center;
  margin-bottom: 3rem;
}

.order-id-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  color: #f8fafc;
}

.order-id-subtitle {
  font-size: 1.125rem;
  opacity: 0.95;
  color: #94a3b8;
}

/* Upload Section */
.order-id-upload-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.order-id-upload-card {
  background: rgba(30, 41, 59, 0.5); /* Matches tpOS card style */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.order-id-upload-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.order-id-upload-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.order-id-upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6366f1; /* Primary color */
}

.order-id-upload-header h3 {
  font-size: 1.25rem;
  color: #f8fafc;
  margin: 0;
}

.order-id-file-input {
  display: none;
}

.order-id-file-label {
  display: block;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #94a3b8;
}

.order-id-file-label:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: #6366f1;
  color: #818cf8;
}

.order-id-file-info {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  display: none;
  font-weight: 500;
}

.order-id-file-info.show {
  display: block;
}

.order-id-compare-btn {
  grid-column: 1 / -1;
  padding: 1.25rem 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.order-id-compare-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.order-id-compare-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Results Section */
.order-id-results-section {
  animation: fadeIn 0.5s ease-in;
  display: none; /* Hidden by default */
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Summary Dashboard */
.order-id-summary-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.order-id-stat-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.2s;
}

.order-id-stat-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.order-id-stat-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  color: white;
}

.order-id-stat-card.total .order-id-stat-icon {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.order-id-stat-card.new .order-id-stat-icon {
  background: linear-gradient(135deg, #10b981, #059669);
}

.order-id-stat-card.changed .order-id-stat-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.order-id-stat-card.unchanged .order-id-stat-icon {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

.order-id-stat-content {
  flex: 1;
}

.order-id-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.order-id-stat-label {
  font-size: 0.875rem;
  color: #94a3b8;
  font-weight: 500;
}

.order-id-stat-percent {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* Controls */
.order-id-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.order-id-search-box {
  flex: 1;
  position: relative;
  max-width: 600px; /* Limit width */
}

.order-id-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
}

.order-id-search-box input {
  width: 100%;
  padding: 0.875rem 1.25rem 0.875rem 2.75rem;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  transition: all 0.2s;
}

.order-id-search-box input::placeholder {
  color: #64748b;
}

.order-id-search-box input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.order-id-action-buttons {
  display: flex;
  gap: 0.75rem;
}

.order-id-export-btn,
.order-id-save-btn {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.order-id-export-btn {
  background: #10b981;
}

.order-id-export-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}

.order-id-save-btn {
  background: #3b82f6;
}

.order-id-save-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.order-id-save-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Tabs */
.order-id-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.order-id-tab-btn {
  flex: 1;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: transparent;
  color: #94a3b8;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.order-id-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.order-id-tab-btn.active {
  background: #6366f1;
  color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Tab Content */
.order-id-tab-content {
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.order-id-tab-pane {
  display: none;
}

.order-id-tab-pane.active {
  display: block;
}

/* Tables */
.order-id-table-container {
  overflow-x: auto;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.3);
}

.order-id-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  color: #cbd5e1;
}

.order-id-table thead {
  background: rgba(15, 23, 42, 0.8);
  position: sticky;
  top: 0;
  z-index: 10;
}

.order-id-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #94a3b8;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.order-id-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.15s;
}

.order-id-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.order-id-table td {
  padding: 0.875rem 1rem;
}

/* Row type indicators */
tr.row-new {
  background: rgba(16, 185, 129, 0.05);
  border-left: 4px solid #10b981;
}

tr.row-changed {
  background: rgba(245, 158, 11, 0.05);
  border-left: 4px solid #f59e0b;
}

.change-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.change-badge.new {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.change-badge.changed {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.state-change {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.state-old {
  color: #64748b;
  text-decoration: line-through;
}

.state-arrow {
  color: #f59e0b;
  font-weight: 700;
}

.state-new {
  color: #fbbf24;
  font-weight: 600;
}

/* Priority badges */
.priority-high {
  color: #ef4444;
  font-weight: 600;
}

.priority-medium {
  color: #f59e0b;
  font-weight: 600;
}

.priority-low {
  color: #94a3b8;
}

/* Empty State */
.order-id-empty-state {
  text-align: center;
  padding: 3rem;
  color: #64748b;
}

.order-id-empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.order-id-empty-state-text {
  font-size: 1.125rem;
}

/* Loading State for Buttons */
.btn-loading {
  animation: spin 1s linear infinite;
}

@media (max-width: 768px) {
  .order-id-upload-section {
    grid-template-columns: 1fr;
  }
  .order-id-summary-dashboard {
    grid-template-columns: 1fr;
  }
  .order-id-controls {
    flex-direction: column;
  }
  .order-id-tabs {
    flex-direction: column;
  }
  .order-id-tab-btn {
    text-align: left;
  }
  .order-id-action-buttons {
    flex-direction: column;
  }
  .order-id-action-buttons {
    flex-direction: column;
  }
}

/* Mode Toggle */
.order-id-mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  border-radius: 0.75rem;
  width: fit-content;
}

.order-id-mode-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #94a3b8;
  background: transparent;
}

.order-id-mode-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.order-id-mode-btn.active {
  background: #6366f1!important; /* Primary color */
  color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
