/* =========================================================
   xHashVpn Mini App — Liquid Glass UI
   Colors: #00545f teal · #d6fb00 lime · #ecffb6 soft-lime
   ========================================================= */

:root {
  --lime:        #d6fb00;
  --lime-soft:   #ecffb6;
  --glass-border: rgba(214, 251, 0, 0.28);
  --text:        #ecffb6;
  --text-muted:  rgba(236, 255, 182, 0.52);
  --radius:      22px;
  --blur:        blur(22px);
  --shadow:
    0 20px 60px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.07);
  --font:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:   'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  background:
    radial-gradient(circle at 90% 0%,  rgba(214,251,0,0.16), transparent 32%),
    radial-gradient(circle at 0%  85%, rgba(214,251,0,0.12), transparent 30%),
    linear-gradient(145deg, #001b1f 0%, #002f35 45%, #001a1e 100%);
}
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 100; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.header {
  background: rgba(0, 28, 32, 0.82);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  padding: 14px 18px;
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--glass-border);
}
.header-title {
  font-family: var(--mono);
  font-size: 17px; font-weight: 800;
  color: var(--lime);
  text-shadow: 0 0 18px rgba(214,251,0,0.55);
  letter-spacing: -0.5px;
}

/* ── Pages ──────────────────────────────────────────────────────────────────── */
.page { display: none; padding: 14px 16px; }
.page.active { display: block; }

/* ── Glass card ─────────────────────────────────────────────────────────────── */
.card {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(0,84,95,0.38), rgba(0,35,40,0.30));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.card::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 55%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(236,255,182,0.65), transparent);
}
.card-title {
  font-family: var(--mono);
  font-size: 14px; font-weight: 700;
  color: var(--lime); margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.card-sub { font-size: 13px; color: var(--text-muted); }

/* ── Profile ─────────────────────────────────────────────────────────────────── */
.avatar { font-size: 46px; margin-bottom: 6px; }
.text-center { text-align: center; }

/* ── Info rows ───────────────────────────────────────────────────────────────── */
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid rgba(214,251,0,0.10);
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 13px; color: var(--text-muted); font-family: var(--mono); }
.info-value { font-size: 13px; font-weight: 600; color: var(--lime-soft); }
.info-value.accent { color: var(--lime); text-shadow: 0 0 10px rgba(214,251,0,0.4); }

/* ── Balance display ─────────────────────────────────────────────────────────── */
.balance-display {
  display: flex; align-items: baseline;
  justify-content: center; gap: 4px;
  margin: 10px 0 4px;
}
.balance-display > span:first-child {
  font-size: 44px; font-weight: 800;
  font-family: var(--mono); color: var(--lime);
  text-shadow: 0 0 28px rgba(214,251,0,0.45);
}
.balance-currency { font-size: 20px; color: var(--text-muted); }
.refresh-btn {
  background: none; border: none;
  font-size: 17px; cursor: pointer;
  padding: 0 0 0 8px; line-height: 1; opacity: .55;
  transition: opacity 0.2s;
}
.refresh-btn:disabled { opacity: .25; }

/* ── Amount buttons ──────────────────────────────────────────────────────────── */
.amounts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.amount-btn {
  background: linear-gradient(145deg, rgba(214,251,0,0.16), rgba(0,84,95,0.38));
  color: var(--lime);
  border: 1px solid var(--glass-border);
  border-radius: 16px; padding: 17px;
  font-size: 17px; font-weight: 800;
  font-family: var(--mono); cursor: pointer;
  transition: all 0.22s;
  backdrop-filter: blur(14px);
}
.amount-btn:hover {
  background: linear-gradient(145deg, rgba(214,251,0,0.28), rgba(0,84,95,0.5));
  box-shadow: 0 0 28px rgba(214,251,0,0.18); transform: translateY(-2px);
}
.amount-btn:active, .amount-btn:disabled { opacity: .5; transform: none; }

