/* ═══════════════════════════════════════════
   PANDA WAVE — Premium Dark Mini App
   ═══════════════════════════════════════════ */

:root {
  --bg-0: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #141414;
  --bg-3: #1e1e1e;
  --bg-4: #282828;
  --accent: #00d26a;
  --accent-dim: rgba(0, 210, 106, 0.12);
  --accent-glow: rgba(0, 210, 106, 0.25);
  --text-1: #ffffff;
  --text-2: #a0a0a0;
  --text-3: #606060;
  --danger: #ff4757;
  --warning: #ffa502;
  --radius: 16px;
  --radius-sm: 10px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 72px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-0);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* ─── Screens ─── */
.screen {
  display: none;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  animation: fadeIn 0.3s ease;
}
.screen.active { display: block; }

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-1);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.screen-header h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.screen-content {
  padding: 16px 16px 0;
}

.back-btn {
  background: var(--bg-3);
  border: none;
  color: var(--text-1);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.back-btn:active { transform: scale(0.92); background: var(--bg-4); }

/* ─── Loading Screen ─── */
#loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg-0);
}
.loading-logo { text-align: center; }
.logo-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: pulse 2s ease infinite;
}
.logo-text {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--accent), #00ff88);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.loading-bar {
  width: 120px;
  height: 3px;
  background: var(--bg-3);
  border-radius: 2px;
  margin: 20px auto 0;
  overflow: hidden;
}
.loading-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  animation: loadProgress 1.5s ease forwards;
}
@keyframes loadProgress {
  0% { width: 0%; }
  50% { width: 60%; }
  100% { width: 100%; }
}

/* ─── Balance Card ─── */
.balance-card {
  background: linear-gradient(135deg, #0d1f14 0%, #0a1a10 50%, #081208 100%);
  border: 1px solid rgba(0, 210, 106, 0.15);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  animation: slideUp 0.4s ease;
}
.balance-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.balance-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.balance-amount {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.balance-currency {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}
.balance-actions {
  display: flex;
  gap: 10px;
}
.btn-balance {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-1);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-balance:active {
  transform: scale(0.96);
  background: rgba(255,255,255,0.1);
}

/* ─── Section ─── */
.section { margin-bottom: 20px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ─── City Grid ─── */
.city-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.city-card {
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  animation: slideUp 0.4s ease backwards;
}
.city-card:active {
  transform: scale(0.96);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.city-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.city-name {
  font-size: 15px;
  font-weight: 600;
}
.city-count {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}

/* ─── Stats Row ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
  animation: slideUp 0.5s ease backwards;
}
.stat-card {
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
}
.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  font-size: 11px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ─── List ─── */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s;
  animation: slideUp 0.3s ease backwards;
}
.list-item:active {
  transform: scale(0.98);
  border-color: var(--accent);
}
.list-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.list-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.list-item-title {
  font-size: 15px;
  font-weight: 600;
}
.list-item-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}
.list-item-right {
  text-align: right;
}
.list-item-chevron {
  color: var(--text-3);
}

/* ─── Product Grid ─── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.product-card {
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s;
  animation: slideUp 0.3s ease backwards;
}
.product-card:active {
  transform: scale(0.97);
  border-color: var(--accent);
}

/* Product Image */
.product-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-3);
  overflow: hidden;
}
.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:active .product-img {
  transform: scale(1.05);
}
.product-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  opacity: 0.5;
}
.product-img-wrap .product-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  padding: 3px 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.product-photo-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  backdrop-filter: blur(4px);
}

/* Product Info */
.product-info {
  padding: 12px;
}
.product-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
}
.product-badge.out {
  background: rgba(255, 71, 87, 0.1);
  color: var(--danger);
}
.product-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}
.product-price-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.product-desc {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Detail Gallery (Slider) ─── */
.detail-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--bg-2);
}
.gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.gallery-slide {
  min-width: 100%;
  height: 100%;
}
.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}
.gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: all 0.25s;
}
.gallery-dot.active {
  background: var(--accent);
  width: 20px;
  border-radius: 10px;
}
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: all 0.2s;
}
.gallery-arrow:active {
  transform: translateY(-50%) scale(0.9);
  background: rgba(0,0,0,0.7);
}
.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }

