/* Orders Page Styles */
.orders-page {
  background-color: #f8f9fa;
  min-height: 100vh;
}

.orders-page .cart-count {
  background: #e74c3c !important;
  color: white !important;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
  min-width: 18px;
  text-align: center;
  line-height: 1;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-left: 4px;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.orders-main {
  padding-top: 80px;
  min-height: calc(100vh - 80px);
}

.orders-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Page Header */
.orders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content h1 {
  color: #2c5aa0;
  margin-bottom: 0.5rem;
  font-size: 2rem;
}

.header-content p {
  color: #666;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

/* Filters Section */
.orders-filters {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.filters-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.filters-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.filters-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 2.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
}

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

.filter-group label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
}

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

.quick-filters {
  display: flex;
  gap: 0.5rem;
}

.quick-filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.quick-filter-btn:hover,
.quick-filter-btn.active {
  background: #2c5aa0;
  color: white;
  border-color: #2c5aa0;
}

.clear-filters-btn {
  padding: 0.5rem 1rem;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  margin-left: 1rem;
}

.clear-filters-btn:hover {
  background: #c82333;
}

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

.summary-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.summary-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.summary-card:nth-child(1) .summary-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.summary-card:nth-child(2) .summary-icon {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.summary-card:nth-child(3) .summary-icon {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.summary-card:nth-child(4) .summary-icon {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.summary-content h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2c5aa0;
  margin: 0;
}

.summary-content p {
  color: #666;
  margin: 0;
  font-size: 0.9rem;
}

/* Orders List */
.orders-list {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
}

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

.orders-header-row h2 {
  color: #2c5aa0;
  margin: 0;
}

.view-options {
  display: flex;
  gap: 0.5rem;
}

.view-btn {
  padding: 0.5rem;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  color: #666;
  transition: all 0.3s ease;
}

.view-btn:hover,
.view-btn.active {
  background: #2c5aa0;
  color: white;
  border-color: #2c5aa0;
}

/* Loading and Empty States */
.loading-state,
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #666;
}

.loading-state i,
.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #2c5aa0;
}

.empty-state h3 {
  color: #2c5aa0;
  margin-bottom: 0.5rem;
}

/* Orders Container Views */
.orders-container-view {
  padding: 2rem;
}

/* Card View */
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.5rem;
}

.order-card {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.order-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.order-card.pending_approval {
  border-left: 4px solid #ffc107;
}

.order-card.approved {
  border-left: 4px solid #28a745;
}

.order-card.rejected {
  border-left: 4px solid #dc3545;
}

.order-card.processing {
  border-left: 4px solid #17a2b8;
}

.order-card.shipped {
  border-left: 4px solid #6f42c1;
}

.order-card.delivered {
  border-left: 4px solid #20c997;
}

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

.order-id {
  font-weight: 600;
  color: #2c5aa0;
  font-size: 1.1rem;
}

.order-date {
  color: #666;
  font-size: 0.9rem;
}

.order-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
}

.status-pending_approval {
  background: #fff3cd;
  color: #856404;
}

.status-approved {
  background: #d4edda;
  color: #155724;
}

.status-rejected {
  background: #f8d7da;
  color: #721c24;
}

.status-processing {
  background: #d1ecf1;
  color: #0c5460;
}

.status-shipped {
  background: #e2e3f0;
  color: #383d41;
}

.status-delivered {
  background: #d1f2eb;
  color: #0c5460;
}

.order-items {
  margin-bottom: 1rem;
}

.order-items-list {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.4;
}

.order-total {
  font-weight: 600;
  color: #2c5aa0;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: #666;
}

.order-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.order-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.order-action-btn {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.3s ease;
}

.order-action-btn.primary {
  background: #2c5aa0;
  color: white;
}

.order-action-btn.primary:hover {
  background: #1e3d6f;
}

.order-action-btn.secondary {
  background: #6c757d;
  color: white;
}

.order-action-btn.secondary:hover {
  background: #545b62;
}

.order-action-btn.success {
  background: #28a745;
  color: white;
}

.order-action-btn.success:hover {
  background: #1e7e34;
}

/* Table View */
.orders-table {
  width: 100%;
  border-collapse: collapse;
}

.orders-table th,
.orders-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.orders-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #2c5aa0;
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.orders-table .order-id-cell {
  font-weight: 600;
  color: #2c5aa0;
}

.orders-table .order-items-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-table .order-total-cell {
  font-weight: 600;
  color: #28a745;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem;
  border-top: 1px solid #e9ecef;
}

.pagination-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  color: #666;
  text-decoration: none;
  transition: all 0.3s ease;
}

.pagination-btn:hover,
.pagination-btn.active {
  background: #2c5aa0;
  color: white;
  border-color: #2c5aa0;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  color: #666;
  font-size: 0.9rem;
  margin: 0 1rem;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
}

.order-modal {
  background: white;
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

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

.modal-header h2 {
  color: #2c5aa0;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: #f8f9fa;
  color: #2c5aa0;
}

.modal-content {
  padding: 2rem;
}

.modal-actions {
  padding: 1.5rem 2rem;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Order Detail Styles */
.order-detail-section {
  margin-bottom: 2rem;
}

.order-detail-section h3 {
  color: #2c5aa0;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

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

.order-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.order-detail-label {
  font-weight: 600;
  color: #666;
  font-size: 0.9rem;
}

.order-detail-value {
  color: #333;
}

.order-items-detail {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.order-items-detail table {
  width: 100%;
  border-collapse: collapse;
}

.order-items-detail th,
.order-items-detail td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.order-items-detail th {
  background: #f8f9fa;
  font-weight: 600;
}

.order-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.order-photo-item {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.order-photo-placeholder {
  width: 100%;
  height: 120px;
  background: #f8f9fa;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .orders-container {
    padding: 1rem;
  }
  
  .orders-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .filters-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    min-width: auto;
  }
  
  .quick-filters {
    flex-wrap: wrap;
  }
  
  .orders-summary {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .orders-grid {
    grid-template-columns: 1fr;
  }
  
  .order-card {
    padding: 1rem;
  }
  
  .orders-table {
    font-size: 0.8rem;
  }
  
  .orders-table th,
  .orders-table td {
    padding: 0.5rem;
  }
  
  .modal-overlay {
    padding: 1rem;
  }
  
  .order-modal {
    max-height: 95vh;
  }
  
  .modal-content {
    padding: 1rem;
  }
  
  .order-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .summary-card {
    padding: 1rem;
  }
  
  .summary-content h3 {
    font-size: 1.4rem;
  }
  
  .order-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .order-actions {
    justify-content: center;
  }
}