/* ── Provider selection ──────────────────────────────────────────────────────── */
.providers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 6px; }
.provider-btn {
  background: linear-gradient(145deg, rgba(0,84,95,0.45), rgba(0,35,40,0.38));
  border: 1px solid var(--glass-border); border-radius: 16px;
  padding: 18px 10px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  cursor: pointer; transition: all 0.22s; backdrop-filter: blur(14px);
}
.provider-btn:hover {
  border-color: rgba(214,251,0,0.55);
  box-shadow: 0 0 25px rgba(214,251,0,0.14); transform: translateY(-2px);
}
.provider-btn:active { opacity: .6; transform: none; }
.provider-btn.loading { opacity: .4; pointer-events: none; }
.provider-icon { font-size: 30px; }
.provider-name {
  font-size: 11px; font-weight: 700; color: var(--lime-soft);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.6px;
}

/* ── Action buttons ──────────────────────────────────────────────────────────── */
.btn-primary, .btn-secondary {
  display: block; width: 100%; padding: 14px;
  border-radius: 14px; border: none;
  font-size: 14px; font-weight: 700;
  font-family: var(--mono); cursor: pointer;
  margin-top: 10px; transition: all 0.22s; letter-spacing: -0.2px;
}
.btn-primary {
  background: var(--lime); color: #001b1f;
  box-shadow: 0 0 28px rgba(214,251,0,0.28), 0 8px 20px rgba(0,0,0,0.3);
}
.btn-primary:hover { box-shadow: 0 0 42px rgba(214,251,0,0.44); transform: translateY(-1px); }
.btn-primary:active { opacity: .8; transform: none; }
.btn-secondary {
  background: transparent; color: var(--lime);
  border: 1.5px solid var(--glass-border); backdrop-filter: blur(10px);
}
.btn-secondary:active { opacity: .7; }

/* ── VPN code block ──────────────────────────────────────────────────────────── */
.code-block {
  background: rgba(0,20,24,0.75);
  border: 1px solid rgba(214,251,0,0.18); border-radius: 11px;
  padding: 12px 36px 12px 12px;
  font-family: var(--mono); font-size: 11px;
  word-break: break-all; color: var(--lime);
  text-shadow: 0 0 8px rgba(214,251,0,0.3);
  margin: 10px 0; line-height: 1.6;
  cursor: pointer; position: relative;
  transition: opacity 0.15s; user-select: all;
}
.code-block:active { opacity: .6; }
.code-block::after {
  content: '📋'; position: absolute; top: 8px; right: 10px;
  font-size: 13px; opacity: .45;
}
.code-block.copied::after { content: '✓'; opacity: 1; color: var(--lime); }

/* ── Bonus section ───────────────────────────────────────────────────────────── */
.big-icon { font-size: 52px; margin-bottom: 8px; }
.points-display {
  display: flex; align-items: baseline;
  justify-content: center; gap: 6px; margin: 10px 0 4px;
}
#bonus-points {
  font-size: 48px; font-weight: 800;
  font-family: var(--mono); color: var(--lime);
  text-shadow: 0 0 30px rgba(214,251,0,0.5);
}
.points-label { font-size: 15px; color: var(--text-muted); }
.section-label {
  font-size: 11px; font-weight: 700; color: var(--lime); opacity: 0.8;
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px;
  font-family: var(--mono);
}
.section-label::before { content: "// "; opacity: 0.7; }

/* ── Messages ────────────────────────────────────────────────────────────────── */
.msg-box {
  border-radius: 12px; padding: 11px 15px;
  font-size: 13px; line-height: 1.5; margin-top: 12px;
  background: rgba(214,251,0,0.10); color: var(--lime-soft);
  border: 1px solid rgba(214,251,0,0.22); font-family: var(--mono);
}
.msg-box.error {
  background: rgba(220,53,69,0.14); color: #ff8585;
  border-color: rgba(220,53,69,0.28);
}

