/* ============================================================
   HaseebTraffic – assets/css/style.css
   Material-style, white card UI, fully responsive
   ============================================================ */

/* ── Reset & Variables ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #7B1FA2;
  --primary-dark: #6A1B9A;
  --primary-light:#F3E5F5;
  --accent:       #FF6F00;
  --success:      #2E7D32;
  --danger:       #C62828;
  --warning:      #F57F17;
  --text:         #212121;
  --text-secondary:#757575;
  --border:       #E0E0E0;
  --bg:           #F8F4FC;
  --card:         #FFFFFF;
  --shadow:       0 2px 8px rgba(0,0,0,.10);
  --shadow-md:    0 4px 16px rgba(0,0,0,.12);
  --radius:       12px;
  --radius-sm:    8px;
  --nav-h:        64px;
  --font:         'Inter', 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #bbb; border-radius: 3px; }

/* ── Typography ────────────────────────────────────────────── */
h1,h2,h3,h4 { font-weight: 700; line-height: 1.3; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p  { line-height: 1.7; }
small { font-size: .82rem; color: var(--text-secondary); }

/* ── Container ─────────────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  height: var(--nav-h);
  background: var(--card);
  box-shadow: 0 2px 8px rgba(123,31,162,.10);
  border-bottom: 2px solid var(--primary);
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.3rem; font-weight: 800;
  background: linear-gradient(135deg, #7B1FA2, #E91E63);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}
.nav-logo span { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500; color: var(--text);
  transition: background .2s, color .2s;
  text-decoration: none;
}
.nav-links a:hover, .nav-links a.active { background: var(--primary-light); color: var(--primary); }

.nav-menu-btn {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; border-radius: var(--radius-sm);
}
.nav-menu-btn span {
  display: block; width: 22px; height: 2px;
  background: var(--text); margin: 5px 0; transition: .3s;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  border: none; transition: all .2s; white-space: nowrap;
  text-decoration: none;
}
.btn-primary  { background: var(--primary);  color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); box-shadow: var(--shadow); }
.btn-accent   { background: var(--accent);   color: #fff; }
.btn-accent:hover   { background: #E65100; }
.btn-success  { background: var(--success);  color: #fff; }
.btn-danger   { background: var(--danger);   color: #fff; }
.btn-warning  { background: var(--warning);  color: #fff; }
.btn-outline  { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost    { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--border); }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Card ───────────────────────────────────────────────────── */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 1rem; font-weight: 700; }

