/* ===== Salesdata Universal Styles ===== */
/* Shared styles used across all sales data pages */

/* ===== Layout Structure ===== */
.main-container {
  min-height: 100vh;
  background: #f8fafc;
  padding: 2rem;
}

html.dark-mode .main-container {
  background: #1a1a1a;
}

.sales-content {
  animation: fadeInUp 0.4s ease-out;
}

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

/* ===== Grid Layouts ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  align-items: end;
}

.controls-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

.filter-actions {
  display: flex;
  gap: 1rem;
  grid-column: 1 / -1;
  justify-content: center;
  margin-top: 1rem;
}

/* ===== Section Headers ===== */
.section-header {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

html.dark-mode .section-title {
  color: #ecf0f1;
}

.section-subtitle {
  font-size: 1rem;
  color: #546e7a;
  margin: 0;
  font-weight: 400;
}

html.dark-mode .section-subtitle {
  color: #95a5a6;
}

/* ===== Navigation Tabs ===== */
.inner-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  background: white;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

html.dark-mode .inner-tabs {
  background: #2a2a2a;
}

.tab-button {
  flex: 1;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Sora', system-ui, sans-serif;
  color: #495057;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-button:hover {
  background: white;
  color: #4a6e1a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tab-button.active {
  background: linear-gradient(135deg, #8bc34a, #7ab82d);
  color: white;
  box-shadow: 0 3px 10px rgba(139, 195, 74, 0.3);
  transform: translateY(-1px);
}

.tab-button.active:hover {
  box-shadow: 0 4px 12px rgba(139, 195, 74, 0.4);
}

html.dark-mode .tab-button {
  background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
  color: #d1d5db;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html.dark-mode .tab-button:hover {
  background: #1a1a1a;
  color: #a5d461;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

html.dark-mode .tab-button.active {
  background: linear-gradient(135deg, #8bc34a, #7ab82d);
  color: white;
  box-shadow: 0 3px 10px rgba(139, 195, 74, 0.3);
}

html.dark-mode .tab-button.active:hover {
  box-shadow: 0 4px 12px rgba(139, 195, 74, 0.4);
}

/* Form and table styles are now in components/form.css and components/table.css */

/* ===== View Toggle Controls ===== */
.view-toggle {
  display: flex;
  gap: 0.5rem;
  background: #f8fafc;
  padding: 0.25rem;
  border-radius: 8px;
}

html.dark-mode .view-toggle {
  background: #1e1e1e;
}

/* Toggle Button - Flat color secondary UI control */
.toggle-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-family: 'Sora', system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f3f4f6;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-btn:hover {
  background: #e5e7eb;
  color: #374151;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.toggle-btn.active {
  background: linear-gradient(135deg, #8bc34a, #7ab82d);
  color: white;
  box-shadow: 0 3px 10px rgba(139, 195, 74, 0.3);
  border: none;
}

.toggle-btn.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 195, 74, 0.4);
}

html.dark-mode .toggle-btn {
  background: #374151;
  color: #9ca3af;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html.dark-mode .toggle-btn:hover {
  background: #4b5563;
  color: #e5e7eb;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

html.dark-mode .toggle-btn.active {
  background: linear-gradient(135deg, #8bc34a, #7ab82d);
  color: white;
  box-shadow: 0 3px 10px rgba(139, 195, 74, 0.3);
}

html.dark-mode .toggle-btn.active:hover {
  box-shadow: 0 4px 12px rgba(139, 195, 74, 0.4);
}

/* ===== Search Controls ===== */
.search-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 300px;
}

.search-box .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #546e7a;
  font-size: 1rem;
  pointer-events: none;
}

html.dark-mode .search-box .search-icon {
  color: #95a5a6;
}

.search-box .search-input {
  width: 100%;
  padding-left: 2.75rem;
}

.search-input {
  flex: 1;
  min-width: 300px;
}

/* Button styles are now in components/button.css */

/* Table base styles are now in components/table.css */

/* Products table specific - maintain minimum width for sales data */
.products-table {
  min-width: 1400px; /* Ensure table doesn't shrink below this width */
}

/* Column width optimization for sales data tables */
.table-header th:nth-child(1) { width: 10%; }   /* Order ID */
.table-header th:nth-child(2) { width: 11%; }  /* Date */
.table-header th:nth-child(3) { width: 7%; }   /* SKU */
.table-header th:nth-child(4) { width: 22%; }  /* Product */
.table-header th:nth-child(5) { width: 8%; }   /* Quantity */
.table-header th:nth-child(6) { width: 8%; }   /* Price */
.table-header th:nth-child(7) { width: 6%; }   /* Status */
.table-header th:nth-child(8) { width: 15%; }  /* Customer Group */
.table-header th:nth-child(9) { width: 10%; }  /* Currency */

.table-body td:nth-child(1) { width: 10%; }
.table-body td:nth-child(2) { width: 11%; }
.table-body td:nth-child(3) { width: 7%; }
.table-body td:nth-child(4) { width: 22%; }
.table-body td:nth-child(5) { width: 8%; }
.table-body td:nth-child(6) { width: 8%; }
.table-body td:nth-child(7) { width: 6%; }
.table-body td:nth-child(8) { width: 15%; }
.table-body td:nth-child(9) { width: 10%; }

.table-body tr {
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.2s ease;
}

html.dark-mode .table-body tr {
  border-bottom-color: #404040;
}

.table-body tr:hover {
  background: linear-gradient(135deg, #fefefe, #f8fafc);
}

html.dark-mode .table-body tr:hover {
  background: linear-gradient(135deg, #2a2a2a, #333);
}

/* Table body and empty state styles are now in components/table.css */

/* Stats card styles are now in components/card.css */

/* ===== Pagination ===== */
.pagination-section {
  margin-top: 2rem;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 2px solid #f1f5f9;
}

html.dark-mode .pagination-controls {
  background: #2a2a2a;
  border-color: #404040;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.page-info {
  font-weight: 600;
  color: #374151;
  padding: 0 1rem;
  font-size: 0.95rem;
}

html.dark-mode .page-info {
  color: #e5e7eb;
}

/* ===== Filter Groups ===== */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.upload-section,
.controls-section {
  margin-bottom: 2rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 968px) {
  .filters-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  .main-container {
    padding: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .controls-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .view-toggle {
    justify-content: center;
  }
  
  .search-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-input {
    min-width: auto;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .filter-actions {
    grid-column: 1;
    flex-direction: column;
  }
  
  .section-title {
    font-size: 1.25rem;
  }
  
  .card-title {
    font-size: 1.2rem;
  }
}

/* Card styles are now in components/card.css - using .card-animated for this module */

/* ===== Status Indicators ===== */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.status-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.status-error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.status-info {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

html.dark-mode .status-success {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

html.dark-mode .status-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

html.dark-mode .status-error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

html.dark-mode .status-info {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}