@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --success: #22c55e;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --bg: #f0f4f8;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

header.site-header {
  text-align: center;
  margin-bottom: 24px;
}

header.site-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

header.site-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Products */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
@media (min-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

.product-card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -2px rgba(0, 0, 0, 0.1);
}
.product-card.selected {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}

.product-image-placeholder {
  height: 150px;
  background: linear-gradient(135deg, var(--primary-light), var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 2rem;
}

.product-info {
  padding: 16px;
}

.product-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.product-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

/* Forms & Cards */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control.is-invalid {
  border-color: var(--danger) !important;
  background-color: #fff5f5;
}

.form-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  width: 100%;
}
.btn-primary:hover {
  background-color: var(--primary-dark);
}
.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  font-size: 0.875rem;
  border-radius: 6px;
}
.btn-outline:hover {
  background: var(--bg);
}
.btn-outline.copied {
  background: var(--success-light);
  color: var(--success);
  border-color: var(--success);
}

/* Order Detail specific */
.order-id-display {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge.pending_payment { background: var(--warning-light); color: var(--warning); }
.badge.payment_submitted { background: var(--info); color: white; }
.badge.checking { background: var(--warning); color: white; }
.badge.paid { background: var(--success-light); color: var(--success); }
.badge.processing { background: var(--primary-light); color: var(--primary); }
.badge.completed { background: var(--success); color: white; }
.badge.cancelled { background: var(--danger-light); color: var(--danger); }

/* Payment Section */
.qr-container {
  text-align: center;
  margin: 20px 0;
}
.qr-image {
  max-width: 280px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 8px;
  background: white;
}

.bank-info-list {
  list-style: none;
}
.bank-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.bank-info-item:last-child {
  border-bottom: none;
}
.bank-info-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}
.bank-info-value {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  background: var(--bg);
}
.upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-preview {
  margin-top: 16px;
  max-width: 100%;
  border-radius: 8px;
  display: none;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 40px;
  margin-top: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 24px;
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-item .dot {
  position: absolute;
  left: -40px;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  z-index: 1;
}
.timeline-item.completed .dot {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.timeline-item.completed::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 26px;
  bottom: -24px;
  width: 2px;
  background: var(--success);
  z-index: 0;
}
.timeline-item:last-child::before {
  display: none;
}
.timeline-item.current .dot {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  animation: pulse 2s infinite;
}
.timeline-item.cancelled .dot {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}
.timeline-content h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}
.timeline-content p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideDown 0.3s ease-out forwards;
  opacity: 0;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Loading */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.hidden {
  display: none !important;
}

/* Confetti */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background-color: #f2d74e;
  opacity: 0;
}
