/* Orders Section Styles */
:root {
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --primary-rgb: 52, 152, 219;
  --secondary-color: #2ecc71;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --text-primary: #e9e9ea;
  --text-secondary: #bdc3c7;
  --card-bg: #243047;
  --bg-secondary: #1a2238;
  --border-color: #34495e;
  --shadow-dark: 0 5px 15px rgba(0, 0, 0, 0.3);
  --transition-fast: 0.3s ease;
}

html.light {
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --card-bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --border-color: #dee2e6;
  --shadow-dark: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.orders-section {
  padding: 100px 0 60px;
  min-height: calc(100vh - 80px - 300px);
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 50px;
  color: var(--primary-color);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--primary-color);
}

/* Orders Filter */
.orders-filter {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
  background-color: var(--card-bg);
  border-radius: 15px;
  padding: 30px;
  box-shadow: var(--shadow-dark);
  transition: all var(--transition-fast);
  border: 1px solid var(--border-color);
}

.filter-group {
  width: 100%;
  margin-bottom: 25px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
  text-align: center;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.filter-btn {
  padding: 12px 24px;
  border-radius: 30px;
  border: none;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
}

.filter-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.industry-filter {
  display: flex;
  justify-content: center;
  width: 100%;
}

.industry-select {
  width: 100%;
  max-width: 400px;
  padding: 14px 20px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 20px center;
  background-size: 16px;
  transition: all var(--transition-fast);
}

.industry-select:hover {
  border-color: var(--primary-color);
}

.industry-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

/* Orders Container */
.orders-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.order-card {
  background-color: var(--card-bg);
  border-radius: 15px;
  padding: 25px;
  box-shadow: var(--shadow-dark);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-left: 4px solid transparent;
  border: 1px solid var(--border-color);
}

.order-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.order-card.pending {
  border-left-color: var(--warning-color);
}

.order-card.completed {
  border-left-color: var(--secondary-color);
}

.order-card.rejected {
  border-left-color: var(--danger-color);
}

.order-status {
  position: absolute;
  top: 0;
  right: 0;
  padding: 8px 16px;
  border-bottom-left-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending {
  background-color: var(--warning-color);
  color: white;
}

.status-completed {
  background-color: var(--secondary-color);
  color: white;
}

.status-rejected {
  background-color: var(--danger-color);
  color: white;
}

.order-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-primary);
  padding-right: 100px; /* Make room for status */
  line-height: 1.4;
}

.order-industry {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.order-industry i {
  margin-right: 10px;
  color: var(--primary-color);
}

.order-description {
  margin-bottom: 20px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
  line-height: 1.6;
}

.order-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.order-date {
  display: flex;
  align-items: center;
}

.order-date i {
  margin-right: 8px;
}

/* Fixed action buttons layout */
.order-actions {
  display: flex;
  margin-top: 20px;
  gap: 10px;
  flex-wrap: wrap; /* Allow buttons to wrap if needed */
}

/* Single button takes full width */
.order-actions.single-action .order-btn {
  width: 100%;
}

/* Two buttons layout */
.order-actions.dual-action .order-btn {
  flex: 1;
  min-width: calc(50% - 5px); /* Ensure buttons have enough width */
}

/* Three buttons layout */
.order-actions.triple-action {
  flex-wrap: wrap;
}

.order-actions.triple-action .order-btn {
  flex: 1 0 100%;
  margin-bottom: 8px;
}

.order-actions.triple-action .order-btn:last-child {
  margin-bottom: 0;
}

.order-btn {
  padding: 10px 15px;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  white-space: nowrap; /* Prevent text wrapping inside button */
}

.order-btn i {
  margin-right: 8px;
  font-size: 0.9em;
}

.view-btn {
  background-color: var(--primary-color);
  color: white;
}

.view-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.accept-btn {
  background-color: var(--secondary-color);
  color: white;
}

.accept-btn:hover {
  background-color: #27ae60;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.reject-btn {
  background-color: var(--danger-color);
  color: white;
}

.reject-btn:hover {
  background-color: #c0392b;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* Order Modal Styles - Improved */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.order-modal {
  background-color: var(--card-bg);
  border-radius: 15px;
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 35px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transform: translateY(30px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid var(--border-color);
}

.modal-overlay.active .order-modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  color: var(--primary-color);
  transform: rotate(90deg);
  background-color: rgba(52, 152, 219, 0.1);
}

.order-modal-content {
  margin-bottom: 30px;
}

.modal-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 25px;
  color: var(--primary-color);
  padding-bottom: 15px;
  border-bottom: 2px solid var(--primary-color);
  line-height: 1.3;
  padding-right: 40px; /* Make room for close button */
}

