/* ==================== ORDERS PAGE ==================== */
.render {
  padding: 16px 24px;
  padding-bottom: 180px;
  max-width: 900px;
  margin: 0 auto;
}

/* ==================== GLOBAL WARNING ==================== */
.global-warning {
  background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
  color: #856404;
  padding: 16px 20px;
  border: 2px solid #ffeeba;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

.global-warning::before {
  content: "⚠️";
  font-size: 24px;
  flex-shrink: 0;
}

/* ==================== ORDER LIST ==================== */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==================== ORDER CARD ==================== */
.order-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.4s ease forwards;
  position: relative;
  overflow: hidden;
}

.order-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  border-radius: 4px 0 0 4px;
}

.order-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.order-card:active {
  transform: translateY(0);
}

/* Order Card Header */
.order-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.order-card strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Order ID Styling */
.order-card > div:first-child {
  font-size: 14px;
  color: var(--text-secondary);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Order Total */
.order-card > div:nth-child(2) {
  font-size: 20px;
  color: var(--accent);
  font-weight: 700;
}

/* ==================== DELIVERY STATUS ==================== */
.delivery-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
}

.delivery-status strong {
  color: var(--text-primary);
}

/* Status Colors */
.delivery-status.pending {
  background: #fff3cd;
  color: #856404;
}

.delivery-status.shipped {
  background: #cce5ff;
  color: #004085;
}

.delivery-status.delivered {
  background: #d4edda;
  color: #155724;
}

.delivery-status.canceled {
  background: #f8d7da;
  color: #721c24;
}

/* ==================== COUNTDOWN TIMER ==================== */
.description[id^="countdown"] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--accent-light) 0%, rgba(108, 92, 231, 0.05) 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  letter-spacing: 1px;
}

.description[id^="countdown"]::before {
  content: "⏱️";
  font-size: 20px;
}

