/* =========================================================
   EaglePay — Luxury Milky Way Theme
   ========================================================= */
:root {
  --gold: #d4af6a;
  --gold-light: #f4e4bc;
  --ink: #eae6f0;
  --ink-dim: #b9b3c9;
  --glass: rgba(20, 16, 35, 0.55);
  --glass-border: rgba(212, 175, 106, 0.28);
  --danger: #ff6b6b;
  --success: #4ade80;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
  color: var(--ink);
}

body {
  background: url('../images/milkyway.jpg') center center / cover fixed no-repeat, #05030c;
  background-blend-mode: normal;
  position: relative;
}

/* dark vignette overlay so text stays readable over the galaxy image */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(5,3,12,0.35) 0%, rgba(5,3,12,0.82) 100%);
  z-index: 0;
  pointer-events: none;
}

.app-shell, .center-shell {
  position: relative;
  z-index: 1;
}

/* ---------- Glass card ---------- */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
  padding: 32px;
}

/* ---------- Auth (login/signup-style admin-create) center layout ---------- */
.center-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-box { width: 100%; max-width: 420px; text-align: center; }
.brand {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gold-light);
  margin-bottom: 4px;
  text-shadow: 0 0 20px rgba(212,175,106,0.4);
}
.brand-sub { color: var(--ink-dim); font-size: 13px; margin-bottom: 28px; }

/* ---------- Form elements ---------- */
label { display: block; text-align: left; font-size: 13px; color: var(--ink-dim); margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }

