/* ============================================================
   EZ-Theme Styled Payment Page — Light Mode
   ============================================================ */

:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #e8e8e8;
  --shadow: rgba(0, 0, 0, 0.06);
  --accent: #F0B90B;
  --accent-hover: #d9a60a;
  --accent-light: rgba(240, 185, 11, 0.08);
  --accent-border: rgba(240, 185, 11, 0.25);
  --accent-rgb: 240, 185, 11;
  --success: #00B42A;
  --danger: #F53F3F;
  --warning: #FF7D00;
  --radius: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- Bootstrap .container override (source _Layout compatibility) ---- */
.container.h-100 { max-width: 100%; padding: 0; }

/* ---- Page Container ---- */
.pay-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ---- Title Card ---- */
.page-title-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px var(--shadow);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.page-title-card h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
}

.page-title-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* ---- Two-Column Layout ---- */
.content-wrapper {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* ---- Left Panel ---- */
.left-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Right Panel ---- */
.right-panel {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Shared Card Style ---- */
.ez-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px var(--shadow);
  padding: 24px;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.ez-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: rgba(var(--accent-rgb), 0.2);
}

/* ---- Section Title (with left accent bar) ---- */
.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px 0;
  padding-left: 12px;
  position: relative;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background-color: var(--accent);
  border-radius: 2px;
}

/* ---- Order Detail Rows ---- */
.detail-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-row:first-child {
  padding-top: 0;
}

.detail-label {
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.detail-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-value.accent {
  color: var(--accent);
  font-weight: 600;
}

/* ---- Notice List ---- */
.notice-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notice-item {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding: 10px 14px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 0 8px 8px 0;
  transition: border-color 0.2s ease;
}

.notice-item:hover {
  border-left-color: var(--accent);
}

.notice-item strong {
  color: var(--danger);
  font-weight: 600;
}

.notice-footer {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ---- QR & Address Card ---- */
.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  color: #b8860b;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.countdown {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  transition: color 0.3s ease;
}

.countdown .timer {
  color: var(--danger);
  font-weight: 700;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.countdown.urgent {
  color: var(--danger);
}

.countdown.urgent .timer {
  animation: ez-urgentPulse 1s ease-in-out infinite;
}

@keyframes ez-urgentPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.08); }
}

.qr-wrapper {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 2px 8px var(--shadow);
  margin-bottom: 16px;
}

.qr-wrapper img {
  display: block;
  border-radius: 4px;
  width: 180px;
  height: 180px;
  margin: 0;
}

.address-field {
  display: flex;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.address-field input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 10px 12px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  color: var(--text);
  background: #fafafa;
  outline: none;
}

.address-field .copy-btn {
  flex-shrink: 0;
  border: none;
  background: var(--accent);
  color: #000;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.address-field .copy-btn:hover {
  background: var(--accent-hover);
}

.brand-footer {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ---- Copy Button (inline) ---- */
.btn-copy {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--accent-border);
  background: var(--accent-light);
  color: #b8860b;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  outline: none;
  min-width: 52px;
  justify-content: center;
}

.btn-copy:hover {
  background: var(--accent);
  color: #000;
  transform: translateY(-1px);
}

.btn-copy:focus { outline: none; box-shadow: none; }

.btn-copy.copied, .copy-btn.copied {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
  pointer-events: none;
}

.address-field .copy-btn.copied {
  background: var(--success);
  color: #fff;
}

/* ---- Bootstrap overrides ---- */
.custom-btn-outline {
  border: 1px solid var(--accent-border);
  background: var(--accent-light);
  color: #b8860b;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  outline: none;
}

.custom-btn-outline:hover {
  background: var(--accent);
  color: #000;
  transform: translateY(-1px);
}

.custom-btn-outline:focus { outline: none !important; box-shadow: none !important; }

.text-warning { color: #b8860b !important; }
.fw-bold { font-weight: 600 !important; }

/* ---- Order Not Found ---- */
.order-not-found {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.order-not-found h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ============================================================
   Payment Status Modal
   ============================================================ */
.payment-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  padding: 24px 16px;
  overflow-y: auto;
  transition: opacity 0.3s ease;
}

.payment-modal-overlay.show {
  display: flex;
  opacity: 1;
}

.payment-modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  transform: scale(0.95);
  transition: transform 0.3s ease;
  margin: auto;
  flex-shrink: 0;
}

.payment-modal-overlay.show .payment-modal {
  transform: scale(1);
}

.modal-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  position: relative;
}

.searching-animation {
  width: 72px; height: 72px; position: relative;
}

.searching-animation::before {
  content: '';
  position: absolute;
  width: 56px; height: 56px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ez-spin 1s linear infinite;
  top: 8px; left: 8px;
}

