/* أنماط سجل الطلبات الحية */

.recent-orders-section {
  padding: 60px 24px;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--background);
}

.recent-orders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.recent-orders-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}

.recent-orders-title .icon {
  font-size: 36px;
}

.orders-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s;
}

.orders-link:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.recent-orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.order-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.3s;
  border-right: 4px solid var(--success);
  position: relative;
}

.order-card.warning {
  border-right-color: var(--warning);
}

.order-card.danger {
  border-right-color: var(--danger);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 2px 8px var(--shadow);
  }
  50% {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
  }
}

.order-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px var(--shadow);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}

.order-id {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.order-branch {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 4px;
}

.order-timer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.timer-label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
}

.timer-value {
  font-size: 24px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  padding: 8px 12px;
  border-radius: 8px;
  min-width: 120px;
  text-align: center;
}

.timer-value.safe {
  background: #d1fae5;
  color: #065f46;
}

.timer-value.warning {
  background: #fef3c7;
  color: #92400e;
}

.timer-value.danger {
  background: #fee2e2;
  color: #991b1b;
}

.order-items {
  margin-bottom: 16px;
}

.order-items-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}

.order-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 500px;
  overflow-y: auto;
}

.order-item {
  font-size: 14px;
  color: var(--text);
  padding: 8px 12px;
  background: var(--background);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.order-item.hidden-item {
  display: none;
}

.item-name {
  font-weight: 600;
  flex: 1;
  margin-left: 12px;
}

.item-quantity {
  color: var(--text-light);
  font-weight: 500;
  white-space: nowrap;
}

/* زر عرض الكل */
.show-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  margin-top: 10px;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.show-all-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.show-all-btn:active {
  transform: translateY(0);
}

.show-all-btn.expanded {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

.show-all-btn.expanded:hover {
  background: linear-gradient(135deg, #4b5563, #374151);
}

.show-btn-text {
  flex: 1;
}

.show-btn-icon {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.show-all-btn.expanded .show-btn-icon {
  transform: rotate(180deg);
}

.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.order-date {
  font-size: 13px;
  color: var(--text-light);
}

.remove-btn {
  padding: 8px 16px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.remove-btn:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.no-orders {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-light);
}

.no-orders-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.no-orders-text {
  font-size: 18px;
  font-weight: 600;
}

.loading-spinner {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Custom scrollbar for items list */
.order-items-list::-webkit-scrollbar {
  width: 6px;
}

.order-items-list::-webkit-scrollbar-track {
  background: var(--background);
  border-radius: 3px;
}

.order-items-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.order-items-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
  .recent-orders-section {
    padding: 40px 16px;
  }

  .recent-orders-title {
    font-size: 24px;
  }

  .recent-orders-grid {
    grid-template-columns: 1fr;
  }

  .order-card {
    padding: 16px;
  }

  .timer-value {
    font-size: 20px;
    min-width: 100px;
  }

  .orders-link {
    width: 100%;
    justify-content: center;
  }
  
  .show-all-btn {
    padding: 12px 16px;
    font-size: 13px;
  }
  
  .order-item {
    padding: 10px 12px;
    font-size: 13px;
  }
}