/* styles.css - All styles for the Barcode Scanner POC */

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* === Screen System === */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 400ms ease, transform 400ms ease;
  transform: translateY(20px);
  will-change: opacity, transform;
}

.screen--active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.screen--entering {
  opacity: 0;
  transform: translateY(20px);
}

.screen--leaving {
  opacity: 0;
  transform: translateY(-20px);
}

/* === Screen 1: Voucher === */
.voucher-screen {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 24px;
}

.voucher-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 28px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.voucher-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #667eea, #764ba2);
}

.voucher-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.voucher-title {
  font-size: 18px;
  font-weight: 400;
  color: #6e6e73;
  margin-bottom: 8px;
}

.voucher-amount {
  font-size: 56px;
  font-weight: 700;
  color: #1d1d1f;
  line-height: 1.1;
  margin-bottom: 8px;
}

.voucher-amount .currency {
  font-size: 32px;
  vertical-align: super;
  margin-right: 2px;
}

.voucher-subtitle {
  font-size: 14px;
  color: #86868b;
  margin-bottom: 32px;
}

.voucher-divider {
  border: none;
  height: 1px;
  background: #e5e5ea;
  margin: 0 -28px 28px;
}

.voucher-cta {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.voucher-cta:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.voucher-footer {
  margin-top: 20px;
  font-size: 11px;
  color: #aeaeb2;
}

/* === Screen 2: Barcode === */
.barcode-screen {
  background: #f5f5f7;
  padding: 24px;
  justify-content: flex-start;
  padding-top: 12px;
}

.barcode-card {
  background: #fff;
  border-radius: 20px;
  padding: 16px 24px 32px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  text-align: center;
  position: relative;
}

.barcode-header {
  margin-top: 20px;
}

.barcode-header-title {
  font-size: 20px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 4px;
}

.barcode-header-subtitle {
  font-size: 14px;
  color: #86868b;
}

.barcode-container {
  position: relative;
  width: 100%;
  margin: 0 auto 20px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  transition: transform 300ms ease;
}

.barcode-container--pulse {
  animation: barcode-pulse 400ms ease;
}

@keyframes barcode-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.barcode-canvas {
  display: block;
  width: 100%;
  height: auto;
}

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

.barcode-status {
  font-size: 14px;
  color: #86868b;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.barcode-status--ready {
  color: #34c759;
  font-weight: 600;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #86868b;
  animation: status-pulse 1.5s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}

.barcode-amount-reminder {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e5ea;
  font-size: 13px;
  color: #86868b;
}

.barcode-amount-reminder .amount {
  font-size: 22px;
  font-weight: 700;
  color: #1d1d1f;
  display: block;
  margin-top: 4px;
}

/* === Hidden video for camera capture === */
.camera-video {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
