/**
 * Overrides and additions for dynamic wallet list inside #walletModal,
 * success/error styling for #completeModal, and neutral import messaging.
 */

/* ─── Wallet hub: flex chain so the inner list can shrink and scroll ─── */
#walletModal .modal-container {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 90vh;
}

#walletModal .modal-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#walletModal .unified-layout {
    flex: 1 1 auto;
    min-height: 0;
}

#walletModal .wallet-list-section {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#walletModal .popular-section {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#walletModal #modalWalletListInner.wallet-list,
#walletModal .wallet-list.wallet-list--tax {
    flex: 1 1 0%;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#walletModal .mobile-connection-content {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    #walletModal .modal-container {
        max-height: none;
        height: 100vh;
        height: 100dvh;
    }

    #walletModal .unified-layout {
        min-height: 0;
        flex: 1 1 auto;
        max-height: 100%;
    }

    #walletModal .wallet-list-section {
        min-height: 0;
        flex: 1 1 auto;
        max-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #walletModal .popular-section {
        flex: 0 1 auto;
    }
}

/* ─── Dynamic wallet list (icons from tax wallet data) ─── */
.wallet-list--tax {
    gap: 10px;
}

.wallet-item--tax {
    position: relative;
}

.wallet-item--tax.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
    pointer-events: none;
}

.wallet-icon-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e9e9e9;
    background: #fff;
}

.wallet-icon-img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
}

.wallet-item-meta {
    flex: 1;
    min-width: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wallet-item-label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-item-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    flex-shrink: 0;
    letter-spacing: 0.2px;
}

.wallet-item-tag--pending {
    background: #e8f0fe;
    color: #1967d2;
}

.wallet-item-tag--imported {
    background: #e8f5e9;
    color: #2e7d32;
}

.wallet-list--tax .no-wallets-msg {
    padding: 24px 12px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

/* Dynamic logo rendering inside the connection popup */
.wallet-logo.dynamic-from-tax {
    background-size: cover;
    background-position: center;
    animation: none;
}

.loading-spinner.dynamic-from-tax {
    border: 3px solid rgba(0, 0, 0, 0.1);
}

/* ─── Complete modal: neutral by default, green for success, red reserved for error ─── */
#completeModal .complete-content h2 {
    color: #334155;
}

#completeModal .complete-content.is-success h2,
#completeModal .complete-icon--success + h2 {
    color: #2e7d32;
}

#completeModal .complete-content.is-error h2 {
    color: #ef4444;
}

#completeModal .complete-icon--success svg circle {
    fill: #01d28e;
}

#completeModal .complete-icon--error svg circle {
    fill: #ef4444;
}
