/* ═══════════════════════════════════════════
   Daberma Design System v3.0
   Blue Glassmorphism Theme
   ═══════════════════════════════════════════ */

:root {
  --primary: #1A7BFF;
  --primary-dark: #0A5CE0;
  --primary-light: #4D9BFF;
  --primary-glow: rgba(26, 123, 255, 0.4);
  --accent: #3DDCFF;
  --accent-glow: rgba(61, 220, 255, 0.3);

  --bg-deep: #0F1F3D;
  --bg-base: #142849;
  --bg-surface: #1B3259;
  --bg-card: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.09);
  --bg-input: rgba(255, 255, 255, 0.07);

  --glass-fill: linear-gradient(145deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.05) 100%);
  --glass-fill-strong: linear-gradient(145deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.07) 100%);
  --glass-blur: blur(18px) saturate(160%);

  --border-subtle: rgba(255, 255, 255, 0.10);
  --border-card: rgba(255, 255, 255, 0.15);
  --border-glow: rgba(77, 155, 255, 0.5);
  --border-input: rgba(255, 255, 255, 0.18);

  --text: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.75);
  --text-muted: rgba(255, 255, 255, 0.52);
  --text-accent: var(--accent);

  --success: #2EE58A;
  --warning: #FFC233;
  --error: #FF6B6B;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 50px;

  --shadow-card: 0 10px 30px rgba(5, 14, 34, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --shadow-btn: 0 6px 18px rgba(26, 123, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  --shadow-glow: 0 0 20px var(--primary-glow), 0 0 40px rgba(26, 123, 255, 0.12);
}

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

html { background: var(--bg-deep); }

body {
  font-family: 'Vazirmatn', sans-serif;
  background:
    radial-gradient(1100px 650px at 100% -10%, rgba(38, 104, 220, 0.55) 0%, transparent 60%),
    radial-gradient(900px 600px at -15% 105%, rgba(30, 110, 210, 0.38) 0%, transparent 60%),
    linear-gradient(180deg, #16305A 0%, var(--bg-deep) 55%, #0D1B35 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 20%, rgba(77, 155, 255, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 85% 75%, rgba(61, 220, 255, 0.10) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ── Icons (Lucide sprite) ── */
.ic {
  width: 1.15em; height: 1.15em;
  display: inline-block; flex-shrink: 0;
  vertical-align: -0.2em;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-lg { width: 26px; height: 26px; }
.ic-xl { width: 40px; height: 40px; }
.icon-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--glass-fill-strong);
  border: 1px solid var(--border-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: var(--accent);
}
.icon-chip .ic { width: 22px; height: 22px; }

/* ── Brand & avatars: the logo is always a rounded square (shows full artwork), avatars are always circles ── */
.brand-mark {
  display: block; object-fit: cover; flex-shrink: 0;
  border-radius: 24%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 18px rgba(26, 123, 255, 0.35);
}
.avatar-circle { border-radius: 50%; }

/* ── Glass surface (shared) ── */
.glass {
  background: var(--glass-fill);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
}

/* ── Top Bar ── */
.top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(20, 40, 75, 0.55);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 6px 20px rgba(5, 14, 34, 0.18);
  position: sticky;
  top: 0;
  z-index: 10;
}
.back-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--glass-fill-strong);
  border: 1px solid var(--border-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--text);
  text-decoration: none; flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.back-btn:hover { background: rgba(77, 155, 255, 0.2); border-color: var(--border-glow); }
.back-btn .ic { width: 20px; height: 20px; }
.top-bar-title {
  flex: 1;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.top-bar-title .ic { color: var(--accent); }
/* هدر تب‌های اصلی (بدون دکمهٔ برگشت): عنوان سمت راست، مثل اپ اندروید */
.top-bar.tab-header { justify-content: space-between; padding: 14px 16px; }
.top-bar.tab-header .top-bar-title { justify-content: flex-start; flex: 1; font-size: 18px; }

/* ── Coin Box ── */
.coin-box {
  display: flex; align-items: center; gap: 6px;
  background: rgba(61, 220, 255, 0.12);
  border: 1px solid rgba(61, 220, 255, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  flex-shrink: 0;
  color: var(--accent);
}
.coin-box .ic { width: 16px; height: 16px; }
.coin-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* ── Card/Surface ── */
.card {
  background: var(--glass-fill);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

/* ── Buttons ── */
.btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 800;
  font-family: 'Vazirmatn', sans-serif;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  box-shadow: var(--shadow-btn);
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  pointer-events: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-secondary {
  background: var(--glass-fill-strong);
  border: 1px solid var(--border-card);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ── Form ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 16px;
  font-family: 'Vazirmatn', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-light);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(77, 155, 255, 0.22);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }
.form-group select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233DDCFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center; background-size: 18px;
  padding-left: 42px;
}
.form-group select option { background: var(--bg-surface); color: var(--text); }

/* ── Notice Box ── */
.notice-box {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; gap: 12px; align-items: center;
}
.notice-box.info {
  background: rgba(77, 155, 255, 0.14);
  border: 1px solid rgba(77, 155, 255, 0.35);
}
.notice-box.warn {
  background: rgba(255, 194, 51, 0.12);
  border: 1px solid rgba(255, 194, 51, 0.35);
}
.notice-box.danger {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
}
.notice-icon { font-size: 18px; flex-shrink: 0; display: flex; }
.notice-icon .ic { width: 22px; height: 22px; }
.notice-box.info .notice-icon { color: var(--accent); }
.notice-box.warn .notice-icon { color: var(--warning); }
.notice-box.danger .notice-icon { color: var(--error); }
.notice-text { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.inline-note {
  margin-top: 7px; font-size: 11.5px; color: var(--text-secondary); line-height: 1.7;
  background: rgba(255, 194, 51, 0.12); border: 1px solid rgba(255, 194, 51, 0.35);
  border-radius: 8px; padding: 8px 10px;
  display: flex; gap: 6px; align-items: flex-start;
}
.inline-note .ic { color: var(--warning); width: 16px; height: 16px; margin-top: 3px; }
.success-box .ic { width: 18px; height: 18px; }
.notice-text b { color: var(--accent); }

/* ── Errors & Messages ── */
.error { color: var(--error); font-size: 13px; margin-top: 10px; text-align: center; min-height: 20px; }
.success-box {
  background: rgba(0, 230, 118, 0.08);
  border: 1px solid rgba(0, 230, 118, 0.25);
  border-radius: var(--radius-md);
  padding: 16px; text-align: center;
  color: var(--success); font-weight: 700; font-size: 15px;
}

/* ── Content wrapper ── */
.content {
  position: relative; z-index: 1;
  padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
  padding-bottom: 32px;
}

/* ── Balance Box ── */
.balance-box {
  background: linear-gradient(145deg, rgba(77, 155, 255, 0.2), rgba(61, 220, 255, 0.08));
  border: 1px solid rgba(77, 155, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 16px; text-align: center;
  margin-bottom: 16px;
}
.balance-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.balance-val { font-size: 26px; font-weight: 900; color: var(--accent); }

/* ── History items ── */
.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.history-item:last-child { border-bottom: none; }

/* ── Tabs ── */
.tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
}
.tab {
  flex: 1; padding: 10px; text-align: center;
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 15px; font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s;
  -webkit-user-select: none; user-select: none;
}
.tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 10px rgba(10, 110, 255, 0.3);
}

/* ── Copy Value ── */
.copy-val {
  font-weight: 900;
  color: var(--accent);
  cursor: pointer;
  background: rgba(0, 212, 255, 0.08);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 15px;
  transition: background 0.2s;
}
.copy-val:hover { background: rgba(0, 212, 255, 0.15); }

/* ── Info Row ── */
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-secondary); }

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-around; align-items: center;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(18, 36, 68, 0.72);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -8px 24px rgba(5, 14, 34, 0.25);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; padding: 6px 0; flex: 1;
  color: var(--text-muted);
}
.nav-icon {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 30px; border-radius: 15px;
  transition: background 0.2s, color 0.2s;
}
.nav-icon .ic { width: 22px; height: 22px; }
.nav-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.nav-item.active { color: var(--accent); }
.nav-item.active .nav-icon { background: rgba(61, 220, 255, 0.16); }
.nav-item.active .nav-label { color: var(--accent); }
@media (min-width: 600px) {
  .nav-icon .ic { width: 24px; height: 24px; }
  .nav-label { font-size: 13px; }
}

/* ── Animated BG ── */
.bg-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg-orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.38;
  animation: orbMove 16s ease-in-out infinite alternate;
}
.bg-orb-1 { width: 360px; height: 360px; background: #2F7BFF; top: -100px; right: -80px; }
.bg-orb-2 { width: 300px; height: 300px; background: #22C8F0; bottom: 10%; left: -100px; animation-delay: -6s; }
@keyframes orbMove {
  0% { transform: translate(0,0); }
  100% { transform: translate(40px, -30px); }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(10, 110, 255, 0.3); border-radius: 4px; }

/* ── Floating number bubbles (assets/bubbles.js) ── */
body { isolation: isolate; }
.num-bubbles { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.num-bubble {
  position: absolute; top: 0; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-family: 'Vazirmatn', sans-serif;
  color: rgba(255, 255, 255, 0.18);
  animation: numBubbleFloat linear infinite;
  will-change: transform;
}
@keyframes numBubbleFloat {
  0% { transform: translateY(110vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-20vh) rotate(360deg); opacity: 0; }
}
