/* Automatic Wallet Connect Modal — dark two-panel layout */

#wallet-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#wallet-modal-overlay.is-open {
    display: flex;
}

.wallet-modal {
    position: relative;
    width: 100%;
    max-width: 920px;
    max-height: 90vh;
    background: #1a1d24;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: walletModalIn 0.28s ease-out;
}

@keyframes walletModalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.wallet-modal-inner {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

@media (min-width: 768px) {
    .wallet-modal-inner {
        flex-direction: row;
        min-height: 520px;
    }
}

.wallet-modal-left {
    flex: 1;
    padding: 1.75rem 1.5rem;
    overflow-y: auto;
}

.wallet-modal-right {
    background: #12151a;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 280px;
}

@media (min-width: 768px) {
    .wallet-modal-right {
        width: 42%;
        border-top: none;
        border-left: 1px solid rgba(255, 255, 255, 0.06);
    }
}

.wallet-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}

.wallet-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.wallet-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 0.35rem;
}

.wallet-modal-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 1.25rem;
}

.wallet-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wallet-list-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0.875rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.2s, background 0.2s;
}

.wallet-list-item:hover {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.08);
}

.wallet-list-item.is-connected {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.08);
}

.wallet-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #fff;
}

.wallet-icon-fallback {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff;
    flex-shrink: 0;
}

.wallet-name {
    flex: 1;
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.95rem;
}

.wallet-connect-btn {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.wallet-manual-icon {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    font-size: 1rem;
}

.wallet-manual-link {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.wallet-manual-link:hover {
    background: rgba(99, 102, 241, 0.35);
}

.wallet-connect-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
}

.wallet-connect-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.wallet-connect-btn.is-loading {
    pointer-events: none;
}

.wallet-modal-footer-link {
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: #64748b;
}

.wallet-modal-footer-link a {
    color: #818cf8;
    text-decoration: none;
    font-weight: 600;
}

.wallet-modal-footer-link a:hover {
    text-decoration: underline;
}

.wallet-guide {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.wallet-guide-text {
    flex: 1;
    font-size: 0.8rem;
    color: #94a3b8;
}

.wallet-guide-text strong {
    display: block;
    color: #e2e8f0;
    font-size: 0.85rem;
}

.wallet-guide-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.wallet-wc-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.wallet-wc-logo {
    width: 48px;
    height: 48px;
}

.wallet-wc-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8fafc;
}

#wallet-qr-wrap {
    width: 220px;
    height: 220px;
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#wallet-qr-wrap canvas,
#wallet-qr-wrap img,
#wallet-qr-code img,
#wallet-qr-code canvas,
#wallet-qr-code table {
    max-width: 100%;
    max-height: 100%;
}

#wallet-qr-code {
    width: 196px;
    height: 196px;
}

.wallet-qr-spinner {
    display: none;
    width: 36px;
    height: 36px;
}

.wallet-qr-spinner.is-visible {
    display: block;
}

.wallet-qr-spinner span {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #e2e8f0;
    border-top-color: #3396FF;
    animation: walletQrSpin 0.8s linear infinite;
}

@keyframes walletQrSpin {
    to { transform: rotate(360deg); }
}

.wallet-qr-hint {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    max-width: 240px;
    line-height: 1.45;
}

.wallet-qr-placeholder {
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
}

.wallet-status-bar {
    display: none;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    font-size: 0.8rem;
    color: #86efac;
}

.wallet-status-bar.is-visible {
    display: block;
}

.wallet-status-bar .addr {
    font-family: ui-monospace, monospace;
    color: #bbf7d0;
}

.wallet-error-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: #7f1d1d;
    color: #fecaca;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.875rem;
    max-width: 90vw;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.wallet-error-toast.is-visible {
    display: block;
}
