/* UHP Bayanihan E-Wallet Store Styles */
:root {
  --primary-color: #0d6efd;
  --primary-hover: #0b5ed7;
  --secondary-color: #198754;
  --secondary-hover: #157347;
  --dark-color: #1a202c;
  --bg-color: #0b2246;
  --card-bg: #ffffff;
  --text-main: #2d3748;
  --text-muted: #718096;
  --border-color: #e2e8f0;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: radial-gradient(circle at 50% 20%, #15386d 0%, #081730 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px 8px 30px;
}

.app-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header {
  text-align: center;
  padding: 12px 10px 16px;
  width: 100%;
}

.portal-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.portal-subtitle {
  font-size: 13px;
  color: #94b8e8;
  margin-top: 4px;
}

/* Responsive Image Card with Clickable Transparent Hotspots */
.price-card-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.price-card {
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  background: #0d2850;
  user-select: none;
  cursor: pointer;
}

.ui-picture {
  display: block;
  width: 100%;
  pointer-events: none; /* Clicks pass strictly through to buttons and card */
}

.ui-image {
  width: 100%;
  height: auto;
  aspect-ratio: 1024 / 1536;
  display: block;
  pointer-events: none; /* Clicks pass strictly through image */
}

/* Authoritative Hotspots measured exactly on 1024x1536 canvas */
.hotspot {
  position: absolute;
  left: 4.00%;
  width: 51.56%;
  border-radius: 9999px;
  background: transparent;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  margin: 0;
  outline: none;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  z-index: 10;
}

.hotspot:hover,
.hotspot:focus-visible {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.35);
  transform: scale(1.015);
}

.hotspot:active {
  transform: scale(0.985);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

/* Card 1: 5 Hours (₱5) */
.price-5 {
  top: 31.25%;
  height: 8.79%;
}

/* Card 2: 12 Hours (₱10) */
.price-10 {
  top: 41.21%;
  height: 8.72%;
}

/* Card 3: 1 Day (₱15) */
.price-15 {
  top: 51.24%;
  height: 8.79%;
}

/* Card 4: 30 Days (₱300) */
.price-300 {
  top: 61.07%;
  height: 8.79%;
}

/* Actions */
.actions-section {
  width: 100%;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  text-decoration: none;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #0d6efd, #0b5ed7);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0b5ed7, #0a58ca);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #198754, #157347);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #157347, #146c43);
  transform: translateY(-1px);
}

.btn-muted {
  background: #edf2f7;
  color: #4a5568;
}

.btn-muted:hover {
  background: #e2e8f0;
}

.footer {
  margin-top: 24px;
  text-align: center;
  font-size: 11px;
  color: #6486b8;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 12, 28, 0.75);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.show {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.modal-content {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.show .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark-color);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--dark-color);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Product Banner */
.selected-product-banner {
  background: linear-gradient(135deg, #0d6efd 0%, #004dc7 100%);
  border-radius: 14px;
  padding: 16px;
  color: #ffffff;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 6px 16px rgba(13, 110, 253, 0.25);
}

.product-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.product-price {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  font-family: 'Montserrat', sans-serif;
}

.product-name {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 4px;
}

/* Form */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 4px;
}

.form-help {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

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

.form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.text-center {
  text-align: center;
}

.form-error {
  color: #dc3545;
  font-size: 12px;
  margin-top: 6px;
}

.order-notice {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border-left: 3px solid var(--primary-color);
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-muted);
  border-radius: 0 6px 6px 0;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.modal-actions .btn {
  flex: 1;
}

/* Order Result */
.order-result {
  text-align: center;
  padding: 10px 0;
}

.order-success-icon {
  width: 52px;
  height: 52px;
  background: #e6f7ec;
  color: #198754;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  margin: 0 auto 12px;
}

.result-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark-color);
}

.result-ref {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Order Summary Card */
.order-summary-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.summary-label {
  color: var(--text-muted);
}

.summary-value {
  color: var(--dark-color);
  font-weight: 600;
}

.amount-highlight {
  color: #198754;
  font-size: 16px;
  font-weight: 800;
}

.ref-highlight {
  color: #0d6efd;
  font-family: monospace;
  font-size: 13px;
}

/* QR Code Display Container */
.qr-display-container {
  background: #f0f7ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 16px;
  padding: 14px;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-badge-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #0b5ed7;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.qr-image-frame {
  width: 100%;
  max-width: 250px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  background: #ffffff;
  margin-bottom: 12px;
}

.gcash-qr-image {
  width: 100%;
  height: auto;
  display: block;
}

.btn-download-qr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.4px;
  padding: 12px 16px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
  transition: all 0.2s ease;
}

.btn-download-qr:hover {
  background: linear-gradient(135deg, #0b5ed7 0%, #094eb8 100%);
  box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
  transform: translateY(-1px);
}

/* Customer Step-by-Step Instructions */
.qr-instructions-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  margin: 12px 0;
}

.instructions-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 8px;
}

.instructions-steps {
  padding-left: 20px;
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.6;
}

.instructions-steps li {
  margin-bottom: 4px;
}

.order-paid-action {
  margin-top: 14px;
}

/* WAITING FOR GCASH CONFIRMATION */
.waiting-card {
  background: #ffffff;
  border: 2px dashed #f59e0b;
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  margin: 10px 0;
}

.waiting-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #fef3c7;
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

.waiting-title {
  font-size: 16px;
  font-weight: 800;
  color: #b45309;
  letter-spacing: -0.2px;
  margin-bottom: 8px;
}

.waiting-status-pill {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 14px;
  border: 1px solid #fde68a;
}

.waiting-details {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-around;
}

.waiting-notice {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.waiting-alert {
  display: flex;
  align-items: center;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  margin-bottom: 16px;
  text-align: left;
}

/* Transactions Table */
.transactions-table-wrapper {
  margin-top: 16px;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-muted);
  position: sticky;
  top: 0;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.badge-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-verified {
  background: #d1fae5;
  color: #065f46;
}

.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(13, 110, 253, 0.2);
  border-radius: 50%;
  border-top-color: #0d6efd;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive screen widths: desktop, 480px, 390px, 360px */
@media (max-width: 480px) {
  body {
    padding: 8px 6px 20px;
  }
  .portal-title {
    font-size: 20px;
  }
  .portal-subtitle {
    font-size: 12px;
  }
}

@media (max-width: 390px) {
  .portal-title {
    font-size: 18px;
  }
  .portal-subtitle {
    font-size: 11px;
  }
  .product-price {
    font-size: 28px;
  }
  .modal-content {
    border-radius: 16px;
  }
}

@media (max-width: 360px) {
  body {
    padding: 6px 4px 16px;
  }
  .portal-title {
    font-size: 17px;
  }
  .btn {
    font-size: 13px;
    padding: 10px 14px;
  }
}