.searching-animation::after {
  content: '\1F50D';
  position: absolute;
  font-size: 24px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: ez-pulse 1.5s ease-in-out infinite;
}

.confirming-animation {
  width: 72px; height: 72px; position: relative;
}

.confirming-animation::before {
  content: '';
  position: absolute;
  width: 64px; height: 64px;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: ez-spin 0.8s linear infinite;
  top: 4px; left: 4px;
}

.confirming-animation::after {
  content: '\231B';
  position: absolute;
  font-size: 28px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: ez-bounce 1s ease-in-out infinite;
}

.success-animation {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--success), #69F0AE);
  border-radius: 50%;
  position: relative;
  animation: ez-successPop 0.5s ease-out;
}

.success-animation::after {
  content: '\2713';
  position: absolute;
  font-size: 36px;
  color: white;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: ez-checkmark 0.3s ease-out 0.2s both;
}

@keyframes ez-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes ez-pulse {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.9); }
}

@keyframes ez-bounce {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-4px); }
}

@keyframes ez-successPop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes ez-checkmark {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.progress-container { margin: 20px 0; }

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.progress-bar-wrapper {
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 3px;
  transition: width 0.5s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: ez-shimmer 2s infinite;
}

@keyframes ez-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.confirmation-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

.step-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #eee;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.step-dot.active {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.4);
}

.step-dot.completed {
  background: var(--success);
}

.tx-info {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-top: 16px;
  text-align: left;
}

.tx-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.tx-info-row:last-child { border-bottom: none; }

.tx-info-label { color: var(--text-muted); font-size: 13px; }

.tx-info-value {
  color: var(--text);
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
}

.tx-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.tx-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.estimated-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  padding: 6px 14px;
  border-radius: 20px;
  margin-top: 12px;
  font-size: 13px;
  color: #b8860b;
}

.estimated-time svg { width: 14px; height: 14px; }

/* ============================================================
   Order Expired Page
   ============================================================ */
.expired-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.expired-message {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px var(--shadow);
  max-width: 480px;
  text-align: center;
}

.expired-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 28px;
  line-height: 1.6;
}

.expired-btn,
.expired-container .custom-btn-outline {
  display: inline-block;
  background: var(--accent);
  border: none;
  color: #000;
  text-decoration: none;
  padding: 10px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.expired-btn:hover,
.expired-container .custom-btn-outline:hover {
  background: var(--accent-hover);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

/* ============================================================
   Index / Status Page
   ============================================================ */
.index-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 20px;
}

.index-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px var(--shadow);
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.index-logo {
  margin-bottom: 24px;
}

.index-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px 0;
  letter-spacing: -0.3px;
}

.index-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 28px 0;
}

.index-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 180, 42, 0.06);
  border: 1px solid rgba(0, 180, 42, 0.2);
  border-radius: 24px;
  padding: 10px 24px;
  margin-bottom: 32px;
}

.index-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(0, 180, 42, 0.5);
  animation: ez-indexPulse 2s ease-in-out infinite;
}

@keyframes ez-indexPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(0, 180, 42, 0.4); }
  50% { box-shadow: 0 0 12px rgba(0, 180, 42, 0.7); }
}

.index-status-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
}

.index-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}

.index-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--card);
  text-align: left;
}

.index-info-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.index-info-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.index-footer {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

@media (max-width: 480px) {
  .index-card {
    padding: 32px 20px;
  }
}

/* ---- In-page Status Bar ---- */
.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
  margin-bottom: 16px;
  width: 100%;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  background: #fafafa;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.status-bar .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
  transition: background-color 0.3s ease;
}

.status-bar[data-status="waiting"] .status-dot {
  background: var(--accent);
  animation: ez-statusPulse 1.5s ease-in-out infinite;
}

.status-bar[data-status="detected"] {
  background: rgba(240, 185, 11, 0.08);
  border-color: var(--accent-border);
  color: #b8860b;
}

.status-bar[data-status="detected"] .status-dot {
  background: var(--accent);
}

.status-bar[data-status="confirming"] {
  background: rgba(22, 93, 255, 0.06);
  border-color: rgba(22, 93, 255, 0.2);
  color: #165DFF;
}

.status-bar[data-status="confirming"] .status-dot {
  background: #165DFF;
  animation: ez-statusPulse 1s ease-in-out infinite;
}

.status-bar[data-status="completed"] {
  background: rgba(0, 180, 42, 0.06);
  border-color: rgba(0, 180, 42, 0.2);
  color: var(--success);
}

.status-bar[data-status="completed"] .status-dot {
  background: var(--success);
}

@keyframes ez-statusPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  50% { opacity: 0.5; box-shadow: 0 0 0 4px transparent; }
}

/* ---- QR Zoom Overlay ---- */
.qr-wrapper {
  cursor: zoom-in;
  position: relative;
}

