/* Order Page Styles - Responsive Redesign */
:root {
  --primary-color: #2874f0;
  --primary-dark: #1a5cb8;
  --secondary-color: #fb641b;
  --dark-color: #212121;
  --darker-gray: #424242;
  --medium-color: #616161;
  --light-color: #f1f3f6;
  --white-color: #ffffff;
  --border-color: #e0e0e0;
  --success-color: #388e3c;
  --warning-color: #ff9f00;
  --danger-color: #e53935;
  --card-header-bg: #f0f2f5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  background-color: #f5f5f5;
}

/* Utility Classes */
.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.w-full {
  width: 100%;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Breadcrumb */
.breadcrumb-container {
  background-color: #f8f9fa;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  flex-wrap: wrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-link {
  display: flex;
  align-items: center;
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.breadcrumb-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  fill: currentColor;
}

.breadcrumb-separator {
  color: var(--medium-color);
  margin: 0 8px;
  display: flex;
  align-items: center;
}

.breadcrumb-current {
  color: var(--medium-color);
  font-weight: 500;
}

/* Order Container */
.order-container {
  padding: 20px 0 40px;
}

/* Order Card */
.order-card {
  background: var(--white-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: visible;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
}

.order-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Order Header */
.order-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  padding: 16px 20px;
  background: var(--card-header-bg);
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--darker-gray);
}

.order-header > div span {
  font-weight: 500;
  color: var(--dark-color);
  display: block;
  margin-top: 5px;
}

/* Products Grid - Improved Responsive Layout */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
}

/* Product Item - Better Space Utilization */
.product-item {
  display: flex;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--white-color);
  transition: var(--transition);
  position: relative;
  overflow: visible;
}

.product-item:hover {
  box-shadow: var(--shadow-sm);
}

.product-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-right: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  flex-shrink: 0;
}

.product-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.product-details h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-details .meta {
  font-size: 0.85rem;
  color: var(--medium-color);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

/* Status Badges */
.payment-status {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.25rem;
  text-transform: capitalize;
}

.status-pending {
  background-color: #ffebee;
  color: var(--danger-color);
}

.status-paid {
  background-color: #e3f8e8;
  color: var(--success-color);
}

.status-processing {
  background-color: #fff8e6;
  color: var(--warning-color);
}

.status-delivered {
  background: #e3f8e8;
  color: var(--success-color);
}

.status-shipped {
  background: #fff8e6;
  color: var(--warning-color);
}

.status-cancelled {
  background: #ffebee;
  color: var(--danger-color);
}

/* Enhanced Action Buttons */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.action-buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--primary-dark);
  border-radius: 4px;
  transition: var(--transition);
  background-color: rgba(40, 116, 240, 0.05);
  gap: 0.25rem;
  white-space: nowrap;
}

.action-buttons a:hover {
  background: rgba(40, 116, 240, 0.1);
  transform: translateY(-1px);
}

.action-buttons a i {
  font-size: 0.9em;
}

/* Improved Invoice Dropdown with High Z-Index */
.invoice-dropdown {
  position: relative;
  display: inline-block;
  z-index: 1000;
}

.invoice-btn {
  display: inline-flex;
  align-items: center;
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--primary-dark);
  border-radius: 4px;
  transition: var(--transition);
  background-color: rgba(40, 116, 240, 0.05);
  cursor: pointer;
  gap: 0.25rem;
  user-select: none;
}

.invoice-btn:hover {
  background: rgba(40, 116, 240, 0.1);
}