.modal-info-group {
  margin-bottom: 25px;
  background-color: rgba(52, 152, 219, 0.05);
  padding: 15px;
  border-radius: 10px;
  border-left: 3px solid var(--primary-color);
}

.modal-label {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  display: block;
  font-size: 1.05rem;
}

.modal-value {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 1rem;
  padding: 0 5px;
}

.modal-status {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-top: 10px;
  letter-spacing: 0.5px;
}

/* Improved modal actions layout */
.order-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.modal-btn {
  flex: 1 0 calc(50% - 6px); /* Two buttons per row with gap */
  padding: 12px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* For three buttons, stack them vertically on smaller screens */
@media (max-width: 500px) {
  .modal-btn {
    flex: 1 0 100%;
  }
}

.modal-btn i {
  margin-right: 10px;
  font-size: 0.9em;
}

.modal-btn-accept {
  background-color: var(--secondary-color);
  color: white;
}

.modal-btn-accept:hover {
  background-color: #27ae60;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.modal-btn-reject {
  background-color: var(--danger-color);
  color: white;
}

.modal-btn-reject:hover {
  background-color: #c0392b;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.modal-btn-close {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-btn-close:hover {
  background-color: var(--border-color);
  transform: translateY(-3px);
}

.modal-btn-confirm {
  background-color: var(--primary-color);
  color: white;
}

.modal-btn-confirm:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  width: 100%;
  color: var(--text-secondary);
}

.loading-spinner i {
  font-size: 50px;
  margin-bottom: 20px;
  color: var(--primary-color);
  animation: spin 1.5s linear infinite;
}

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

/* No Orders Message */
.no-orders-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: var(--text-secondary);
  background-color: var(--card-bg);
  border-radius: 15px;
  box-shadow: var(--shadow-dark);
  margin: 40px auto;
  max-width: 600px;
  border: 1px solid var(--border-color);
}

.no-orders-message i {
  font-size: 70px;
  margin-bottom: 25px;
  color: var(--border-color);
}

.no-orders-message p {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.no-orders-message .hero-btn {
  padding: 12px 24px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.no-orders-message .hero-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(52, 152, 219, 0.4);
}

/* Warning Icon */
.warning-icon {
  color: var(--warning-color);
  font-size: 28px;
  margin-bottom: 15px;
}

/* Animation for new orders */
@keyframes newOrderPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(52, 152, 219, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
  }
}

.new-order {
  animation: newOrderPulse 2s infinite;
}

/* Notification styles - Improved */
.notification {
  position: fixed;
  top: 30px;
  right: 30px;
  padding: 18px 25px;
  border-radius: 12px;
  background-color: var(--card-bg);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1001;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 400px;
  border: 1px solid var(--border-color);
}

.notification.active {
  transform: translateX(0);
}

.notification-content {
  display: flex;
  align-items: center;
}

.notification-content i {
  margin-right: 15px;
  font-size: 22px;
}

.notification-text {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.notification.success {
  border-left: 5px solid var(--secondary-color);
}

.notification.success i {
  color: var(--secondary-color);
}

.notification.error {
  border-left: 5px solid var(--danger-color);
}

.notification.error i {
  color: var(--danger-color);
}

.notification.info {
  border-left: 5px solid var(--primary-color);
}

.notification.info i {
  color: var(--primary-color);
}

.notification-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  margin-left: 15px;
  font-size: 18px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.notification-close:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.1);
}

/* Pagination Controls - Improved */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 50px;
  gap: 20px;
}