.qr-zoom-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9998;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.qr-zoom-overlay.show {
  display: flex;
  opacity: 1;
}

.qr-zoom-content {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.25s ease;
}

.qr-zoom-overlay.show .qr-zoom-content {
  transform: scale(1);
}

.qr-zoom-content img {
  width: 280px;
  height: 280px;
  display: block;
  border-radius: 8px;
  margin-bottom: 12px;
}

.qr-zoom-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   Feature: Step Guide
   ============================================================ */
.step-guide {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px var(--shadow);
  padding: 16px 24px;
  margin-bottom: 24px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.step-item.active, .step-item.completed { opacity: 1; }

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid var(--border);
  color: var(--text-muted);
  background: var(--card);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.step-item.active .step-number {
  border-color: var(--accent);
  background: var(--accent);
  color: #000;
}

.step-item.completed .step-number {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.step-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.step-item.active .step-text { color: var(--text); }
.step-item.completed .step-text { color: var(--success); }

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 12px;
  min-width: 20px;
  position: relative;
  overflow: hidden;
}

.step-connector.done { background: var(--success); }

/* ============================================================
   Feature: Wallet Actions
   ============================================================ */
.wallet-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}

.wallet-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fafafa;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.wallet-btn:hover {
  border-color: var(--accent-border);
  background: var(--accent-light);
  transform: translateY(-1px);
  color: var(--text);
  text-decoration: none;
}

.wallet-btn svg, .wallet-btn img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.wallet-btn .wallet-name { white-space: nowrap; }

/* ============================================================
   Feature: Chain Dynamic Theme
   ============================================================ */
