/* ============================================================
   Haske247 Support — Shared Design System
   (color tokens & components adapted from the Haske247 template)
   ============================================================ */

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

:root {
  --bg: #070b14;
  --surface: #0f172a;
  --surface2: #1e293b;
  --border: #1e293b;
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --text: #cbd5e1;
  --text-white: #ffffff;
  --text-muted: #64748b;
  --success: #34d399;
  --danger: #f87171;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  padding-bottom: 4rem;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ping { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .4; } }
.animate-fade-in { animation: fadeIn .3s ease-out forwards; }

/* ── NAV ── */
nav.site-nav {
  position: sticky; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(7,11,20,.92); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; width: 100%; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.logo { display: flex; align-items: center; gap: .65rem; min-width: 0; flex-shrink: 0; }
.logo-icon { width: 36px; height: 36px; background: var(--amber); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--bg); font-size: .85rem; box-shadow: 0 0 20px rgba(245,158,11,.3); flex-shrink: 0; }
.logo-text { font-size: 1.05rem; font-weight: 800; color: var(--text-white); letter-spacing: -.02em; }
.logo-text span { color: var(--amber); }
.nav-links { display: none; align-items: center; gap: 1.75rem; }
@media (min-width: 768px) { .nav-links { display: flex; } }
@media (min-width: 768px) and (max-width: 1100px) {
  .nav-links { gap: 1rem; }
  .nav-link { font-size: .78rem; }
}
.nav-link { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.nav-link:hover, .nav-link.active { color: var(--amber-light); }
.user-pill { display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; min-width: 0; }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; color: var(--amber); flex-shrink: 0; }
.user-pill-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.user-pill-text .uname { font-size: .65rem; font-weight: 700; color: var(--text-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.user-pill-text .role { font-size: .5rem; color: var(--amber); text-transform: uppercase; letter-spacing: .1em; }

@media (max-width: 480px) {
  .nav-inner { padding: 0 1rem; gap: .5rem; }
  .logo-text { font-size: .92rem; }
  .logo-icon { width: 30px; height: 30px; }
  .user-pill-text .uname { max-width: 64px; }
  .user-pill-text .role { display: none; }
  .user-pill { padding: 5px 9px; }
}

/* ── MOBILE NAV (hamburger) ── */
.nav-burger {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 4px; width: 40px; height: 40px; border-radius: .6rem; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; flex-shrink: 0;
}
.nav-burger span { display: block; width: 18px; height: 2px; background: var(--text-white); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (min-width: 768px) { .nav-burger { display: none; } }

.mobile-nav {
  display: flex; flex-direction: column; gap: .15rem;
  max-height: 0; overflow: hidden; opacity: 0;
  background: rgba(7,11,20,.98); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: max-height .25s ease, opacity .2s ease;
}
.mobile-nav.open { max-height: 80vh; opacity: 1; overflow-y: auto; }
@media (min-width: 768px) { .mobile-nav { display: none !important; } }
.mobile-nav-link {
  padding: .9rem 1.5rem; font-size: .92rem; font-weight: 600; color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,.04); min-height: 44px; display: flex; align-items: center;
}
.mobile-nav-link:hover, .mobile-nav-link:active { color: var(--amber-light); background: rgba(245,158,11,.06); }
.mobile-nav-divider { height: 1px; background: var(--border); margin: .25rem 1.5rem; }
.mobile-nav-logout { color: var(--danger); }

body.scroll-locked { overflow: hidden; }

@media (max-width: 767px) { .nav-desktop-only { display: none !important; } }

/* ── LAYOUT ── */
main { max-width: 1180px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.container-sm { max-width: 560px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.page-head { text-align: center; margin-bottom: 2.5rem; }
.page-title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; color: var(--text-white); margin-bottom: .5rem; letter-spacing: -.02em; }
.page-sub { color: var(--text-muted); font-size: .95rem; }

/* Two-column public pages (creator support page, campaign page) that
   stack to a single column on phones/tablets. */
.support-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; }
@media (max-width: 860px) {
  .support-layout { grid-template-columns: 1fr; gap: 1.25rem; }
}

@media (max-width: 640px) {
  main { padding: 1.25rem 1rem; }
  .container-sm { padding: 1.5rem 1rem; }
  .page-head { margin-bottom: 1.5rem; }
  .card { padding: 1.1rem; border-radius: .8rem; }
  .support-cover { height: 120px !important; border-radius: .7rem !important; }
  .support-header-row { flex-wrap: wrap; }
  .support-avatar-lg { width: 52px !important; height: 52px !important; font-size: 1.1rem !important; }
  .manual-bank-grid { grid-template-columns: 1fr !important; }
}

/* Platform-wide responsive audit: every "main content + sidebar" two-column
   layout across the app (events.php, wallet.php, campaigns.php, etc.) uses
   `.grid` with an inline grid-template-columns override — collapse all of
   them to a single column on tablets/phones without touching every page. */
@media (max-width: 860px) {
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}
/* Same idea for inline-styled `.stat-grid` blocks (admin stat rows, payment
   summaries): step down to 2 columns on tablets, 1 on narrow phones. */
@media (max-width: 640px) {
  .stat-grid[style*="grid-template-columns"] { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 420px) {
  .stat-grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Touch-friendly controls on mobile: comfortable tap targets everywhere. */
@media (max-width: 640px) {
  .btn, button, input[type=submit] { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  input[type=text], input[type=email], input[type=tel], input[type=password],
  input[type=number], input[type=date], input[type=time], input[type=datetime-local],
  input[type=file], textarea, select { min-height: 44px; font-size: 16px; }
  textarea { min-height: 90px; }
}

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: 12px 24px; border-radius: 999px; font-weight: 800; font-size: .9rem; border: none; cursor: pointer; transition: filter .15s, background .15s; }
.btn-primary { background: var(--amber); color: var(--bg); box-shadow: 0 4px 20px rgba(245,158,11,.3); }
.btn-primary:hover { background: var(--amber-light); }
.btn-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text-white); }
.btn-secondary:hover { background: var(--surface2); }
.btn-google { background: #fff; border: 1px solid #dadce0; color: #3c4043; gap: 10px; font-weight: 700; }
.btn-google:hover { background: #f8f9fa; }
.btn-danger { background: var(--danger); color: #1a0000; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: .78rem; }

/* ── CARDS ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; padding: 1.5rem; }
.card + .card { margin-top: 1rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.creator-card { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; overflow: hidden; transition: transform .2s, border-color .2s; }
.creator-card:hover { transform: translateY(-3px); border-color: rgba(245,158,11,.4); }
.creator-cover { height: 110px; background: linear-gradient(135deg, var(--surface2), var(--bg)); background-size: cover; background-position: center; }
.creator-body { padding: 1.25rem; position: relative; }
.creator-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--surface2); border: 3px solid var(--surface); margin-top: -42px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--amber); font-size: 1.1rem; overflow: hidden; }
.creator-name { font-size: 1.05rem; font-weight: 800; color: var(--text-white); margin-top: .6rem; }
.creator-headline { font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; }

/* ── PROGRESS BAR ── */
.progress-wrap { background: var(--surface2); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--amber), var(--amber-light)); border-radius: 999px; }
.progress-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem .75rem; font-size: .72rem; color: var(--text-muted); margin-top: .4rem; }

/* ── FORMS ── */
.form-group { margin-bottom: 1.1rem; }
label { display: block; font-size: .8rem; font-weight: 700; color: var(--text-white); margin-bottom: .4rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=file], textarea, select {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); color: var(--text-white);
  padding: 12px 14px; border-radius: .6rem; font-size: .9rem; font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--amber); }
textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: .72rem; color: var(--text-muted); margin-top: .35rem; }
.check-row { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text); }
.check-row input { width: auto; }
.amount-chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.amount-chip { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface2); color: var(--text-white); font-weight: 700; font-size: .85rem; cursor: pointer; }
.amount-chip.active, .amount-chip:hover { border-color: var(--amber); color: var(--amber-light); }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: .6rem; font-size: .85rem; margin-bottom: 1.25rem; display: flex; align-items: center; gap: .6rem; }
.alert-success { background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.35); color: var(--success); }
.alert-error { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.35); color: var(--danger); }
.alert-info { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: var(--amber-light); }

