/* 
 * Pay Quick Interactive Demo Styles
 * Split layout: phone left, step sidebar right
 */

/* ============================================================
   Container & Split Layout
   ============================================================ */
.demo-container {
  margin: 3rem auto 0;
}

.demo-split {
  display: flex;
  align-items: center;
  gap: 56px;
  max-width: 800px;
  margin: 0 auto;
}

.demo-phone-wrapper {
  flex: 0 0 250px;
}

/* ============================================================
   Phone Frame
   ============================================================ */
.demo-phone {
  background: #0f0f1a;
  border-radius: 40px;
  padding: 14px;
  box-shadow:
    0 30px 60px -12px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.demo-phone-notch {
  width: 72px;
  height: 22px;
  background: #0f0f1a;
  border-radius: 0 0 14px 14px;
  margin: 0 auto -11px;
  position: relative;
  z-index: 10;
}

/* Purple glass screen */
.demo-phone-screen {
  background: linear-gradient(160deg, rgba(102, 126, 234, 0.28) 0%, rgba(118, 75, 162, 0.32) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  min-height: 440px;
  overflow: hidden;
  position: relative;
}

/* ============================================================
   Step Transitions
   ============================================================ */
.demo-step {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  padding: 1.25rem 1rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.demo-step.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.demo-step.exit-left {
  transform: translateX(-20px);
}

/* ============================================================
   Buttons inside phone
   ============================================================ */
.demo-btn {
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  border-radius: 12px;
  font-size: 0.82rem;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.demo-btn-primary {
  background: white;
  color: #667eea;
  border: none;
}

.demo-btn-primary:hover:not(:disabled) {
  background: #f0f0ff;
  color: #5a6fd6;
  transform: translateY(-1px);
}

.demo-btn-primary:disabled,
.demo-btn-primary[disabled] {
  background: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
  pointer-events: none;
}

.demo-btn-outline {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.demo-btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

/* ============================================================
   Step 1: QR Scan
   ============================================================ */
.demo-step-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.demo-qr-icon {
  color: rgba(255, 255, 255, 0.9);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.75; }
}

.demo-text-muted {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
}

/* ============================================================
   Step 2: Menu
   ============================================================ */
.demo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.demo-header-title {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  font-weight: 600;
}

.demo-table-badge {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  padding: 0.18rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.demo-venue-name {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
}

.demo-menu-items {
  flex: 1;
  overflow-y: auto;
}

.demo-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.7rem;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin-bottom: 0.4rem;
  transition: all 0.2s ease;
}

.demo-menu-item:hover {
  background: rgba(255, 255, 255, 0.16);
}

.demo-menu-item.added {
  animation: itemAdded 0.3s ease;
}

@keyframes itemAdded {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); background: rgba(255, 255, 255, 0.22); }
  100% { transform: scale(1); }
}

.demo-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.demo-item-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: white;
}

.demo-item-price {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  font-weight: 500;
}

.demo-add-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: white;
  transition: all 0.2s ease;
  line-height: 1;
}

.demo-add-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  color: white;
}

.demo-add-btn.added {
  background: rgba(255, 255, 255, 0.85);
  border-color: white;
  color: #667eea;
}

/* Cart */
.demo-cart-summary {
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.demo-cart-items {
  font-size: 0.78rem;
  margin-bottom: 0.55rem;
  min-height: 1.4rem;
}

.demo-empty-cart {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.78rem;
}

.demo-cart-item {
  display: inline-block;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  margin-right: 0.2rem;
  margin-bottom: 0.2rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* ============================================================
   Step 3: Checkout
   ============================================================ */
.demo-back-btn {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
  transition: color 0.2s;
}

.demo-back-btn:hover {
  color: white;
}

.demo-checkout-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.demo-order-summary {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.6rem;
}

.demo-order-line {
  display: flex;
  justify-content: space-between;
  padding: 0.28rem 0;
  font-size: 0.82rem;
  color: white;
}

.demo-total {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.6rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
}

.demo-payment-method {
  margin-bottom: 0.6rem;
}

.demo-payment-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
}

.demo-payment-option.selected {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.demo-pay-btn {
  margin-top: auto;
}

.demo-pay-btn.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.demo-pay-btn.loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  right: 1rem;
  top: 50%;
  margin-top: -7px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Step 4: KDS
   ============================================================ */
.demo-kds-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.demo-kds-header {
  background: rgba(0, 0, 0, 0.3);
  color: white;
  padding: 0.55rem 1rem;
  margin: -1.25rem -1rem 0.75rem;
  font-weight: 600;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-kds-card {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  overflow: hidden;
  animation: slideIn 0.4s ease;
}

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

.demo-kds-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-kds-table {
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
}

.demo-kds-status {
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #fbbf24;
  color: #000;
  transition: all 0.3s ease;
}

.demo-kds-status.preparing {
  background: #22d3ee;
  color: #000;
}

.demo-kds-status.ready {
  background: #22c55e;
  color: white;
}

.demo-kds-items {
  padding: 0.55rem 0.75rem;
}

.demo-kds-item {
  padding: 0.28rem 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-kds-time {
  padding: 0.35rem 0.75rem;
  background: rgba(34, 197, 94, 0.18);
  border-top: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
  font-size: 0.75rem;
  font-weight: 600;
}

.demo-kds-message {
  text-align: center;
  margin: 0.85rem 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  font-weight: 500;
}

.demo-kds-message strong {
  color: white;
}

.demo-restart-btn {
  margin-top: auto;
}

/* ============================================================
   Sidebar Steps
   ============================================================ */
.demo-steps-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.demo-sidebar-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 12px 20px 0;
  position: relative;
  border-radius: 12px;
  transition: all 0.25s ease;
}

/* Vertical connector line */
.demo-sidebar-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 46px;
  bottom: -6px;
  width: 2px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.3s ease;
}

.demo-sidebar-step.completed::after {
  background: rgba(255, 255, 255, 0.35);
}

/* Number badge */
.demo-sidebar-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
}

.demo-sidebar-step.active .demo-sidebar-number {
  background: white;
  color: #667eea;
  border-color: white;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15);
}

.demo-sidebar-step.completed .demo-sidebar-number {
  background: rgba(255, 255, 255, 0.22);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Step text */
.demo-sidebar-content {
  flex: 1;
  padding-top: 4px;
}

.demo-sidebar-content h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  margin: 0 0 5px;
  transition: color 0.3s ease;
}

.demo-sidebar-content p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.2);
  line-height: 1.55;
  margin: 0;
  transition: color 0.3s ease;
}

.demo-sidebar-step.active .demo-sidebar-content h4 {
  color: white;
}

.demo-sidebar-step.active .demo-sidebar-content p {
  color: rgba(255, 255, 255, 0.72);
}

.demo-sidebar-step.completed .demo-sidebar-content h4 {
  color: rgba(255, 255, 255, 0.5);
}

.demo-sidebar-step.completed .demo-sidebar-content p {
  color: rgba(255, 255, 255, 0.32);
}



/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 767px) {
  .demo-split {
    flex-direction: column;
    gap: 28px;
    align-items: center;
  }

  .demo-phone-wrapper {
    flex: none;
    width: 250px;
  }

  .demo-steps-sidebar {
    width: 100%;
    max-width: 380px;
  }
}