.chain-tron { --accent: #FF0013; --accent-hover: #cc000f; --accent-light: rgba(255,0,19,0.07); --accent-border: rgba(255,0,19,0.2); --accent-rgb: 255,0,19; }
.chain-eth { --accent: #627EEA; --accent-hover: #4e6bd8; --accent-light: rgba(98,126,234,0.07); --accent-border: rgba(98,126,234,0.2); --accent-rgb: 98,126,234; }
.chain-bsc { --accent: #F0B90B; --accent-hover: #d9a60a; --accent-light: rgba(240,185,11,0.08); --accent-border: rgba(240,185,11,0.25); --accent-rgb: 240,185,11; }
.chain-polygon { --accent: #7B3FE4; --accent-hover: #6930c3; --accent-light: rgba(123,63,228,0.07); --accent-border: rgba(123,63,228,0.2); --accent-rgb: 123,63,228; }
.chain-arbitrum { --accent: #2D374B; --accent-hover: #1f2937; --accent-light: rgba(45,55,75,0.07); --accent-border: rgba(45,55,75,0.2); --accent-rgb: 45,55,75; }
.chain-optimism { --accent: #FF0420; --accent-hover: #cc0319; --accent-light: rgba(255,4,32,0.07); --accent-border: rgba(255,4,32,0.2); --accent-rgb: 255,4,32; }
.chain-base { --accent: #0052FF; --accent-hover: #0042cc; --accent-light: rgba(0,82,255,0.07); --accent-border: rgba(0,82,255,0.2); --accent-rgb: 0,82,255; }

.chain-tron .network-badge { color: #cc000f; }
.chain-eth .network-badge { color: #4e6bd8; }
.chain-polygon .network-badge { color: #6930c3; }
.chain-optimism .network-badge { color: #cc0319; }
.chain-base .network-badge { color: #0042cc; }
.chain-bsc .network-badge { color: #b8860b; }

.chain-tron .btn-copy { color: #cc000f; }
.chain-eth .btn-copy { color: #4e6bd8; }
.chain-polygon .btn-copy { color: #6930c3; }

/* ============================================================
   Feature: Language Switcher
   ============================================================ */
.page-title-card {
  position: relative;
}

.lang-switcher {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-btn:hover { background: #f0f0f0; color: var(--text); text-decoration: none; }
.lang-btn.active { background: var(--accent); color: #000; }

.lang-select {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(0,0,0,0.04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 24px 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  outline: none;
}

.lang-select:focus { border-color: var(--accent); }

/* ============================================================
   Feature: Success Summary (in modal)
   ============================================================ */
.success-summary {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 20px;
  text-align: left;
}

.success-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.success-row:last-child { border-bottom: none; }

.success-label {
  font-size: 12px;
  color: var(--text-muted);
}

.success-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
  max-width: 60%;
  word-break: break-all;
}

.success-value.mono {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 12px;
}

.success-redirect-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.success-redirect-bar .redirect-countdown {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .pay-page { padding: 12px 10px; }

  /* Title card: stack vertically, lang switcher below text */
  .page-title-card {
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .page-title-card h2 { font-size: 16px; }
  .page-title-card p { font-size: 12px; }

  /* Language: hide buttons, show dropdown */
  .lang-switcher {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
  }

  .lang-btn { display: none; }
  .lang-select { display: block; }

  /* Step guide: show text labels stacked */
  .step-guide {
    padding: 10px 12px;
    margin-bottom: 16px;
  }

  .step-item {
    flex-direction: column;
    gap: 3px;
    align-items: center;
  }

  .step-number {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .step-text {
    display: block;
    font-size: 10px;
    text-align: center;
  }

  .step-connector { min-width: 16px; margin: 0 4px; }

  /* Layout */
  .content-wrapper { flex-direction: column; gap: 16px; }

  .right-panel { width: 100%; order: -1; }

  /* Cards */
  .ez-card { padding: 16px; margin-bottom: 0; }
  .section-title { font-size: 13px; margin-bottom: 10px; }
  .detail-row { padding: 8px 0; }
  .detail-label { font-size: 12px; }
  .detail-value { font-size: 13px; }

  /* QR section */
  .qr-section { padding: 20px 16px; }
  .network-badge { font-size: 12px; padding: 4px 10px; }
  .countdown { font-size: 13px; }

  .address-field input { font-size: 11px; padding: 8px 10px; }
  .address-field .copy-btn { padding: 8px 12px; font-size: 11px; }

  /* Wallet buttons: side by side, compact */
  .wallet-actions { flex-direction: row; gap: 6px; }
  .wallet-btn { padding: 8px 10px; font-size: 11px; }
  .wallet-btn svg { width: 16px; height: 16px; }

  /* Status bar */
  .status-bar { padding: 8px 12px; font-size: 12px; margin-bottom: 12px; }

  /* Brand footer */
  .brand-footer { font-size: 10px; }

  /* Notice */
  .notice-item { padding: 8px 10px; font-size: 12px; }
  .notice-footer { font-size: 11px; }

  /* Modal */
  .payment-modal { padding: 24px 16px; max-width: 95%; }
  .modal-title { font-size: 18px; }
  .modal-subtitle { font-size: 13px; }

  .success-summary { padding: 12px; }
  .success-label { font-size: 11px; }
  .success-value { font-size: 12px; }

  /* QR zoom */
  .qr-zoom-content img { width: 240px; height: 240px; }

  /* Expired */
  .expired-message { padding: 32px 20px; max-width: 90vw; }
}

/* ============================================================
   Dark Mode (auto-detect system preference)
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171A1D;
    --card: #1e1e1e;
    --text: rgba(255, 255, 255, 0.9);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    --accent-light: rgba(240, 185, 11, 0.12);
    --accent-border: rgba(240, 185, 11, 0.3);
  }

  body { -webkit-font-smoothing: antialiased; }

  .notice-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border);
    border-left-color: var(--border);
  }

  .notice-item:hover { border-left-color: var(--accent); }

  .address-field input {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
  }

  .qr-wrapper {
    background: #fff;
    border-color: rgba(255, 255, 255, 0.15);
  }

  .tx-info { background: rgba(255, 255, 255, 0.03); }
  .progress-bar-wrapper { background: rgba(255, 255, 255, 0.08); }
  .step-dot { background: rgba(255, 255, 255, 0.1); }
  .btn-copy { color: var(--accent); }
  .btn-copy:hover { color: #000; }

  .status-bar {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border);
  }

  .status-bar[data-status="detected"] {
    background: rgba(240, 185, 11, 0.1);
  }

  .status-bar[data-status="confirming"] {
    background: rgba(22, 93, 255, 0.1);
  }

  .status-bar[data-status="completed"] {
    background: rgba(0, 180, 42, 0.1);
  }

  .qr-zoom-content { background: #2a2a2a; }

  .network-badge { color: var(--accent); }
  .detail-value.accent { color: var(--accent); }

  .expired-message { background: var(--card); }

  .index-info-grid { background: var(--border); }
  .index-info-item { background: var(--card); }

  .index-status {
    background: rgba(0, 180, 42, 0.1);
    border-color: rgba(0, 180, 42, 0.25);
  }

  .wallet-btn { background: rgba(255,255,255,0.05); border-color: var(--border); }
  .wallet-btn:hover { background: var(--accent-light); }

  .lang-switcher { background: rgba(255,255,255,0.06); }
  .lang-btn:hover { background: rgba(255,255,255,0.08); }
  .lang-select {
    background-color: rgba(255,255,255,0.06);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    color: rgba(255,255,255,0.9);
    border-color: rgba(255,255,255,0.1);
  }

  .success-summary { background: rgba(255,255,255,0.03); }

  .step-guide { background: var(--card); border-color: var(--border); }
}