/* Detail Header (below gallery) */
.detail-header {
  text-align: center;
  margin-bottom: 16px;
  padding: 0 8px;
}

/* ─── Product Detail ─── */
.detail-content {
  animation: slideUp 0.4s ease;
}
.detail-hero {
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 16px;
}
.detail-emoji {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.detail-name {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}
.detail-price-big {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
}
.detail-price-unit {
  font-size: 14px;
  color: var(--text-2);
}
.detail-info {
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.detail-info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.detail-info-row:last-child { border-bottom: none; }
.detail-info-label {
  font-size: 14px;
  color: var(--text-2);
}
.detail-info-value {
  font-size: 14px;
  font-weight: 600;
}

.btn-buy {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #000;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.btn-buy:active { transform: scale(0.98); opacity: 0.9; }
.btn-buy:disabled {
  background: var(--bg-3);
  color: var(--text-3);
  cursor: not-allowed;
}

/* ─── Deposit Cards ─── */
.deposit-card {
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 12px;
  animation: slideUp 0.4s ease backwards;
}
.deposit-card:nth-child(2) { animation-delay: 0.1s; }
.deposit-icon {
  font-size: 36px;
  margin-bottom: 12px;
}
.deposit-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}
.deposit-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 16px;
}
.deposit-fee {
  font-size: 12px;
  color: var(--warning);
  font-weight: 600;
  margin-bottom: 16px;
}

.wallet-address {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
  gap: 10px;
}
.wallet-address:active { border-color: var(--accent); }
.wallet-address span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  word-break: break-all;
  flex: 1;
}

.copy-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--accent);
  color: #000;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  z-index: 999;
  transition: transform 0.3s ease;
  pointer-events: none;
}
.copy-toast.show {
  transform: translateX(-50%) translateY(0);
}

.iban-amounts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.iban-btn {
  background: var(--bg-3);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-1);
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.iban-btn:active {
  transform: scale(0.96);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.iban-custom {
  display: flex;
  gap: 8px;
}
.iban-custom input {
  flex: 1;
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-1);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.iban-custom input:focus { border-color: var(--accent); }
.iban-custom input::placeholder { color: var(--text-3); }

.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary:active { transform: scale(0.96); opacity: 0.9; }

/* ─── Orders List ─── */
.order-card {
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 8px;
  animation: slideUp 0.3s ease backwards;
}
.order-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.order-product {
  font-size: 15px;
  font-weight: 600;
}
.order-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}
.order-status.completed {
  background: var(--accent-dim);
  color: var(--accent);
}
.order-status.pending {
  background: rgba(255, 165, 2, 0.1);
  color: var(--warning);
}
.order-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
}
.order-price {
  font-weight: 600;
  color: var(--text-1);
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  animation: fadeIn 0.4s ease;
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.empty-desc {
  font-size: 13px;
  color: var(--text-2);
}

/* ─── Bottom Nav ─── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-1);
  border-top: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: var(--safe-bottom);
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 16px;
  transition: color 0.2s;
  letter-spacing: 0.02em;
}
.nav-item.active {
  color: var(--accent);
}
.nav-item:active {
  transform: scale(0.92);
}

/* ─── Skeleton Loading ─── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 0; }
body { scrollbar-width: none; }

/* ─── Toast/Modal ─── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease;
  padding: 20px;
}
.modal-content {
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.3s ease;
}
.modal-icon { font-size: 48px; margin-bottom: 16px; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal-desc { font-size: 14px; color: var(--text-2); line-height: 1.5; margin-bottom: 20px; }
.modal-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-btn:active { transform: scale(0.98); }
.modal-btn-primary { background: var(--accent); color: #000; }
.modal-btn-secondary { background: var(--bg-3); color: var(--text-1); margin-top: 8px; }
