/* Orders Page Styles - Matching Flutter App Design */

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.5;
}

/* Header */
.orders-header {
  background: #2e7d32;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #d32f2f;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(211, 47, 47, 0.2);
  cursor: pointer;
}

.logout-btn:hover {
  background: rgba(211, 47, 47, 0.1);
  transform: translateY(-1px);
}

.orders-container {
  max-width: 600px;
  margin: 0 auto;
}

.back-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.back-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.back-icon {
  font-size: 20px;
  color: white;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin: 0;
}

.header-spacer {
  width: 36px;
}

/* Container */
.orders-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2e7d32;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 20px;
  color: #333;
}

.empty-state p {
  margin: 0 0 24px;
  color: #666;
}

.shop-btn {
  background: #2e7d32;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.shop-btn:hover {
  background: #1b5e20;
}

.btn-icon {
  font-size: 18px;
}

/* Order Cards */
.order-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.order-id {
  font-size: 16px;
  font-weight: 600;
  color: #2e7d32;
  margin: 0;
}

.status-chip {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}

.order-meta {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

.order-separator {
  margin: 0 8px;
}

/* Delivery Time Chip */
.delivery-time-chip {
  background: #fff3e0;
  border: 1px solid #ffb74d;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-icon {
  font-size: 16px;
}

.time-text {
  font-size: 14px;
  color: #e65100;
  font-weight: 500;
}

/* Order Items */
.order-items {
  margin-bottom: 16px;
}

.order-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.order-item:last-child {
  border-bottom: none;
}

.item-icon {
  font-size: 24px;
  margin-right: 12px;
  width: 32px;
  text-align: center;
}

.item-details {
  flex: 1;
}

.item-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
}

.quantity-chip {
  background: #e8f5e8;
  border: 1px solid #4caf50;
  border-radius: 12px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.quantity-text {
  font-size: 12px;
  color: #2e7d32;
  font-weight: 500;
}

.quantity-urdu {
  font-size: 10px;
  color: #2e7d32;
}

.item-price {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

/* Pricing Breakdown */
.pricing-breakdown {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.price-row:last-child {
  margin-bottom: 0;
}

.price-label {
  font-size: 14px;
  color: #666;
}

.price-value {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.total-row .price-label {
  font-weight: 600;
  color: #333;
}

.total-row .price-value {
  font-weight: 600;
  color: #2e7d32;
  font-size: 16px;
}

.item-count {
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
}

.action-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.complain-btn {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

.complain-btn:hover {
  background: #ffcdd2;
}

.reorder-btn {
  background: #e8f5e8;
  color: #2e7d32;
  border: 1px solid #4caf50;
}

.reorder-btn:hover {
  background: #c8e6c9;
}

.cancel-btn {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

.cancel-btn:hover {
  background: #ffcdd2;
}

.btn-icon {
  font-size: 16px;
}

.btn-text {
  font-size: 14px;
}

/* Order Details Modal */
.order-details-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

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

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 4px;
}

.modal-body {
  padding: 20px;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.detail-label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  min-width: 120px;
}

.detail-value {
  font-size: 14px;
  color: #333;
  text-align: right;
  flex: 1;
}

/* Responsive Design */
@media (max-width: 480px) {
  .orders-container {
    padding: 12px;
  }
  
  .order-card {
    padding: 12px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-btn {
    width: 100%;
  }
  
  .modal-content {
    margin: 10px;
  }
  
  .modal-body {
    padding: 16px;
  }
}

/* Status Colors */
.status-pending {
  background: #fff3e0;
  color: #e65100;
}

.status-confirmed {
  background: #e3f2fd;
  color: #1565c0;
}

.status-readyForShopping {
  background: #f3e5f5;
  color: #7b1fa2;
}

.status-shopping {
  background: #e8f5e8;
  color: #2e7d32;
}

.status-readyForDelivery {
  background: #fff8e1;
  color: #f57c00;
}

.status-outForDelivery {
  background: #e1f5fe;
  color: #0277bd;
}

.status-delivered {
  background: #e8f5e8;
  color: #2e7d32;
}

.status-complete {
  background: #e8f5e8;
  color: #2e7d32;
}

.status-cancelled {
  background: #ffebee;
  color: #c62828;
}