.pagination-btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  background-color: var(--primary-color);
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  font-size: 1rem;
}

.pagination-btn:hover:not(:disabled) {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.pagination-btn:disabled {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.7;
}

.pagination-btn i {
  margin-right: 8px;
}

.pagination-btn:last-child i {
  margin-right: 0;
  margin-left: 8px;
}

.pagination-info {
  font-size: 1rem;
  color: var(--text-secondary);
  background-color: var(--card-bg);
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

/* Order card status indicators */
.order-card-status {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.status-indicator-pending {
  background-color: var(--warning-color);
}

.status-indicator-completed {
  background-color: var(--secondary-color);
}

.status-indicator-rejected {
  background-color: var(--danger-color);
}

/* Animation classes for filtering */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
  opacity: 0;
}

.fade-out {
  animation: fadeOut 0.4s ease forwards;
}

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

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

/* Filter animation */
.filter-btn {
  position: relative;
  overflow: hidden;
}

.filter-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.filter-btn:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

/* Scrollbar styling */
.order-modal::-webkit-scrollbar {
  width: 8px;
}

.order-modal::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 10px;
}

.order-modal::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.order-modal::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Responsive Styles - Improved */
@media (max-width: 992px) {
  .orders-section {
    padding: 80px 20px 50px;
  }

  .orders-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
  }

  .order-modal {
    padding: 30px;
    max-width: 600px;
  }
}

@media (max-width: 768px) {
  .orders-filter {
    padding: 25px 20px;
  }

  .filter-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .filter-btn {
    flex: 1 0 calc(50% - 10px);
    text-align: center;
    padding: 10px 15px;
    font-size: 0.9rem;
  }

  .orders-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .order-card {
    padding: 20px;
  }

  /* Stack buttons vertically on medium screens */
  .order-actions {
    flex-direction: column;
    gap: 8px;
  }

  .order-btn {
    width: 100%;
    justify-content: center;
  }

  .order-modal {
    padding: 25px 20px;
    width: 95%;
  }

  .modal-title {
    font-size: 1.5rem;
    padding-right: 40px; /* Make room for close button */
  }

  .modal-info-group {
    padding: 12px;
    margin-bottom: 20px;
  }

  .modal-label {
    font-size: 1rem;
  }

  .modal-value {
    font-size: 0.95rem;
  }

  .order-modal-actions {
    flex-direction: column;
    gap: 10px;
  }

  .modal-btn {
    width: 100%;
    flex: 1 0 100%;
  }

  .pagination-controls {
    flex-wrap: wrap;
    gap: 15px;
  }

  .pagination-btn {
    flex: 1;
    justify-content: center;
    padding: 10px 15px;
  }

  .pagination-info {
    width: 100%;
    text-align: center;
  }

  .notification {
    left: 20px;
    right: 20px;
    max-width: none;
    top: 20px;
  }
}

@media (max-width: 480px) {
  .orders-section {
    padding: 70px 15px 40px;
  }

  .section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
  }

  .filter-btn {
    flex: 1 0 100%;
    margin-bottom: 10px;
  }

  .industry-select {
    padding: 12px 15px;
    font-size: 0.9rem;
  }

  .order-card {
    padding: 18px;
  }

  .order-title {
    font-size: 1.1rem;
    padding-right: 80px;
  }

  .order-status {
    padding: 6px 12px;
    font-size: 0.7rem;
  }

  /* Ensure buttons have enough space */
  .order-btn {
    padding: 10px;
    font-size: 0.85rem;
  }

  .order-btn i {
    margin-right: 5px;
    font-size: 0.85em;
  }

  .order-modal {
    padding: 20px 15px;
  }

  .modal-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
  }

  .order-modal-actions {
    flex-direction: column;
    gap: 10px;
  }

  .modal-btn {
    width: 100%;
    padding: 10px 15px;
  }

  .notification {
    padding: 15px;
  }

  .notification-content i {
    font-size: 18px;
    margin-right: 10px;
  }

  .notification-text {
    font-size: 0.9rem;
  }
}