.btn {
  display: inline-block;
  width: 100%;
  margin-top: 22px;
  padding: 13px 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #241a05;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .4px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(212,175,106,0.35); }
.btn.secondary { background: rgba(255,255,255,0.08); color: var(--ink); border: 1px solid var(--glass-border); }
.btn.danger { background: linear-gradient(135deg,#ff8b8b,#e04b4b); color: #2a0505; }
.btn.small { width: auto; padding: 8px 14px; font-size: 12px; margin-top: 0; }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; text-align: left; }
.alert.error   { background: rgba(255,107,107,0.15); border: 1px solid rgba(255,107,107,0.4); color: #ffb3b3; }
.alert.success { background: rgba(74,222,128,0.15); border: 1px solid rgba(74,222,128,0.4); color: #b7f5cd; }

/* ---------- Dashboard shell ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 16px 28px;
  background: rgba(10,7,20,0.65);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  position: relative; z-index: 50;
}
.topbar .brand { margin: 0; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .user-chip {
  font-size: 13px; color: var(--ink-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45vw;
}

.layout { display: flex; min-height: calc(100vh - 62px); position: relative; z-index: 1; }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: rgba(10,7,20,0.55);
  border-right: 1px solid var(--glass-border);
  padding: 20px 0;
}
.sidebar a {
  display: block; padding: 12px 24px; color: var(--ink-dim);
  text-decoration: none; font-size: 14px; border-left: 3px solid transparent;
}
.sidebar a:hover, .sidebar a.active {
  color: var(--gold-light); background: rgba(212,175,106,0.08); border-left-color: var(--gold);
}
.content { flex: 1; padding: 28px; min-width: 0; }

.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card { padding: 20px; }
.stat-card .label { font-size: 12px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .6px; }
.stat-card .value { font-size: 26px; font-weight: 700; color: var(--gold-light); margin-top: 6px; }

.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--glass-border); }
th { color: var(--gold-light); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .5px; white-space: nowrap; }
tr:hover td { background: rgba(255,255,255,0.03); }

.badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.success { background: rgba(74,222,128,0.15); color: var(--success); }
.badge.pending { background: rgba(212,175,106,0.15); color: var(--gold-light); }
.badge.failed  { background: rgba(255,107,107,0.15); color: var(--danger); }

/* ---------- Mobile menu toggle (hidden on desktop) ---------- */
.menu-toggle {
  display: none;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  color: var(--gold-light);
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
}

/* =========================================================
   RESPONSIVE — tablets and phones
   ========================================================= */
@media (max-width: 900px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .glass-card { padding: 22px; }
}

@media (max-width: 900px) {
  .topbar { padding: 12px 16px; }
  .topbar .brand { font-size: 16px; }
  .content { padding: 18px; }

  .menu-toggle { display: block; }

  /* sidebar becomes a slide-in drawer on tablets + phones */
  .sidebar {
    display: block;
    position: fixed;
    top: 62px; left: 0; bottom: 0;
    width: 260px;
    max-width: 80vw;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 40;
    overflow-y: auto;
    padding-top: 8px;
    /* was rgba(10,7,20,0.55) — same as the desktop inline sidebar, which is
       fine on desktop (there's no page content directly behind it) but on
       a mobile drawer it let the dashboard content underneath show through
       and overlap the menu text. Solid + blurred so the drawer is fully
       opaque while open. */
    background: rgb(9, 7, 18);
    background: linear-gradient(180deg, rgba(15,11,28,0.98), rgba(9,7,18,0.98));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  .sidebar.open { transform: translateX(0); box-shadow: 10px 0 40px rgba(0,0,0,0.5); }
  .sidebar a { padding: 14px 24px; font-size: 15px; }

  .sidebar-backdrop {
    display: none;
    position: fixed; top: 62px; left: 0; right: 0; bottom: 0; z-index: 35;
    background: rgba(0,0,0,0.55);
  }
  .sidebar-backdrop.open { display: block; }

  .layout { display: block; }
  .content { width: 100%; }
}

@media (min-width: 901px) {
  .sidebar-backdrop { display: none !important; }
}

@media (max-width: 640px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .glass-card { padding: 18px; border-radius: 12px; }
  .content { padding: 16px; }

  /* forms/grids that used a fixed side column stack full width */
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  input[type=text], input[type=password], input[type=email], input[type=number], select, textarea, .btn {
    font-size: 16px; /* prevents iOS auto-zoom on focus */
  }

  .stat-card .value { font-size: 21px; }

  .tg-support-btn { bottom: 16px; right: 16px; width: 50px; height: 50px; font-size: 22px; }

  .auth-box { max-width: 100%; }
  .qr-box img { width: 160px; height: 160px; }
}

/* ---------- Telegram support floating button ---------- */
.tg-support-btn {
  position: fixed; bottom: 24px; right: 24px; z-index: 50;
  background: linear-gradient(135deg,#34a8e0,#1c7fc4);
  color: #fff; text-decoration: none;
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 6px 22px rgba(28,127,196,0.5);
  transition: transform .15s;
}
.tg-support-btn:hover { transform: scale(1.08); }

.qr-box { background: #fff; padding: 14px; border-radius: 12px; display: inline-block; margin: 16px 0; }
.mono { font-family: 'Courier New', monospace; letter-spacing: 1px; }

/* ---------- API documentation page ---------- */
.docs-shell { max-width: 980px; margin: 0 auto; padding: 32px 20px 80px; }
.docs-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.docs-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.docs-nav a {
  font-size: 12.5px; padding: 7px 13px; border-radius: 20px; text-decoration: none;
  color: var(--ink-dim); background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
}
.docs-nav a:hover { color: var(--gold-light); border-color: var(--gold); }
.endpoint { margin-bottom: 34px; scroll-margin-top: 20px; }
.endpoint h3 { color: var(--gold-light); margin-bottom: 6px; }
.method-badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .5px;
  padding: 3px 10px; border-radius: 6px; margin-right: 8px; vertical-align: middle;
}
.method-badge.post { background: rgba(74,222,128,0.18); color: var(--success); }
.method-badge.get  { background: rgba(96,165,250,0.18); color: #93c5fd; }
pre.code-block {
  background: rgba(5,3,12,0.75); border: 1px solid var(--glass-border); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; font-size: 12.5px; line-height: 1.6;
  font-family: 'Courier New', monospace; color: #d7f0d0;
}
pre.code-block .k { color: #93c5fd; }
.params-table th, .params-table td { font-size: 12.5px; }
.download-row { display: flex; gap: 10px; flex-wrap: wrap; }
.download-row .btn { width: auto; }
