/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  padding: 1rem;
  background-color: white;
  text-align: center;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== LOGO & HEADER ===== */
.logo {
  max-width: 240px;
  margin: 0.5rem auto 1rem;
  display: block;
  border-radius: 4px;
  box-shadow: none;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== QR SCANNER ===== */
#reader {
  width: 100%;
  max-width: 500px;
  margin: 1rem auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

#reader video {
  border-radius: 12px;
}

/* ===== CART DISPLAY ===== */
.cart {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 12px;
  margin: 1.5rem auto;
  text-align: left;
  max-width: 500px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border: 2px solid #e2e8f0;
}

.cart-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 1rem;
  color: #2d3748;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-item:last-child {
  border-bottom: none;
}

.total {
  font-weight: 700;
  font-size: 1.25rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #000;
  color: #1a202c;
  text-align: right;
}

/* ===== UPI QR CODE ===== */
#upi-qr {
  margin: 1.5rem auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: white;
  padding: 1rem;
}

/* ===== INPUT FIELDS ===== */
input[type="tel"] {
  width: 100%;
  max-width: 500px;
  padding: 1rem;
  margin: 1rem auto;
  font-size: 1.1rem;
  border: 2px solid #cbd5e0;
  border-radius: 8px;
  background: #ffffff;
  display: block;
  transition: all 0.3s ease;
}

input[type="tel"]:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* ===== BUTTONS ===== */
button {
  width: 100%;
  max-width: 500px;
  padding: 1rem 1.5rem;
  margin: 0.5rem auto;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  
  /* Larger touch target for mobile */
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #000000 0%, #434343 100%);
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: #ffffff;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(231, 76, 60, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, #2c7be5 0%, #1a5bb8 100%);
  color: #ffffff;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(44, 123, 229, 0.3);
}

/* ===== CONFIRMATION MESSAGE ===== */
#confirmation {
  display: none;
  margin: 1.5rem auto;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 600;
  max-width: 500px;
  animation: slideIn 0.3s ease;
}

#confirmation.success {
  background: #d4edda;
  color: #155724;
  border: 2px solid #c3e6cb;
}

#confirmation.error {
  background: #f8d7da;
  color: #721c24;
  border: 2px solid #f5c6cb;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== DEBUG/STATUS MESSAGE ===== */
#debug {
  margin: 1.5rem auto;
  font-size: 0.95rem;
  color: #4a5568;
  background: #edf2f7;
  padding: 0.75rem;
  border-radius: 8px;
  max-width: 500px;
  border-left: 4px solid #2c7be5;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 600px) {
  body {
    padding: 0.75rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .logo {
    max-width: 120px;
  }
  
  button {
    font-size: 1rem;
    padding: 0.875rem 1rem;
  }
  
  input[type="tel"] {
    font-size: 1rem;
  }
}

/* ===== PWA FULLSCREEN MODE ===== */
@media all and (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}