/* ── Stat Card ──────────────────────────────────────────────── */
.stat-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 24px;
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; flex-shrink: 0;
}
.stat-icon.blue   { background: #E3F2FD; }
.stat-icon.green  { background: #E8F5E9; }
.stat-icon.orange { background: #FFF3E0; }
.stat-icon.purple { background: #F3E5F5; }
.stat-icon.red    { background: #FFEBEE; }
.stat-label { font-size: .8rem; color: var(--text-secondary); font-weight: 500; margin-bottom: 2px; }
.stat-value { font-size: 1.6rem; font-weight: 800; }

/* ── Balance Card ───────────────────────────────────────────── */
.balance-card {
  background: linear-gradient(135deg, #7B1FA2 0%, #4A148C 100%);
  color: #fff; border-radius: var(--radius); padding: 28px 32px;
  box-shadow: var(--shadow-md);
}
.balance-card .label { font-size: .85rem; opacity: .8; margin-bottom: 6px; }
.balance-card .amount { font-size: 2.4rem; font-weight: 800; letter-spacing: -.5px; }
.balance-card .usdt { font-size: .9rem; opacity: .75; margin-top: 4px; }

/* ── Pills / Tabs ───────────────────────────────────────────── */
.pills {
  display: flex; gap: 4px; background: var(--border);
  border-radius: 50px; padding: 4px;
  overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  padding: 8px 20px; border-radius: 50px; border: none;
  font-size: .88rem; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--text-secondary);
  transition: all .2s; white-space: nowrap;
}
.pill.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }

/* ── Tab Content ────────────────────────────────────────────── */
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .87rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-control {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--card);
  font-size: .9rem; color: var(--text); transition: border .2s;
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(25,118,210,.12); }
.form-control::placeholder { color: #BDBDBD; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-hint { font-size: .78rem; color: var(--text-secondary); margin-top: 4px; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: 4px; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 20px;
  opacity: 0; visibility: hidden; transition: all .25s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--card); border-radius: var(--radius);
  padding: 32px; width: 100%; max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  transform: translateY(16px); transition: transform .25s;
}
.modal-overlay.open .modal { transform: none; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 1.2rem; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 1.4rem; color: var(--text-secondary); padding: 4px; }
.modal-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.modal-tab {
  flex: 1; padding: 10px; text-align: center; font-weight: 600;
  font-size: .9rem; cursor: pointer; border: none; background: none;
  color: var(--text-secondary); border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: all .2s;
}
.modal-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th { text-align: left; padding: 10px 14px; background: var(--bg); font-weight: 600; color: var(--text-secondary); font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFAFA; }

/* ── Badge / Status ─────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 50px;
  font-size: .75rem; font-weight: 700; text-transform: capitalize;
}
.badge-success { background: #E8F5E9; color: #2E7D32; }
.badge-warning { background: #FFF8E1; color: #F57F17; }
.badge-danger  { background: #FFEBEE; color: #C62828; }
.badge-info    { background: #E3F2FD; color: #1565C0; }
.badge-cpc     { background: #F3E5F5; color: #6A1B9A; }
.badge-cpm     { background: #E0F7FA; color: #00695C; }

/* ── Alert / Toast ──────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: .88rem; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start;
}
.alert-success { background: #E8F5E9; color: #2E7D32; border-left: 3px solid #4CAF50; }
.alert-error   { background: #FFEBEE; color: #C62828; border-left: 3px solid #F44336; }
.alert-info    { background: #E3F2FD; color: #1565C0; border-left: 3px solid #2196F3; }

#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 12px 20px; border-radius: var(--radius-sm); color: #fff;
  font-size: .88rem; font-weight: 500; box-shadow: var(--shadow-md);
  animation: slideIn .3s ease;
}
@keyframes slideIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--primary); }

/* ── Dashboard layout ────────────────────────────────────────── */
.dash-wrap { padding: 28px 0 48px; }
.dash-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* ── Code block ─────────────────────────────────────────────── */
.code-block {
  background: #1E1E2E; color: #CDD6F4; border-radius: var(--radius-sm);
  padding: 16px; font-family: 'Courier New', monospace; font-size: .82rem;
  overflow-x: auto; line-height: 1.6; position: relative;
}
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255,255,255,.12); color: #fff; border: none; cursor: pointer;
  border-radius: 6px; padding: 4px 10px; font-size: .75rem;
}
.copy-btn:hover { background: rgba(255,255,255,.22); }

/* ── Loader ─────────────────────────────────────────────────── */
.loader { display: flex; justify-content: center; padding: 40px 0; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ────────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 24px; color: var(--text-secondary); }
.empty-icon { font-size: 3rem; margin-bottom: 12px; }

/* ── Section heading ────────────────────────────────────────── */
.section-heading { margin-bottom: 24px; }
.section-heading h2 { font-size: 1.35rem; }

