:root {
  --bg-dark: #0a0e17;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-card-hover: rgba(26, 34, 52, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 242, 254, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #9d4edd;
  --accent-green: #10b981;
  --accent-gold: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(79, 172, 254, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(157, 78, 221, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: 80px;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(0, 242, 254, 0.3);
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(90deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.user-avatar {
  font-size: 14px;
}

/* Views Management */
.view {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Banner */
.banner {
  padding: 18px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  border-color: rgba(79, 172, 254, 0.2);
}

.banner::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.25) 0%, transparent 70%);
}

.banner-badge {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}

.banner-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 6px;
}

.banner-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.live-dot {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pulse {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Products Grid */
.products-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  cursor: pointer;
}

.product-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.product-card:active {
  transform: scale(0.98);
}

.product-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.product-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.product-badge.hit {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.product-info-wrap {
  display: flex;
  gap: 14px;
}

.product-icon-box {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.product-details h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

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

.product-stock {
  font-size: 11px;
  color: var(--accent-green);
  font-weight: 600;
}

.product-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.product-price-box {
  display: flex;
  flex-direction: column;
}

.price-main {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.price-crypto {
  font-size: 11px;
  color: var(--text-muted);
}

.buy-action-btn {
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  border-radius: 12px;
  color: #0b0f19;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 242, 254, 0.25);
  transition: transform 0.15s ease;
}

.buy-action-btn:active {
  transform: scale(0.95);
}

/* Modal Checkout */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s ease;
}

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

.modal-sheet {
  width: 100%;
  max-width: 480px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding: 22px 20px 30px;
  background: #111726;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-product-icon {
  font-size: 28px;
}

.modal-title-wrap h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-product-price {
  font-size: 14px;
  color: var(--accent-cyan);
  font-weight: 700;
}

.modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-selector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.qty-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.qty-btn:active {
  transform: scale(0.9);
}

.qty-value {
  font-size: 15px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.qty-total {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.payment-methods-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.pay-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  cursor: pointer;
  border-radius: var(--radius-md);
  position: relative;
  background: rgba(255, 255, 255, 0.03);
}

.pay-option input[type="radio"] {
  display: none;
}

.pay-option.selected {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--accent-cyan);
}

.pay-option-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pay-option-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.badge-mini {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pay-option-desc {
  font-size: 11px;
  color: var(--text-muted);
  padding-left: 26px;
}

.check-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pay-option.selected .check-radio {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.pay-option.selected .check-radio::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #0b0f19;
  border-radius: 50%;
}

/* Primary Button */
.primary-btn {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  color: #0b0f19;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.35);
  transition: all 0.2s ease;
}

.primary-btn:active {
  transform: scale(0.97);
}

.pulse-glow {
  animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
  0% { box-shadow: 0 4px 20px rgba(0, 242, 254, 0.3); }
  50% { box-shadow: 0 4px 28px rgba(0, 242, 254, 0.6); }
  100% { box-shadow: 0 4px 20px rgba(0, 242, 254, 0.3); }
}

.secondary-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:active {
  transform: scale(0.97);
}

/* Payment Screen Details */
.payment-card {
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pay-card-header {
  text-align: center;
}

.pay-card-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.pay-order-pill {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 12px;
  color: var(--accent-cyan);
  font-weight: 700;
}

.crypto-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: block;
}

.copy-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.copy-value {
  font-family: monospace;
  font-size: 13px;
  color: #fff;
  word-break: break-all;
  max-width: 80%;
}

.copy-icon-btn {
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.copy-icon-btn:active {
  transform: scale(0.92);
}

.tolerance-notice {
  padding: 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  font-size: 12px;
  color: #a7f3d0;
  line-height: 1.4;
}

.radar-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.radar-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 242, 254, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Success Fulfillment */
.success-card {
  padding: 30px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.success-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
}

.success-title {
  font-size: 20px;
  font-weight: 800;
}

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

.link-box {
  width: 100%;
  display: flex;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  gap: 8px;
}

.link-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: monospace;
  font-size: 13px;
  outline: none;
}

.copy-btn {
  padding: 8px 14px;
  background: var(--accent-cyan);
  border: none;
  border-radius: 8px;
  color: #0b0f19;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.success-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.warning-box {
  font-size: 12px;
  color: var(--accent-gold);
  line-height: 1.4;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 10px;
}

/* Purchases List */
.purchases-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.purchase-item {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.purchase-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.purchase-title {
  font-size: 15px;
  font-weight: 700;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.status-badge.fulfilled {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.purchase-link-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 12px;
  border-radius: 8px;
}

.purchase-link-text {
  font-family: monospace;
  font-size: 12px;
  color: var(--accent-cyan);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 75%;
}

.refresh-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  display: flex;
  justify-content: space-around;
  padding: 8px 12px;
  border-radius: 24px;
  z-index: 900;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 14px;
  transition: all 0.2s ease;
}

.nav-item.active {
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
}

.nav-icon {
  font-size: 18px;
}

/* Toast Messages */
.toast-container {
  position: fixed;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.25s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
