/**
 * BirbPay Wallet Modal Styles
 * Premium multi-wallet selector UI.
 * Light/dark mode aware via CSS variables.
 *
 * @since 2.1.0
 */

/* Overlay */
.bp-wallet-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bp-overlay, rgba(0,0,0,0.5));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
    padding: 16px;
}

.bp-wallet-overlay--visible {
    opacity: 1;
}

/* Modal */
.bp-wallet-modal {
    background: var(--bp-surface-elevated, #fff);
    border: 1px solid var(--bp-border, #e2e8f0);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.03);
    transform: translateY(12px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--bp-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}

.bp-wallet-overlay--visible .bp-wallet-modal {
    transform: translateY(0) scale(1);
}

/* Header */
.bp-wallet-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.bp-wallet-modal__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--bp-text, #0f172a);
    display: flex;
    align-items: center;
    gap: 8px;
}

.bp-wallet-modal__icon {
    font-size: 22px;
}

.bp-wallet-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bp-surface-alt, #f1f5f9);
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    color: var(--bp-text-muted, #94a3b8);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bp-wallet-modal__close:hover {
    background: var(--bp-border, #e2e8f0);
    color: var(--bp-text, #0f172a);
}

.bp-wallet-modal__subtitle {
    font-size: 13px;
    color: var(--bp-text-muted, #94a3b8);
    padding: 6px 24px 16px;
}

/* Wallet List */
.bp-wallet-modal__list {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bp-wallet-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: var(--bp-surface, #f8fafc);
    border: 1px solid var(--bp-border, #e2e8f0);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
    color: var(--bp-text, #0f172a);
}

.bp-wallet-option:hover {
    border-color: var(--bp-accent, #f59e0b);
    background: var(--bp-accent-soft, rgba(245,158,11,0.08));
    box-shadow: 0 0 0 3px var(--bp-accent-soft, rgba(245,158,11,0.08));
}

.bp-wallet-option--loading {
    opacity: 0.7;
    pointer-events: none;
}

.bp-wallet-option__icon {
    font-size: 28px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bp-surface-alt, #f1f5f9);
    border-radius: 12px;
    flex-shrink: 0;
}

.bp-wallet-option__info {
    flex: 1;
    min-width: 0;
}

.bp-wallet-option__name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--bp-text, #0f172a);
}

.bp-wallet-option__desc {
    display: block;
    font-size: 11px;
    color: var(--bp-text-muted, #94a3b8);
    margin-top: 1px;
}

.bp-wallet-option__badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bp-success, #10b981);
    background: var(--bp-success-bg, #ecfdf5);
    padding: 3px 8px;
    border-radius: 8px;
    flex-shrink: 0;
}

.bp-wallet-option__arrow {
    font-size: 16px;
    color: var(--bp-text-muted, #94a3b8);
    flex-shrink: 0;
    transition: transform 0.15s;
}

.bp-wallet-option:hover .bp-wallet-option__arrow {
    transform: translateX(2px);
    color: var(--bp-accent, #f59e0b);
}

/* Hint */
.bp-wallet-modal__hint {
    font-size: 12px;
    color: var(--bp-text-muted, #94a3b8);
    text-align: center;
    padding: 8px;
    margin-bottom: 4px;
}

/* Divider */
.bp-wallet-modal__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    color: var(--bp-text-muted, #94a3b8);
    font-size: 12px;
}

.bp-wallet-modal__divider::before,
.bp-wallet-modal__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--bp-border, #e2e8f0);
}

/* Manual Input */
.bp-wallet-modal__manual {
    padding: 0 24px 16px;
}

.bp-wallet-modal__manual-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--bp-text-secondary, #475569);
    margin-bottom: 6px;
}

.bp-wallet-modal__manual-row {
    display: flex;
    gap: 8px;
}

.bp-wallet-modal__input {
    flex: 1;
    padding: 9px 12px;
    font-size: 13px;
    font-family: var(--bp-font-mono, monospace);
    color: var(--bp-text, #0f172a);
    background: var(--bp-surface, #f8fafc);
    border: 1px solid var(--bp-border, #e2e8f0);
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 0;
}

.bp-wallet-modal__input:focus {
    outline: none;
    border-color: var(--bp-accent, #f59e0b);
    box-shadow: 0 0 0 3px var(--bp-accent-soft, rgba(245,158,11,0.1));
}

.bp-wallet-modal__input--error {
    border-color: var(--bp-danger, #ef4444) !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1) !important;
    animation: bp-shake 0.4s ease;
}

@keyframes bp-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.bp-wallet-modal__manual-btn {
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--bp-accent, #f59e0b);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.bp-wallet-modal__manual-btn:hover {
    opacity: 0.9;
}

/* Footer */
.bp-wallet-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px 16px;
    border-top: 1px solid var(--bp-border, #e2e8f0);
    margin-top: 4px;
}

.bp-wallet-modal__network {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--bp-text-secondary, #475569);
}

.bp-wallet-modal__network-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 6px rgba(59,130,246,0.4);
}

.bp-wallet-modal__powered {
    font-size: 11px;
    color: var(--bp-text-muted, #94a3b8);
}

/* Connected indicator (in the connect button) */
.bp-wallet-connected-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bp-success, #10b981);
    box-shadow: 0 0 6px rgba(16,185,129,0.4);
    margin-right: 2px;
}

/* Mobile */
@media (max-width: 440px) {
    .bp-wallet-modal {
        border-radius: 16px;
        max-width: 100%;
    }
    .bp-wallet-option {
        padding: 10px 12px;
    }
    .bp-wallet-option__icon {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
}
