/* ============================================================
   Arx Asset Vault — Enhancements
   Preloader · Back to Top · Stats · Badges · Notifications
   ============================================================ */

/* ── PRELOADER ────────────────────────────────────────────── */
#arx-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #060608;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#arx-preloader.arx-fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.arx-pre-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.6rem;
  font-weight: 600;
  color: #f5f3ee;
  letter-spacing: 0.06em;
  animation: arxLogoIn 0.7s ease forwards;
  opacity: 0;
}
.arx-pre-logo span {
  color: #c9a84c;
}
.arx-pre-tagline {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 243, 238, 0.35);
  animation: arxLogoIn 0.7s 0.2s ease forwards;
  opacity: 0;
}
.arx-pre-bar-wrap {
  width: 180px;
  height: 2px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
  animation: arxLogoIn 0s 0.1s ease forwards;
  opacity: 0;
}
.arx-pre-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c9a84c, #e2c47a);
  border-radius: 2px;
  animation: arxBarFill 1.6s 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.arx-pre-vault {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #c9a84c;
  animation: arxVaultPulse 1.8s 0.1s ease-in-out infinite, arxLogoIn 0.5s ease forwards;
  opacity: 0;
  margin-bottom: -4px;
}
@keyframes arxLogoIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes arxBarFill {
  from { width: 0%; }
  to   { width: 100%; }
}
@keyframes arxVaultPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.15); }
  50%       { box-shadow: 0 0 0 14px rgba(201, 168, 76, 0); }
}

/* ── BACK TO TOP ──────────────────────────────────────────── */
#arx-back-top {
  position: fixed;
  bottom: 24px;
  right: 16px;
  z-index: 9000;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #c9a84c;
  border: none;
  color: #060608;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.35);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  pointer-events: none;
}
#arx-back-top.arx-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#arx-back-top:hover {
  background: #e2c47a;
  transform: translateY(-2px);
}

/* ── LIVE STATS SECTION ───────────────────────────────────── */
.arx-stats-section {
  background: #060608;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 72px 5%;
}
.arx-stats-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.arx-stats-header {
  text-align: center;
  margin-bottom: 56px;
}
.arx-stats-header .section-tag {
  display: inline-block;
  margin-bottom: 14px;
}
.arx-stats-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 400;
  color: #f5f3ee;
  line-height: 1.3;
}
.arx-stats-header h2 em {
  font-style: normal;
  color: #c9a84c;
}
.arx-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.arx-stat-card {
  background: #12121a;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.arx-stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201, 168, 76, 0.07), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.arx-stat-card:hover {
  border-color: rgba(201, 168, 76, 0.3);
  transform: translateY(-4px);
}
.arx-stat-card:hover::before {
  opacity: 1;
}
.arx-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c9a84c;
  font-size: 1.1rem;
  margin: 0 auto 18px;
  position: relative;
  z-index: 1;
}
.arx-stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.6rem;
  font-weight: 700;
  color: #f5f3ee;
  line-height: 1;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.arx-stat-value .arx-suffix {
  font-size: 1.4rem;
  color: #c9a84c;
}
.arx-stat-label {
  font-size: 0.8rem;
  color: rgba(245, 243, 238, 0.45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.arx-stat-sub {
  font-size: 0.72rem;
  color: #2ecc71;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
  z-index: 1;
}
@media (max-width: 900px) {
  .arx-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .arx-stats-grid { grid-template-columns: 1fr; }
}

/* ── SECURITY BADGES SECTION ──────────────────────────────── */
.arx-badges-section {
  background: #0c0c10;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 56px 5%;
}
.arx-badges-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.arx-badges-label {
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(245, 243, 238, 0.35);
  margin-bottom: 36px;
}
.arx-badges-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.arx-badge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #17171f;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 14px 20px;
  transition: border-color 0.25s ease, transform 0.25s ease;
  min-width: 160px;
}
.arx-badge-card:hover {
  border-color: rgba(201, 168, 76, 0.25);
  transform: translateY(-2px);
}
.arx-badge-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.arx-badge-text strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f5f3ee;
  line-height: 1.2;
}
.arx-badge-text span {
  font-size: 0.7rem;
  color: rgba(245, 243, 238, 0.4);
}
.arx-badge-verified {
  margin-left: auto;
  color: #2ecc71;
  font-size: 0.75rem;
}