/* ── Misc ────────────────────────────────────────────────────────────────────── */
.loading { text-align: center; color: var(--text-muted); padding: 50px 16px; font-size: 13px; font-family: var(--mono); }
.hint-text { color: var(--text-muted); font-size: 13px; line-height: 1.65; margin-bottom: 12px; font-family: var(--mono); }
.hidden { display: none !important; }

/* ── Bottom nav ──────────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(0,22,26,0.9);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  display: flex;
  border-top: 1px solid var(--glass-border);
  padding-bottom: env(safe-area-inset-bottom); z-index: 20;
}
.nav-btn {
  flex: 1; background: none; border: none;
  padding: 8px 4px 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: rgba(236,255,182,0.28); transition: color 0.2s;
}
.nav-btn.active { color: var(--lime); filter: drop-shadow(0 0 6px rgba(214,251,0,0.5)); }
.nav-icon  { font-size: 22px; }
.nav-label { font-size: 10px; font-weight: 700; font-family: var(--mono); letter-spacing: 0.3px; }

/* ── Admin panel ─────────────────────────────────────────────────────────────── */
.admin-search {
  display: block; width: 100%; margin-top: 10px;
  padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid rgba(214,251,0,0.2);
  background: rgba(0,20,24,0.75); color: var(--text);
  font-size: 13px; font-family: var(--mono); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-search:focus { border-color: var(--glass-border); box-shadow: 0 0 14px rgba(214,251,0,0.1); }
.admin-search::placeholder { color: var(--text-muted); }

.admin-row {
  display: grid; grid-template-columns: 1fr auto auto 24px;
  align-items: center; gap: 8px; padding: 12px 14px;
  background: linear-gradient(135deg, rgba(0,84,95,0.28), rgba(0,35,40,0.22));
  border: 1px solid rgba(214,251,0,0.15); border-radius: 14px;
  margin-bottom: 6px; cursor: pointer; transition: all 0.2s;
  backdrop-filter: blur(14px);
}
.admin-row:hover  { border-color: rgba(214,251,0,0.38); }
.admin-row:active { opacity: .65; }
.admin-row-disabled { opacity: .3; }
.admin-row-name { font-size: 13px; font-weight: 600; color: var(--lime-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row-id   { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.admin-row-bal  { font-size: 12px; font-weight: 700; color: var(--lime); font-family: var(--mono); }
.admin-row-vpn  { font-size: 15px; text-align: center; }

.admin-detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.admin-detail-name { font-size: 15px; font-weight: 700; color: var(--lime); font-family: var(--mono); letter-spacing: -0.3px; }
.admin-close-btn {
  background: rgba(214,251,0,0.08); border: 1px solid rgba(214,251,0,0.2);
  color: var(--text-muted); cursor: pointer; padding: 5px 11px; border-radius: 9px;
  font-size: 13px; font-weight: 700; font-family: var(--mono); transition: all 0.2s;
}
.admin-close-btn:hover { color: var(--lime); border-color: var(--glass-border); }

.admin-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.admin-action-btn {
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--glass-border);
  font-size: 13px; font-weight: 700; font-family: var(--mono); cursor: pointer;
  background: linear-gradient(145deg, rgba(0,84,95,0.45), rgba(0,35,40,0.35));
  color: var(--lime-soft); transition: all 0.2s;
  backdrop-filter: blur(10px); text-align: left;
}
.admin-action-btn:hover { border-color: rgba(214,251,0,0.55); color: var(--lime); }
.admin-action-btn:active { opacity: .65; }
.admin-action-btn.warn   { border-color: rgba(255,160,0,0.35); color: #ffd060; }
.admin-action-btn.warn:hover   { border-color: rgba(255,160,0,0.65); }
.admin-action-btn.danger { border-color: rgba(220,53,69,0.35); color: #ff8080; }
.admin-action-btn.danger:hover { border-color: rgba(220,53,69,0.65); }