/* ── TABLES ── */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
td { color: var(--text); }
@media (max-width: 640px) {
  .table-responsive table { min-width: 560px; }
  th, td { padding: 8px 10px; font-size: .8rem; }
}
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.badge-completed { background: rgba(52,211,153,.15); color: var(--success); }
.badge-pending, .badge-pending_review { background: rgba(245,158,11,.15); color: var(--amber-light); }
.badge-failed, .badge-rejected { background: rgba(248,113,113,.15); color: var(--danger); }
.badge-active { background: rgba(56,189,248,.15); color: #38bdf8; }

/* ── STAT ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: .9rem; padding: 1.1rem; }
.stat-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .4rem; }
.stat-value { font-size: 1.4rem; font-weight: 800; color: var(--text-white); }

/* ── WHATSAPP FAB ── */
.wa-fab { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 60; width: 56px; height: 56px; border-radius: 50%; background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
@media (max-width: 480px) {
  .wa-fab { width: 48px; height: 48px; bottom: calc(64px + 1rem); right: 1rem; }
}

/* ── MOBILE BOTTOM NAV ── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 55;
  background: rgba(7,11,20,.97); backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255,255,255,.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@media (max-width: 767px) {
  .bottom-nav { display: flex; align-items: stretch; justify-content: space-around; height: 64px; }
  body { padding-bottom: 64px; }
  .wa-fab { bottom: calc(64px + 1rem); }
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-muted); font-size: .66rem; font-weight: 600; min-height: 44px;
}
.bottom-nav-item svg, .bottom-nav-item i { width: 20px; height: 20px; }
.bottom-nav-item.active { color: var(--amber-light); }

/* ── FOOTER ── */
footer.site-footer { background: #04070c; border-top: 1px solid var(--border); padding: 2rem 1.5rem; margin-top: 3rem; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: .75rem; text-align: center; }
@media (min-width: 768px) { .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; } }
.footer-copy { font-size: .72rem; color: var(--text-muted); }

/* ── UTIL ── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}.mb-4{margin-bottom:2rem}
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
@media (max-width: 480px) { .hide-mobile { display: none; } }

/* ── WALLET DONATIONS LIST (table-free — never needs horizontal scroll) ── */
.wallet-layout { grid-template-columns: 1.3fr .9fr; }
@media (max-width: 860px) { .wallet-layout { grid-template-columns: 1fr; } }
.wallet-donation-list { display: flex; flex-direction: column; gap: .1rem; }
.wallet-donation-row {
  display: flex; align-items: center; gap: 1rem; padding: 12px 4px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.wallet-donation-row:last-child { border-bottom: none; }
.wallet-donation-main { flex: 1 1 140px; min-width: 0; }
.wallet-donation-creator { font-weight: 700; color: var(--text-white); font-size: .9rem; overflow-wrap: anywhere; }
.wallet-donation-amount { font-weight: 800; color: var(--amber-light); font-size: .9rem; flex: 0 0 auto; }
.wallet-donation-status { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; flex: 0 0 auto; margin-left: auto; }
@media (max-width: 560px) {
  .wallet-donation-row { flex-direction: column; align-items: flex-start; gap: .4rem; padding: 14px 2px; }
  .wallet-donation-amount { order: 2; font-size: 1rem; }
  .wallet-donation-status { order: 3; margin-left: 0; width: 100%; justify-content: space-between; }
}

/* ── SHARE WIDGET (modal / bottom sheet) ── */
.share-trigger-btn { display: inline-flex; align-items: center; gap: .5rem; }

.share-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4,6,10,.7); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.share-overlay.open { opacity: 1; pointer-events: auto; }

.share-modal {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 1.1rem; padding: 1.5rem;
  transform: scale(.94) translateY(8px); opacity: 0; transition: transform .2s ease, opacity .2s ease;
  max-height: 88vh; overflow-y: auto;
}
.share-overlay.open .share-modal { transform: scale(1) translateY(0); opacity: 1; }

.share-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.share-modal-title { font-weight: 800; color: var(--text-white); font-size: 1.05rem; }
.share-modal-close {
  width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--surface2);
  color: var(--text-white); font-size: 1.1rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.share-modal-close:hover { background: var(--danger); color: #1a0000; }

.share-copy-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: .55rem;
  background: var(--amber); color: var(--bg); border: none; border-radius: .75rem;
  padding: 13px 16px; font-weight: 800; font-size: .88rem; cursor: pointer; min-height: 48px;
  transition: background .15s;
}
.share-copy-btn:hover { background: var(--amber-light); }
.share-copy-btn svg { flex-shrink: 0; }
.share-copied-msg {
  text-align: center; color: var(--success); font-size: .78rem; font-weight: 700;
  margin-top: .6rem; height: 1rem; opacity: 0; transition: opacity .2s ease;
}
.share-copied-msg.show { opacity: 1; }

.share-icons-row { display: flex; justify-content: space-between; gap: .5rem; margin-top: 1.35rem; }
.share-icon-circle {
  width: 52px; height: 52px; border-radius: 50%; background: var(--surface2);
  border: 1px solid var(--border); color: var(--text-white);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  cursor: pointer; transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.share-icon-circle:hover, .share-icon-circle:active { transform: translateY(-2px) scale(1.05); }
.share-icon-circle.ic-whatsapp:hover { background: #25D366; border-color: #25D366; color: #fff; }
.share-icon-circle.ic-facebook:hover { background: #1877F2; border-color: #1877F2; color: #fff; }
.share-icon-circle.ic-telegram:hover { background: #26A5E4; border-color: #26A5E4; color: #fff; }
.share-icon-circle.ic-x:hover { background: #fff; border-color: #fff; color: #000; }
.share-icon-circle.ic-email:hover { background: var(--amber); border-color: var(--amber); color: var(--bg); }
.share-icon-circle.ic-qr:hover { background: var(--amber); border-color: var(--amber); color: var(--bg); }

.share-qr { margin-top: 1.25rem; text-align: center; background: var(--surface2); border-radius: .75rem; padding: 1rem; display: none; }
.share-qr.open { display: block; }
.share-qr img { margin: 0 auto; border-radius: .5rem; background: #fff; padding: 8px; max-width: 100%; height: auto; }

/* Mobile: bottom sheet instead of a centered modal */
@media (max-width: 640px) {
  .share-overlay { align-items: flex-end; padding: 0; }
  .share-modal {
    max-width: 100%; border-radius: 1.25rem 1.25rem 0 0; padding: 1.25rem 1.25rem 1.75rem;
    transform: translateY(24px); max-height: 82vh;
  }
  .share-overlay.open .share-modal { transform: translateY(0); }
  .share-icon-circle { width: 48px; height: 48px; }
}