/* ── NOTIFICATION TOASTS ──────────────────────────────────── */
#arx-notif-container {
  position: fixed;
  bottom: 90px;
  left: 24px;
  z-index: 8900;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.arx-notif {
  background: #17171f;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 3px solid #c9a84c;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 320px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.arx-notif.arx-notif-show {
  opacity: 1;
  transform: translateX(0);
}
.arx-notif.arx-notif-hide {
  opacity: 0;
  transform: translateX(-20px);
}
.arx-notif-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.arx-notif-body {
  flex: 1;
  min-width: 0;
}
.arx-notif-msg {
  font-size: 0.82rem;
  color: #f5f3ee;
  line-height: 1.4;
  font-weight: 500;
}
.arx-notif-msg span {
  color: #c9a84c;
  font-weight: 600;
}
.arx-notif-time {
  font-size: 0.7rem;
  color: rgba(245, 243, 238, 0.35);
  margin-top: 3px;
}
.arx-notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ecc71;
  flex-shrink: 0;
  animation: arxDotPulse 2s infinite;
}
@keyframes arxDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@media (max-width: 600px) {
  #arx-notif-container {
    left: 12px;
    right: 12px;
    bottom: 80px; /* keep above any fixed bottom UI */
  }
  .arx-notif { min-width: unset; max-width: 100%; }
  #arx-back-top {
    bottom: 24px;
    right: 14px;
    width: 40px;
    height: 40px;
  }
}
@media (max-width: 380px) {
  #arx-notif-container { bottom: 76px; }
  #arx-back-top { bottom: 20px; right: 12px; }
}

/* ── ARX Hide-Balance Toggle ────────────────────────────────────────────── */
[data-arx-balance-wrap] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.arx-hide-bal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--muted, rgba(245,243,238,.45));
  font-size: .85em;
  line-height: 1;
  transition: color .2s, background .2s;
  vertical-align: middle;
  flex-shrink: 0;
}
.arx-hide-bal-btn:hover {
  color: var(--gold, #c9a84c);
  background: rgba(201,168,76,.1);
}
.arx-hide-bal-btn:active {
  transform: scale(.9);
}
/* mask animation */
[data-arx-balance] {
  transition: letter-spacing .15s;
}

/* ════════════════════════════════════════════════════════
   ENHANCEMENTS — Extra responsive fixes
   ════════════════════════════════════════════════════════ */

/* Ensure all tables scroll horizontally on mobile */
table { width: 100%; border-collapse: collapse; }
.card table, .card > div > table {
  min-width: 480px;
}
.card > div:has(table), .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Sidebar mobile header always block on mobile */
.mobile-header { display: none; }
@media (max-width: 900px) {
  .mobile-header { display: flex !important; }
}

/* Prevent horizontal scroll on body */
body { overflow-x: hidden; }
.dashboard-container { overflow-x: hidden; }

/* Fix long text overflow in table cells */
td, th { word-break: break-word; }

/* Wallets / referral grid responsive */
@media (max-width: 600px) {
  .wallets-grid, .ref-stats { grid-template-columns: 1fr !important; }
  .summary-row { grid-template-columns: 1fr !important; }
}

/* Profile / settings form responsive */
@media (max-width: 600px) {
  .profile-grid, .settings-grid { grid-template-columns: 1fr !important; }
}

/* Fund-requests responsive */
@media (max-width: 600px) {
  .req-tabs { flex-direction: column; }
}

/* Arx hide-balance button styling for non-transaction pages */
.arx-hide-bal-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: .8rem;
  transition: color .2s;
  vertical-align: middle;
}
.arx-hide-bal-btn:hover { color: var(--gold); }

/* Mobile stat cards uniform height */
@media (max-width: 600px) {
  .stat-card { min-height: 70px; }
  .stat-details h3 { font-size: 1.05rem; }
}

/* Sidebar scroll on very tall navs */
.sidebar-nav { overflow-y: auto; }

/* 2FA / verify / login page responsive */
@media (max-width: 480px) {
  .auth-card, .verify-card { padding: 24px 16px !important; margin: 16px !important; }
}

/* ════════════════════════════════════════════════════════
   LIVE CHAT ↔ BACK-TO-TOP SEPARATION
   Smartsupp chat widget renders at bottom-right ~68px wide.
   We shift #arx-back-top left of it so they never overlap.
   Pages WITH Smartsupp: right offset = chat bubble (~70px) + gap (12px)
   Pages WITHOUT Smartsupp: default right: 16px stays.
   We add a utility class .has-livechat applied via JS below.
   ════════════════════════════════════════════════════════ */
#arx-back-top {
  bottom: 24px;
  right: 16px;
}
/* When Smartsupp is loaded, move back-top to the left of the chat widget */
body.has-livechat #arx-back-top {
  right: 90px;
}
@media (max-width: 600px) {
  body.has-livechat #arx-back-top {
    right: 84px;
    bottom: 20px;
  }
}

/* ════════════════════════════════════════════════════════
   APP PAGES — INLINE GRID RESPONSIVENESS
   These fix hardcoded grid-template-columns set inline in PHP.
   ════════════════════════════════════════════════════════ */