/* Timer States */
.description[id^="countdown"].expired {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.description[id^="countdown"].shipped {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

/* ==================== TRACK CONTROLS ==================== */
.track-controls {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-top: 12px;
}

/* Track Input */
.track-input {
  flex: 2;
  min-width: 0;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
}

.track-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
  background: var(--bg-secondary);
}

.track-input::placeholder {
  color: var(--text-muted);
  font-family: inherit;
}

/* Submit Track Button */
.submit-track-btn {
  flex: 1;
  max-width: 180px;
  padding: 14px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.submit-track-btn::before {
  content: "📤";
}

.submit-track-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.submit-track-btn:active {
  transform: translateY(0);
}

.submit-track-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

/* ==================== ORDER DETAILS PAGE ==================== */
.order-details {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.order-details.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* Back Button */
.order-details button:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 2px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 20px;
}

.order-details button:first-child:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateX(-3px);
}

/* Order Details Info */
.order-details > div:not(:first-child):not(.order-items) {
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-details > div:nth-child(2) {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
}

/* Address Section Header */
.order-details > div:nth-child(4)::before { content: "🌍"; }
.order-details > div:nth-child(5)::before { content: "🏙️"; }
.order-details > div:nth-child(6)::before { content: "📍"; }
.order-details > div:nth-child(7)::before { content: "📮"; }
.order-details > div:nth-child(8)::before { content: "📱"; }

/* ==================== ORDER ITEMS GRID ==================== */
.order-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
}

.order-items > div {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.order-items > div:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.order-items img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.order-items img:hover {
  transform: scale(1.03);
}

.order-items > div > div {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
}

.order-items > div > div:first-of-type {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Item Status Badge */
.order-items > div > div:last-child {
  background: #e3f2fd;
  color: #1976d2;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  margin-top: 8px;
  justify-content: center;
}

/* ==================== ORDER STATUS BADGE ==================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.pending {
  background: #fff3cd;
  color: #856404;
}

.status-badge.processing {
  background: #cce5ff;
  color: #004085;
}

.status-badge.shipped {
  background: #d1ecf1;
  color: #0c5460;
}

.status-badge.delivered {
  background: #d4edda;
  color: #155724;
}

.status-badge.canceled {
  background: #f8d7da;
  color: #721c24;
}

/* ==================== EMPTY ORDERS STATE ==================== */
.empty-orders {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
}

.empty-orders-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-orders-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-orders-desc {
  font-size: 14px;
  color: var(--text-muted);
}

/* ==================== NEW ORDER INDICATOR ==================== */
.order-card.new-order::after {
  content: "NEW";
  position: absolute;
  top: 12px;
  right: 12px;
  background: #e74c3c;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ==================== RESPONSIVE - DESKTOP ==================== */
@media (min-width: 1024px) {
  .render {
    padding: 32px;
    padding-bottom: 100px;
    max-width: 1000px;
  }

  .global-warning {
    padding: 20px 24px;
    font-size: 15px;
  }

  .order-card {
    padding: 24px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .order-card::before {
    width: 5px;
  }

  .order-card > div:first-child {
    flex: 0 0 auto;
    padding-bottom: 0;
    border-bottom: none;
    padding-right: 20px;
    border-right: 1px solid var(--border);
  }

  .order-card > div:nth-child(2) {
    flex: 0 0 150px;
    padding: 0 20px;
  }

  .delivery-status {
    flex: 1;
  }

  .description[id^="countdown"] {
    flex: 0 0 180px;
  }

  .track-controls {
    flex: 0 0 100%;
    border-top: 1px solid var(--border);
    margin-top: 16px;
    padding-top: 16px;
  }

  .order-items {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==================== RESPONSIVE - TABLET ==================== */
@media (min-width: 768px) and (max-width: 1023px) {
  .render {
    padding: 20px;
  }

  .order-card {
    padding: 20px;
  }

  .order-items {
    grid-template-columns: repeat(2, 1fr);
  }

  .track-controls {
    flex-wrap: wrap;
  }

  .track-input {
    flex: 1 1 60%;
  }

  .submit-track-btn {
    flex: 1 1 35%;
  }
}

/* ==================== RESPONSIVE - MOBILE ==================== */
@media (max-width: 767px) {
  .render {
    padding: 12px;
    padding-bottom: 180px;
  }

  .global-warning {
    padding: 14px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    flex-direction: column;
    text-align: center;
  }

  .global-warning::before {
    font-size: 28px;
  }

  .order-card {
    padding: 16px;
    gap: 10px;
    border-radius: var(--radius-md);
  }

  .order-card::before {
    width: 3px;
  }

  .order-card > div:first-child {
    font-size: 13px;
    padding-bottom: 10px;
  }

  .order-card > div:nth-child(2) {
    font-size: 18px;
  }

  .delivery-status {
    padding: 8px 12px;
    font-size: 13px;
    flex-wrap: wrap;
  }

  .description[id^="countdown"] {
    padding: 12px 16px;
    font-size: 16px;
  }

  .description[id^="countdown"]::before {
    font-size: 18px;
  }

  .track-controls {
    flex-direction: column;
    gap: 8px;
  }

  .track-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
  }

  .submit-track-btn {
    width: 100%;
    padding: 12px 16px;
    justify-content: center;
  }

  /* Order Details Mobile */
  .order-details {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  .order-details button:first-child {
    padding: 8px 16px;
    font-size: 13px;
    margin-bottom: 16px;
  }

  .order-details > div:not(:first-child):not(.order-items) {
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 8px;
  }

  .order-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
  }

  .order-items > div {
    padding: 12px;
  }

  .order-items img {
    margin-bottom: 10px;
  }

  .order-items > div > div {
    font-size: 12px;
  }

  .order-items > div > div:first-of-type {
    font-size: 13px;
  }
}

/* ==================== RESPONSIVE - VERY SMALL ==================== */
@media (max-width: 400px) {
  .global-warning {
    padding: 12px;
    font-size: 12px;
  }

  .order-card {
    padding: 14px;
  }

  .order-card > div:nth-child(2) {
    font-size: 16px;
  }

  .description[id^="countdown"] {
    font-size: 14px;
    padding: 10px 12px;
  }

  .order-items {
    grid-template-columns: 1fr;
  }

  .order-items > div {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
    align-items: start;
  }

  .order-items img {
    grid-row: span 5;
    margin-bottom: 0;
  }

  .order-items > div > div:first-of-type {
    grid-column: 2;
  }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.order-card:nth-child(1) { animation-delay: 0.05s; }
.order-card:nth-child(2) { animation-delay: 0.1s; }
.order-card:nth-child(3) { animation-delay: 0.15s; }
.order-card:nth-child(4) { animation-delay: 0.2s; }
.order-card:nth-child(5) { animation-delay: 0.25s; }

/* Timer Animation */
@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.description[id^="countdown"]:not(.expired):not(.shipped) {
  animation: timerPulse 2s ease-in-out infinite;
}

/* ==================== LOADING SKELETON ==================== */
.order-skeleton {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
}

.skeleton-line {
  height: 20px;
  background: linear-gradient(90deg, var(--bg-primary) 25%, var(--bg-hover) 50%, var(--bg-primary) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.5s infinite;
  margin-bottom: 12px;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 60%; }
.skeleton-line.long { width: 80%; }

.skeleton-timer {
  height: 50px;
  border-radius: var(--radius-md);
  margin: 12px 0;
}

.skeleton-controls {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.skeleton-input {
  flex: 1;
  height: 44px;
  border-radius: var(--radius-sm);
}

.skeleton-btn {
  width: 120px;
  height: 44px;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ==================== TOAST FOR TRACK SUBMIT ==================== */
.track-toast {
  position: fixed;
  bottom: 200px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s ease;
}

.track-toast.success {
  background: #27ae60;
  color: white;
}

.track-toast.error {
  background: #e74c3c;
  color: white;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}