/* ── Referral link box ──────────────────────────────────────── */
.ref-box {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.ref-box input { flex: 1; background: none; border: none; font-size: .88rem; color: var(--text); outline: none; }

/* ── Chart container ────────────────────────────────────────── */
.chart-wrap { position: relative; height: 240px; }

/* ── Hero (index) ───────────────────────────────────────────── */
.hero {
  padding: 80px 0 64px;
  text-align: center;
}
.hero-subtitle { font-size: 1.05rem; color: var(--text-secondary); margin: 16px 0 32px; max-width: 540px; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.features { padding: 64px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 40px; }
.feature-item { text-align: center; padding: 28px 20px; }
.feature-icon { font-size: 2.4rem; margin-bottom: 14px; }
.feature-item h3 { margin-bottom: 8px; }

footer { background: var(--card); border-top: 1px solid var(--border); padding: 24px 0; text-align: center; color: var(--text-secondary); font-size: .85rem; }

/* ── Admin specific ─────────────────────────────────────────── */
.admin-badge { background: #FF6F00; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: .72rem; font-weight: 700; margin-left: 6px; }

/* ── Utilities ──────────────────────────────────────────────── */
.mt-1{margin-top:4px;} .mt-2{margin-top:8px;} .mt-3{margin-top:16px;} .mt-4{margin-top:24px;} .mt-5{margin-top:32px;}
.mb-1{margin-bottom:4px;} .mb-2{margin-bottom:8px;} .mb-3{margin-bottom:16px;} .mb-4{margin-bottom:24px;}
.gap-2{gap:8px;} .gap-3{gap:16px;}
.flex{display:flex;} .items-center{align-items:center;} .justify-between{justify-content:space-between;} .justify-center{justify-content:center;} .flex-wrap{flex-wrap:wrap;} .flex-1{flex:1;}
.text-center{text-align:center;} .text-right{text-align:right;}
.text-primary{color:var(--primary);} .text-success{color:var(--success);} .text-danger{color:var(--danger);} .text-muted{color:var(--text-secondary);}
.font-bold{font-weight:700;} .w-full{width:100%;}
.hidden{display:none!important;}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dash-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--card); padding: 12px; box-shadow: var(--shadow); gap: 2px; }
  .nav-links.open { display: flex; }
  .navbar .container { position: relative; }
  .nav-menu-btn { display: block; }
  .dash-grid-4 { grid-template-columns: 1fr 1fr; }
  .dash-grid-2, .dash-grid-3 { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 40px; }
  .balance-card .amount { font-size: 1.8rem; }
  .modal { padding: 24px 20px; }
}
@media (max-width: 480px) {
  .dash-grid-4 { grid-template-columns: 1fr; }
  .pills { justify-content: flex-start; }
  .pill { padding: 7px 14px; font-size: .82rem; }
  table { font-size: .8rem; }
}

/* ── Enhanced Card Styles (v2) ──────────────────────────────── */
.card {
  border: 1px solid rgba(123,31,162,.08);
  transition: box-shadow .25s, transform .2s;
}
.card:hover {
  box-shadow: 0 8px 28px rgba(123,31,162,.14);
  transform: translateY(-2px);
  border-color: rgba(123,31,162,.18);
}

/* Website list card */
.site-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  transition: box-shadow .2s, transform .2s;
}
.site-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.11); transform: translateY(-1px); }
.site-card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--primary-light); display: flex;
  align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.site-card-body { flex: 1; min-width: 0; }
.site-card-name { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-card-url  { font-size: .78rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-card-stats { display: flex; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.site-card-stat { font-size: .78rem; color: var(--text-secondary); }
.site-card-stat strong { color: var(--text); font-weight: 700; }
.site-card-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* Stat cards hover */
.stat-card {
  transition: box-shadow .2s, transform .2s;
  border: 1px solid rgba(123,31,162,.07);
}
.stat-card:hover { box-shadow: 0 6px 20px rgba(123,31,162,.13); transform: translateY(-2px); }

/* Footer */
.site-footer {
  background: linear-gradient(135deg, #F8F4FC 0%, #fff 100%);
  border-top: 2px solid var(--primary);
  padding: 22px 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: .82rem;
  margin-top: 40px;
}
.site-footer a { color: var(--primary); text-decoration: none; }

/* Embed code modal */
.embed-card {
  background: #1E1E2E;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 12px;
}
.embed-card code {
  color: #CDD6F4;
  font-family: 'Courier New', monospace;
  font-size: .82rem;
  line-height: 1.7;
  word-break: break-all;
  white-space: pre-wrap;
  display: block;
}

/* History type pills */
.type-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 50px;
  font-size: .75rem; font-weight: 600;
}
.type-pill.withdrawal   { background: #FFF3E0; color: #E65100; }
.type-pill.referral     { background: #E8F5E9; color: #2E7D32; }