/* invest.php — two-column main layout */
@media (max-width: 900px) {
  /* target the invest page two-col wrapper */
  .main-content > div[style*="grid-template-columns:1.4fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* fund-requests.php — deposit & withdrawal two-col */
@media (max-width: 900px) {
  .main-content .tab-pane > div[style*="grid-template-columns:1.2fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* fund-requests.php — method-grid 3 cols → 2 → 1 */
@media (max-width: 600px) {
  .method-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 380px) {
  .method-grid { grid-template-columns: 1fr !important; }
}

/* kyc.php — doc-type-grid 3 cols → 2 → 1 */
@media (max-width: 600px) {
  .doc-type-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 380px) {
  .doc-type-grid { grid-template-columns: 1fr !important; }
}

/* kyc.php — submission details 2-col grid */
@media (max-width: 600px) {
  .main-content div[style*="grid-template-columns:1fr 1fr;gap:16px;font-size:.88rem"] {
    grid-template-columns: 1fr !important;
  }
}

/* settings.php — two-col notification/account grid */
@media (max-width: 768px) {
  .main-content > div[style*="grid-template-columns:1fr 1fr;gap:24px"] {
    grid-template-columns: 1fr !important;
  }
}

/* transactions.php — summary-row 3 → 2 → 1 */
@media (max-width: 480px) {
  .summary-row { grid-template-columns: 1fr !important; }
}

/* transactions.php — tabs wrap on very small screens */
@media (max-width: 400px) {
  .tabs { flex-direction: column !important; gap: 4px !important; }
  .tab-btn { width: 100% !important; }
}

/* invest.php — plans-grid already has media query,
   ensure calc-preview stacks on very small screens */
@media (max-width: 400px) {
  .calc-preview { flex-direction: column !important; gap: 12px !important; text-align: center; }
}

/* balance-widget in fund-requests — stack on mobile */
@media (max-width: 560px) {
  .balance-widget { flex-direction: column !important; align-items: flex-start !important; gap: 12px !important; padding: 18px 20px !important; }
  .balance-widget > div:last-child { text-align: left !important; }
}

/* ════════════════════════════════════════════════════════
   PUBLIC PAGES — ADDITIONAL RESPONSIVE COVERAGE
   ════════════════════════════════════════════════════════ */

/* contact.html — missing hamburger nav at 768px */
@media (max-width: 768px) {
  nav .nav-links, nav .nav-cta { display: none; }
  nav .hamburger { display: flex !important; }
  nav .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 68px; left: 0; right: 0;
    background: var(--black);
    border-bottom: 1px solid var(--border);
    padding: 24px 5%;
    gap: 20px;
    z-index: 199;
  }
  nav .nav-cta.open {
    display: flex;
    flex-direction: row;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--black);
    border-top: 1px solid var(--border);
    padding: 14px 5%;
    gap: 12px;
    z-index: 199;
    justify-content: center;
  }
}

/* Hero section — prevent horizontal overflow on all public pages */
.hero { overflow-x: hidden; }
@media (max-width: 600px) {
  .hero { padding: 80px 4% 60px !important; min-height: auto !important; }
  .hero h1 { font-size: clamp(2.2rem, 9vw, 3rem) !important; }
  .hero-cta { flex-direction: column !important; gap: 12px !important; }
  .hero-cta a, .hero-cta button { width: 100% !important; text-align: center !important; justify-content: center !important; }
}
@media (max-width: 380px) {
  .hero { padding: 60px 4% 48px !important; }
  .hero h1 { font-size: 2rem !important; }
}

/* Section content max-width on small screens */
@media (max-width: 600px) {
  .section-sub { font-size: .88rem !important; }
  .section-header { margin-bottom: 32px !important; }
}

/* CTA banners on all public pages */
@media (max-width: 600px) {
  .cta-banner { padding: 48px 24px !important; }
  .cta-banner h2 { font-size: clamp(1.5rem, 6vw, 2rem) !important; }
  .cta-banner .btn-lg { width: 100% !important; text-align: center !important; justify-content: center !important; }
}

/* about.html — team/values grids */
@media (max-width: 480px) {
  .team-grid, .values-grid { grid-template-columns: 1fr !important; }
}

/* affiliate.html & invest.html — stats-row on very small screens */
@media (max-width: 380px) {
  .stats-row { grid-template-columns: 1fr !important; }
}

/* faq.html — accordion padding on small */
@media (max-width: 380px) {
  .faq-q { padding: 14px 16px !important; }
  .faq-a { padding: 0 16px 14px !important; }
}

/* contact.html — contact grid */
@media (max-width: 600px) {
  .contact-grid { grid-template-columns: 1fr !important; }
  .stat-strip { grid-template-columns: 1fr 1fr !important; }
}

/* General: prevent any section from overflowing horizontally */
section, .section, .arx-stats-section, .arx-badges-section {
  overflow-x: hidden;
}

/* Footer responsive polish */
@media (max-width: 480px) {
  footer.public-footer { padding: 40px 4% 24px !important; }
  .footer-grid { gap: 20px !important; }
  .footer-bottom { font-size: .72rem !important; }
}

/* Ticker overflow safety */
.ticker { overflow: hidden !important; }
.ticker-track { flex-shrink: 0; }

/* ════════════════════════════════════════════════════════
   MOBILE HEADER — ensure hidden on desktop for all app pages
   ════════════════════════════════════════════════════════ */
@media (min-width: 901px) {
  .mobile-header { display: none !important; }
}