.invoice-dropdown-content {
  display: none;
  position: absolute;
  background-color: #fff;
  min-width: 220px;
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  border-radius: 4px;
  padding: 0.5rem 0;
  right: 0;
  top: 100%;
  margin-top: 0.25rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.invoice-dropdown-content a {
  color: #333;
  padding: 0.5rem 1rem;
  text-decoration: none;
  display: flex;
  font-size: 0.85rem;
  transition: var(--transition);
  position: relative;
  align-items: center;
}

.invoice-dropdown-content a:hover {
  background-color: #f5f5f5;
  color: var(--primary-dark);
}

.invoice-dropdown-content a i {
  width: 20px;
  text-align: center;
  margin-right: 0.5rem;
  color: inherit;
  font-size: 0.9em;
}

.invoice-dropdown-content a.active {
  background-color: #f0f7ff;
  color: var(--primary-dark);
}

.invoice-dropdown-content a.disabled {
  color: #999;
  pointer-events: none;
  opacity: 0.7;
}

.invoice-dropdown-content .divider {
  height: 1px;
  background-color: #eee;
  margin: 0.5rem 0;
}

/* Enhanced Tooltip Styles */
.invoice-dropdown-content a {
  position: relative;
}

.tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  width: 200px;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 10px;
  z-index: 1200;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
  text-align: center;
  line-height: 1.4;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.invoice-dropdown-content a:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* Show dropdown on hover or click */
.invoice-dropdown:hover .invoice-dropdown-content,
.invoice-dropdown:focus-within .invoice-dropdown-content {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Empty State */
.order-empty {
  background: var(--white-color);
  padding: 2.5rem;
  text-align: center;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.order-empty img {
  max-width: 200px;
  margin-bottom: 1.5rem;
}

.order-empty h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--dark-color);
}

.order-empty p {
  color: var(--medium-color);
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.order-empty .btn {
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  font-weight: 500;
  transition: var(--transition);
}

.order-empty .btn:hover {
  background: var(--primary-dark);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow-y: auto;
}

.modal-content {
  background-color: #fff;
  margin: 2rem auto;
  padding: 1.5rem;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark-color);
}

.close-modal {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--medium-color);
  transition: var(--transition);
  line-height: 1;
}

.close-modal:hover {
  color: var(--dark-color);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark-color);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(40, 116, 240, 0.2);
}

.star-rating {
  display: flex;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.star {
  font-size: 1.75rem;
  color: #ccc;
  cursor: pointer;
  transition: var(--transition);
}

.star:hover {
  transform: scale(1.1);
}

.star.active {
  color: #ffb300;
}

.star-text {
  font-size: 0.9rem;
  color: var(--medium-color);
  margin-bottom: 1rem;
}

.char-count,
.char-count1 {
  font-size: 0.75rem;
  color: var(--medium-color);
  text-align: right;
  margin-top: 0.25rem;
}

.file-upload-wrapper {
  margin-top: 0.5rem;
}

.file-upload-label {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: #f5f5f5;
  border: 1px dashed #ddd;
  border-radius: 4px;
  cursor: pointer;
  gap: 0.5rem;
  transition: var(--transition);
}

.file-upload-label:hover {
  background-color: #eee;
  border-color: #ccc;
}

.file-upload-input {
  display: none;
}

.file-upload-hint {
  font-size: 0.75rem;
  color: var(--medium-color);
  margin-top: 0.25rem;
}

.image-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.image-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.remove-image {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.spinner {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 2px solid white;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast Styles */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: var(--success-color);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 4px;
  display: none;
  align-items: center;
  gap: 0.5rem;
  z-index: 1100;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s ease-out;
}

.toast svg {
  flex-shrink: 0;
}

@keyframes slideIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .order-header {
    grid-template-columns: 1fr 1fr;
  }
  
  .modal-content {
    width: 95%;
    margin: 1rem auto;
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .breadcrumb-link span {
    display: none;
  }
  
  .breadcrumb-icon {
    margin-right: 0;
  }
  
  .order-header {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-buttons a {
    width: 100%;
    justify-content: center;
  }
  
  .invoice-dropdown {
    width: 100%;
  }
  
  .invoice-btn {
    width: 100%;
    justify-content: center;
  }
  
  .invoice-dropdown-content {
    width: 100%;
    min-width: auto;
  }
  
  .order-empty {
    padding: 1.5rem;
  }
  
  .order-empty img {
    max-width: 150px;
  }
}