/* WalletConnect Integration Styles for BitBossWallet */

/* Modal Styles */
.bitbosswallet-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.bitbosswallet-modal.active {
    display: flex;
}

.bitbosswallet-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

/* BuddyBoss Theme Compatibility */
.buddyboss-compatible {
    font-family: var(--bb-body-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);
    color: var(--bb-body-text-color, #4D5C6D);
}

.bitbosswallet-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bitbosswallet-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #000000; /* Black font as requested */
}

.bitbosswallet-modal-close {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.bitbosswallet-modal-close:hover {
    color: #555;
}

.bitbosswallet-modal-body {
    padding: 20px;
    text-align: center;
}

.bitbosswallet-qrcode-container {
    margin: 20px auto;
    width: 250px;
    height: 250px;
    background-color: #f9f9f9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bitbosswallet-qrcode-container canvas {
    max-width: 100%;
    max-height: 100%;
}

.bitbosswallet-modal-body p {
    margin: 15px 0;
    color: #0000FF; /* Blue font as requested */
}

/* Wallet Selection Styles */
.bitbosswallet-wallet-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.bitbosswallet-wallet-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
}

.bitbosswallet-wallet-option:hover {
    border-color: #0000FF;
    background-color: #f5f8ff;
}

.bitbosswallet-wallet-option.active {
    border-color: #0000FF;
    background-color: #f0f5ff;
}

.bitbosswallet-wallet-icon {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    object-fit: contain;
}

.bitbosswallet-wallet-name {
    font-weight: 500;
    color: #000000; /* Black font as requested */
}

.bitbosswallet-wallet-description {
    font-size: 12px;
    color: #0000FF; /* Blue font as requested */
    margin-top: 4px;
}

/* Wallet Connect Button */
.bitbosswallet-connect-button {
    display: inline-block;
    background-color: #0000FF;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 15px;
}

.bitbosswallet-connect-button:hover {
    background-color: #0000CC;
}

.bitbosswallet-connect-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Method Switcher */
.bitbosswallet-method-switcher {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    border-radius: 6px;
    border: 1px solid #eee;
    overflow: hidden;
}

.bitbosswallet-method-option {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    background-color: #f9f9f9;
    transition: all 0.2s ease;
    color: #000000; /* Black font as requested */
}

.bitbosswallet-method-option.active {
    background-color: #0000FF;
    color: #fff;
}

.bitbosswallet-method-option:hover:not(.active) {
    background-color: #f0f0f0;
}

/* Loading Indicator */
.bitbosswallet-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 255, 0.3);
    border-radius: 50%;
    border-top-color: #0000FF;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .bitbosswallet-modal-content {
        width: 95%;
    }
    
    .bitbosswallet-qrcode-container {
        width: 200px;
        height: 200px;
    }
}

/* BuddyBoss Theme Specific Overrides */
body.buddyboss-theme .bitbosswallet-modal-content {
    border-radius: var(--bb-block-radius, 4px);
}

body.buddyboss-theme .bitbosswallet-connect-button {
    border-radius: var(--bb-button-radius, 4px);
}

body.buddyboss-theme .bitbosswallet-wallet-option {
    border-radius: var(--bb-block-radius, 4px);
}

/* WalletConnect built-in modal tweaks (v2) */
/* Reduce overall modal width and QR size for better ergonomics */
[class*="wcm-modal"],
[class^="wcm-modal"] {
    max-width: 300px !important;
    width: 92% !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    border-radius: 12px !important;
}

[class*="wcm-overlay"],
[class^="wcm-overlay"] {
    background: rgba(0,0,0,.6) !important;
    position: fixed !important;
    inset: 0 !important;
    overflow: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* QR container/image in v2 */
[class*="wcm-qrcode"],
[class^="wcm-qrcode"] {
    width: 200px !important;
    height: 200px !important;
    margin: 0 auto !important;
}

[class*="wcm-qrcode"] img,
[class*="wcm-qrcode"] canvas,
[class^="wcm-qrcode"] img,
[class^="wcm-qrcode"] canvas {
    width: 200px !important;
    height: 200px !important;
}

@media (max-width: 480px) {
    [class*="wcm-qrcode"],
    [class^="wcm-qrcode"] {
        width: 180px !important;
        height: 180px !important;
    }
    [class*="wcm-qrcode"] img,
    [class*="wcm-qrcode"] canvas,
    [class^="wcm-qrcode"] img,
    [class^="wcm-qrcode"] canvas {
        width: 180px !important;
        height: 180px !important;
    }
}

/* WalletConnect v1 qrcode modal tweaks */
.walletconnect-qrcode-modal__base {
    max-width: 300px !important;
    width: 92% !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    border-radius: 12px !important;
    margin: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
}

.walletconnect-qrcode-modal__backdrop {
    background: rgba(0,0,0,.6) !important;
    position: fixed !important;
    inset: 0 !important;
    overflow: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.walletconnect-qrcode-modal__qr {
    width: 200px !important;
    height: 200px !important;
    margin: 0 auto !important;
}
.walletconnect-modal__base{
    max-width: 300px !important;
}
@media (max-width: 480px) {
    .walletconnect-qrcode-modal__qr {
        width: 180px !important;
        height: 180px !important;
    }
}

/* Prevent background scroll while WC modal is open */
body.walletconnect-open {
    overflow: hidden !important;
    background-color: #ffffff;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 100vh;
}

/* Safeguard: if walletconnect-open class persists due to JS error,
   allow user to recover by removing the class after a timeout */
body.walletconnect-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: -1;
    pointer-events: none;
}
