/**
 * Hide AppKit Modal Footer Branding
 * Ẩn phần "UX by reown" ở footer popup wallet
 */

/* Ẩn footer branding của AppKit */
w3m-modal w3m-footer,
w3m-modal [data-testid="w3m-footer"],
w3m-modal .w3m-footer,
appkit-modal appkit-footer,
appkit-modal [data-testid="appkit-footer"],
appkit-modal .appkit-footer {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Ẩn các element có text "UX by" hoặc "reown" */
w3m-modal *:has-text("UX by"),
w3m-modal *:has-text("reown"),
appkit-modal *:has-text("UX by"),
appkit-modal *:has-text("reown") {
  display: none !important;
}

/* Ẩn footer container */
w3m-modal .w3m-modal__footer,
w3m-modal .w3m-footer-container,
appkit-modal .appkit-modal__footer,
appkit-modal .appkit-footer-container {
  display: none !important;
}

/* Ẩn powered by text */
w3m-modal [class*="powered"],
w3m-modal [class*="footer"],
w3m-modal [class*="branding"],
appkit-modal [class*="powered"],
appkit-modal [class*="footer"],
appkit-modal [class*="branding"] {
  display: none !important;
}

/* Specific selectors cho AppKit v2 */
[data-w3m-modal] [class*="footer"],
[data-appkit-modal] [class*="footer"],
.w3m-modal [class*="footer"],
.appkit-modal [class*="footer"] {
  display: none !important;
}

/* Ẩn bất kỳ element nào chứa "UX by" */
*:contains("UX by") {
  display: none !important;
}

/* Ẩn footer với CSS selector mạnh hơn */
w3m-modal::part(footer),
appkit-modal::part(footer) {
  display: none !important;
}

/* Adjust modal height để bù cho footer bị ẩn */
w3m-modal,
appkit-modal {
  padding-bottom: 0 !important;
}

w3m-modal .w3m-modal__content,
appkit-modal .appkit-modal__content {
  padding-bottom: 20px !important;
} 
/* Font loading optimization - prevent layout shift */
/* Using Google Fonts CDN with display=swap for synchronous loading */

/* CSS Reset to prevent layout shift */
html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  /* Enable scrolling */
  overflow-x: auto;
  overflow-y: auto;
}

/* Prevent layout shift with consistent font metrics */
* {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

body {
  margin: 0;
  padding: 0;
  /* Use system fonts with same metrics as Inter to prevent layout shift */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #15191B;
  color: #FFFFFF;
  /* Prevent layout shift during font loading */
  font-display: swap;
  /* Ensure consistent text rendering */
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1;
  /* Force font loading to prevent shift */
  font-synthesis: none;
  /* Use system font fallback with same metrics */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  /* Remove overly restrictive containment to allow scrolling */
  contain: style;
  /* Force consistent font rendering */
  -webkit-font-feature-settings: 'kern' 1, 'liga' 1;
  -moz-font-feature-settings: 'kern' 1, 'liga' 1;
  /* Enable scrolling */
  overflow-x: auto;
  overflow-y: auto;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}

* {
  box-sizing: border-box;
}

/* Font consistency classes to prevent layout shift */
.font-consistent {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif !important;
  font-display: swap !important;
  text-rendering: optimizeLegibility !important;
  font-feature-settings: 'kern' 1, 'liga' 1 !important;
}

.font-loaded {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif !important;
}

.no-layout-shift {
  contain: layout style !important;
  will-change: auto !important;
}

/* Import AppKit footer hiding styles */ 
