/* Hyperliquid Local Overrides CSS */

/* Completely disable and hide all Privy components, modals, and overlays */
[id*="privy"],
[class*="privy"],
iframe[src*="privy"],
div[data-privy-modal],
div.privy-modal-backdrop,
iframe[src*="auth.privy.io"],
[data-privy],
.privy-modal,
.privy-backdrop,
[class*="Privy"],
/* WalletConnect modal */
iframe[src*="walletconnect"],
[class*="walletconnect"],
/* Coinbase Wallet */
iframe[src*="coinbase"],
[class*="coinbase-wallet"],
/* OKX Wallet */
iframe[src*="okx"],
[class*="okx-wallet"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
}

/* Hide statuspage iframe */
iframe[title="Hyperliquid Status"] {
  display: none !important;
}

#mobile-drawer-content {
  display: none !important;
}

/* CRITICAL: Never show an empty, orphaned, or non-modal backdrop overlay!
   If sc-cwSeag has no visible modal, it must NEVER darken the screen or intercept clicks! */
div.sc-cwSeag:empty,
div.sc-cwSeag:not(:has(div.sc-iveFHk.modal)),
div[class*="cwSeag"]:empty,
div[class*="cwSeag"]:not(:has(div.modal)) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Surgically hide ONLY the factory Connect modal and its overlay backdrop.
   All trading modals (Cross, Leverage, Margin Mode, Unified, TP/SL) stay fully visible! */
div.sc-iveFHk.modal:has(img[src*="walletconnect"]),
div.sc-iveFHk.modal:has(img[src*="coinbase"]),
div.sc-iveFHk.modal:has(img[src*="okx"]),
div.sc-cwSeag:has(img[src*="walletconnect"]),
div.sc-cwSeag:has(img[src*="coinbase"]),
div.sc-cwSeag:has(img[src*="okx"]),
div.sc-cwSeag:has(button[color="dark-gray"].sc-ftTHYK.ihUCJn),
/* Additional modal selectors */
div[class*="iveFHk"]:has(img[src*="walletconnect"]),
div[class*="iveFHk"]:has(img[src*="coinbase"]),
/* Hide any modal containing wallet logos */
div.modal:has(img[alt*="wallet"]),
div.modal:has(img[src*="metamask"]) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Hide full-screen overlays that might block the page after modal close */
body > div[class*="overlay"][style*="z-index"],
body > div[class*="backdrop"][style*="z-index"] {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Ensure the page is always clickable */
body {
  pointer-events: auto !important;
}

/* Fix for spinner/loading screen colors - ensure green for online state */
[class*="spinner"][style*="gray"],
[class*="loading"][style*="gray"] {
  color: rgb(10, 153, 129) !important;
  background: rgba(10, 153, 129, 0.2) !important;
}
