/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-main: #0B0E11; /* Trust Wallet Official dark background */
    --bg-surface: #1E2329; /* Card surface */
    --bg-input: #181A20; /* Input container surface */
    --color-text: #EAECEF; /* Primary readable text */
    --color-muted: #848E9C; /* Subtitles and metadata labels */
    --color-placeholder: #474D57;
    --color-green-primary: #02C076; /* Official Trust Wallet vibrant green */
    --color-green-border: #02C076;
    --color-green-btn: #02C076;
    --color-border-default: #2B3139;
    
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Outfit', sans-serif;

    /* Premium transition curves */
    --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Consistent glow sizes */
    --glow-sm: 0 0 8px 0;
    --glow-md: 0 0 16px 2px;
    --glow-lg: 0 0 28px 4px;

    /* Glassmorphism tokens */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
}

/* Trust Wallet (default) */
body.theme-trust {
    --bg-main: #0B0E11;
    --bg-surface: #1E2329;
    --bg-input: #181A20;
    --color-text: #EAECEF;
    --color-muted: #848E9C;
    --color-placeholder: #474D57;
    --color-green-primary: #02C076;
    --color-green-border: #02C076;
    --color-green-btn: #02C076;
    --color-border-default: #2B3139;
}

/* MetaMask Theme */
body.theme-metamask {
    --bg-main: #141618;
    --bg-surface: #202226;
    --bg-input: #1b1c20;
    --color-text: #F2F4F7;
    --color-muted: #9ba3af;
    --color-placeholder: #4b5563;
    --color-green-primary: #E2761B;
    --color-green-border: #E2761B;
    --color-green-btn: #E2761B;
    --color-border-default: #2f343c;
}

/* Phantom Theme */
body.theme-phantom {
    --bg-main: #1A192A;
    --bg-surface: #25243d;
    --bg-input: #1f1e33;
    --color-text: #F3F2F9;
    --color-muted: #9CA3AF;
    --color-placeholder: #4b5563;
    --color-green-primary: #5F3FEB;
    --color-green-border: #5F3FEB;
    --color-green-btn: #5F3FEB;
    --color-border-default: #312e52;
}

/* Coinbase Wallet Theme */
body.theme-coinbase {
    --bg-main: #050505;
    --bg-surface: #141414;
    --bg-input: #0e0e0e;
    --color-text: #FFFFFF;
    --color-muted: #8A92A6;
    --color-placeholder: #4b5563;
    --color-green-primary: #0052FF;
    --color-green-border: #0052FF;
    --color-green-btn: #0052FF;
    --color-border-default: #242424;
}

/* SafePal Theme */
body.theme-safepal {
    --bg-main: #0E1118;
    --bg-surface: #1B1E2D;
    --bg-input: #131522;
    --color-text: #F0F3FA;
    --color-muted: #8A92A6;
    --color-placeholder: #404859;
    --color-green-primary: #F3BA2F;
    --color-green-border: #F3BA2F;
    --color-green-btn: #F3BA2F;
    --color-border-default: #272c3d;
}

/* OKX Wallet Theme */
body.theme-okx {
    --bg-main: #000000;
    --bg-surface: #141414;
    --bg-input: #0a0a0a;
    --color-text: #FFFFFF;
    --color-muted: #999999;
    --color-placeholder: #333333;
    --color-green-primary: #00FF5F;
    --color-green-border: #00FF5F;
    --color-green-btn: #00FF5F;
    --color-border-default: #222222;
}

/* Rainbow Theme */
body.theme-rainbow {
    --bg-main: #0D0E15;
    --bg-surface: #1D1E2D;
    --bg-input: #141522;
    --color-text: #F3F4F6;
    --color-muted: #9CA3AF;
    --color-placeholder: #4b5563;
    --color-green-primary: #FF4081;
    --color-green-border: #FF4081;
    --color-green-btn: #FF4081;
    --color-border-default: #2b2d3d;
}

/* Uniswap Theme */
body.theme-uniswap {
    --bg-main: #13131A;
    --bg-surface: #1E1E2D;
    --bg-input: #161622;
    --color-text: #FFFFFF;
    --color-muted: #9E9EAE;
    --color-placeholder: #4b5563;
    --color-green-primary: #FF007A;
    --color-green-border: #FF007A;
    --color-green-btn: #FF007A;
    --color-border-default: #2b2b3d;
}

/* Rabby Wallet Theme */
body.theme-rabby {
    --bg-main: #191B24;
    --bg-surface: #252834;
    --bg-input: #1D202A;
    --color-text: #FFFFFF;
    --color-muted: #8E9BAE;
    --color-placeholder: #464B5D;
    --color-green-primary: #7084FF;
    --color-green-border: #7084FF;
    --color-green-btn: #7084FF;
    --color-border-default: #2E3244;
}

body {
    background-color: #050708;
    color: var(--color-text);
    font-family: var(--font-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Device Mockup Wrapper for Large Screens */
.app-container {
    background-color: var(--bg-main);
    width: 100%;
    max-width: 420px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
    border: 1px solid #1e2329;
}

@media (min-width: 480px) {
    .app-container {
        height: 844px;
        border-radius: 36px;
        overflow: hidden;
        /* Enhanced border with subtle gradient via border-image */
        border: 6px solid #2b3139;
        /* Premium ambient glow behind the container on desktop */
        box-shadow:
            0 25px 60px -15px rgba(0, 0, 0, 0.8),
            0 0 80px -20px rgba(var(--color-green-primary), 0.06),
            0 0 120px 0 rgba(2, 192, 118, 0.03);
    }
}

/* App Header Navigation */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px 14px;
    z-index: 10;
    border-bottom: 1px solid rgba(43, 49, 57, 0.3);
}

.back-btn {
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.back-btn svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease;
}

.back-btn:hover svg {
    transform: translateX(-2px);
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-grow: 1;
}

.header-wallet-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 6px;
}

.header-title {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: #F0F2F5;
}

.header-spacer {
    width: 38px;
}

/* Main Content Area */
.form-content {
    flex: 1;
    padding: 20px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow-y: auto;
}

/* Form Grouping and Labels */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-muted);
    letter-spacing: 0.1px;
    text-transform: uppercase;
}

/* Custom Input Field Wrapper */
.input-wrapper {
    background-color: var(--bg-input);
    border: 1.5px solid var(--color-border-default);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    transition: border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-wrapper input {
    background: none;
    border: none;
    outline: none;
    color: var(--color-text);
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 500;
    flex: 1;
    width: 100%;
}

.input-wrapper input::placeholder {
    color: var(--color-placeholder);
    font-weight: 400;
}

/* Interactive Border Glow FX */
.focus-within-glow:focus-within {
    border-color: #5E6673;
    box-shadow: inset 0 1px 4px rgba(255, 255, 255, 0.02);
    transition: border-color 0.35s var(--transition-smooth), box-shadow 0.35s var(--transition-smooth);
}

.active-border {
    border-color: var(--color-green-border) !important;
    box-shadow:
        0 0 0 1px var(--color-green-border),
        var(--glow-sm) rgba(2, 192, 118, 0.15),
        var(--glow-md) rgba(2, 192, 118, 0.06);
    animation: activeBorderGlow 2s ease-in-out infinite;
    transition: border-color 0.35s var(--transition-smooth), box-shadow 0.35s var(--transition-smooth);
}

.error-border {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444, var(--glow-sm) rgba(239, 68, 68, 0.12) !important;
}

/* Input Actions Wrapper */
.input-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* Action Buttons Inside Inputs */
.action-text-btn {
    background: none;
    border: none;
    color: var(--color-green-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px;
    transition: filter 0.2s ease, transform 0.1s ease;
}

.action-text-btn:hover {
    filter: brightness(1.2);
}

.action-text-btn:active {
    transform: scale(0.95);
}

.action-icon-btn {
    background: none;
    border: none;
    color: var(--color-green-primary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.2s ease, transform 0.1s ease;
}

.action-icon-btn:hover {
    filter: brightness(1.2);
}

.action-icon-btn:active {
    transform: scale(0.95);
}

.action-icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Destination Network Dropdown Badge */
.dropdown-trigger {
    cursor: pointer;
    align-self: flex-start;
}

.dropdown-badge {
    background-color: var(--bg-surface);
    border-radius: 9999px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--color-border-default);
    transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
    user-select: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dropdown-badge:hover {
    background-color: #2B3139;
    border-color: #474D57;
}

.bnb-logo {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bnb-logo svg {
    width: 100%;
    height: 100%;
}

.network-name {
    font-size: 13px;
    font-weight: 600;
    color: #EAECEF;
    letter-spacing: 0.2px;
}

.chevron-down {
    width: 14px;
    height: 14px;
    color: var(--color-muted);
}

/* Amount Input Specifics */
.amount-group {
    margin-top: 4px;
}

.amount-wrapper {
    padding: 16px 16px;
}

.amount-wrapper input {
    font-size: 20px;
    font-weight: 700;
    width: calc(100% - 2px);
    letter-spacing: -0.2px;
}

.input-container {
    display: flex;
    align-items: center;
    flex: 1;
    position: relative;
}

/* Custom blinking cursor for active feel */
.blinking-cursor {
    width: 2.5px;
    height: 24px;
    background-color: var(--color-green-primary);
    position: absolute;
    left: 14px;
    display: none;
    animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
    to { visibility: hidden; }
}

.clear-btn {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.clear-btn.visible {
    opacity: 1;
    visibility: visible;
}

.unit-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-muted);
    user-select: none;
    margin: 0 4px;
}

.input-token-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 50%;
}

.conversion-subtext {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-muted);
    padding: 6px 4px;
    letter-spacing: -0.1px;
}

.subscript {
    font-size: 10px;
    vertical-align: sub;
    margin-left: -1px;
    margin-right: -1px;
    font-weight: 600;
}

/* App Footer / CTA Button Position */
.app-footer {
    padding: 16px 20px 28px;
    background-color: var(--bg-main);
    z-index: 10;
    border-top: 1px solid rgba(43, 49, 57, 0.3);
}

.cta-btn {
    width: 100%;
    border: none;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 600;
    padding: 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.25s var(--transition-smooth), transform 0.15s var(--transition-smooth), box-shadow 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.1px;
    box-shadow: 0 8px 20px rgba(2, 192, 118, 0.2);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Ripple effect on click via ::after pseudo-element */
.cta-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255, 255, 255, 0.25), transparent 60%);
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
    z-index: 1;
}

.cta-btn:active::after {
    animation: ripple 0.5s var(--transition-smooth) forwards;
}

.cta-btn:active {
    transform: scale(0.97);
}

.primary-btn {
    background-color: var(--color-green-btn);
    color: #052E16;
    /* Subtle shimmer gradient overlay */
    background-image: linear-gradient(
        110deg,
        transparent 25%,
        rgba(255, 255, 255, 0.12) 37%,
        transparent 50%
    );
    background-size: 250% 100%;
    background-position: 100% 0;
    animation: shimmer 4s ease-in-out infinite;
}

.primary-btn:hover {
    background-color: #03D382;
    box-shadow: 0 10px 24px rgba(2, 192, 118, 0.35), var(--glow-md) rgba(2, 192, 118, 0.1);
}

.primary-btn:disabled {
    background-color: #1E2329;
    color: #474D57;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    /* Subtle pulse so disabled isn't flat/dead */
    background-image: none;
    animation: pulseGlow 3s ease-in-out infinite;
}

/* Dynamic Overlays & Modals */
.overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Frosted glassmorphism background */
    background-color: rgba(11, 14, 17, 0.82);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.35s var(--transition-smooth), visibility 0.35s var(--transition-smooth);
}

.overlay-container.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Spinner — Premium dual-ring orbital */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(2, 192, 118, 0.1);
    border-top: 4px solid var(--color-green-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    position: relative;
    /* Pulsing glow behind the spinner */
    box-shadow: var(--glow-md) rgba(2, 192, 118, 0.12);
    filter: drop-shadow(0 0 6px rgba(2, 192, 118, 0.18));
}

/* Secondary orbital ring via pseudo-element */
.loading-spinner::after {
    content: '';
    position: absolute;
    inset: -8px;
    border: 2px solid transparent;
    border-top: 2px solid rgba(2, 192, 118, 0.35);
    border-bottom: 2px solid rgba(2, 192, 118, 0.1);
    border-radius: 50%;
    animation: orbitSpin 2.5s linear infinite reverse;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
}

/* Modal Card styling */
.modal-card, .result-card {
    background-color: #181A20;
    border: 1px solid var(--color-border-default);
    border-radius: 24px;
    width: 100%;
    max-width: 360px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(12px);
    opacity: 0;
    transition: transform 0.4s var(--transition-bounce), opacity 0.35s var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

/* Animated gradient border accent via ::before pseudo-element */
.modal-card::before, .result-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(2, 192, 118, 0.2),
        transparent 40%,
        transparent 60%,
        rgba(2, 192, 118, 0.1)
    );
    background-size: 300% 300%;
    animation: gradientBorder 6s ease infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Smooth scale + fade entrance animation */
.overlay-container:not(.hide) .modal-card,
.overlay-container:not(.hide) .result-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-header h2, .result-card h2 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    color: #F0F2F5;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.confirm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(43, 49, 57, 0.3);
}

.confirm-item:last-child {
    border-bottom: none;
}

.confirm-label {
    font-size: 13px;
    color: var(--color-muted);
}

.confirm-val {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.confirm-token-logo {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: contain;
}

.result-token-logo {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 4px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    border: none;
    padding: 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.modal-btn:active {
    transform: scale(0.97);
}

.cancel-btn {
    background-color: transparent;
    border: 1.5px solid var(--color-border-default);
    color: var(--color-text);
}

.cancel-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.ok-btn {
    background-color: var(--color-green-btn);
    color: #052E16;
}

.ok-btn:hover {
    background-color: #03D382;
}

/* Result Icons & Animations */
.result-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.result-icon-svg {
    width: 64px;
    height: 64px;
}

.result-title {
    text-align: center;
    margin-bottom: 4px;
}

.result-amount {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: #F0F2F5;
    margin-bottom: 12px;
}

.result-hash-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background-color: #0B0E11;
    padding: 12px;
    border-radius: 12px;
}

.result-hash-link {
    color: var(--color-green-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.result-hash-link:hover {
    text-decoration: underline;
}

.result-error-container {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 12px;
    border-radius: 12px;
}

.result-error-text {
    color: #EF4444;
    font-size: 13px;
    text-align: center;
    line-height: 1.4;
}

.hide {
    display: none !important;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translate(-50%, 50px) scale(0.92);
    background-color: #1E2329;
    border: 1px solid var(--color-border-default);
    padding: 12px 20px;
    border-radius: 16px;
    z-index: 200;
    max-width: 90%;
    width: max-content;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
    /* Spring-physics entrance with bounce easing */
    transition: transform 0.45s var(--transition-bounce), opacity 0.3s var(--transition-smooth), visibility 0.3s var(--transition-smooth);
    pointer-events: none;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Auto-dismiss progress bar indicator at the bottom */
.toast-notification::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: var(--color-green-primary);
    transform-origin: left;
    transform: scaleX(1);
    opacity: 0;
    transition: none;
}

.toast-notification.show::after {
    opacity: 0.6;
    transform: scaleX(0);
    transition: transform 3.5s linear;
}

.toast-notification.show {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
    visibility: visible;
}

.toast-notification.success {
    border-left: 3px solid var(--color-green-primary);
}
.toast-notification.success::after {
    background: var(--color-green-primary);
}

.toast-notification.error {
    border-left: 3px solid #EF4444;
}
.toast-notification.error::after {
    background: #EF4444;
}

.toast-notification.info {
    border-left: 3px solid #3B82F6;
}
.toast-notification.info::after {
    background: #3B82F6;
}

/* Icon area styling for toast prefixes */
.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
}

.toast-message {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-primary);
}

/* ── MetaMask Specific Styles ── */
.theme-metamask .app-header {
    border-bottom: 1px solid var(--color-border-default);
    padding: 18px 20px;
}
.theme-metamask .cancel-text-btn {
    background: none;
    border: none;
    color: var(--color-green-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}
.theme-metamask .mm-asset-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-surface);
    border: 1px solid var(--color-border-default);
    padding: 14px 16px;
    border-radius: 12px;
}
.theme-metamask .mm-asset-selector {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.theme-metamask .mm-asset-selector .balance-text {
    font-size: 13px;
    color: var(--color-muted);
}
.theme-metamask .mm-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    text-transform: none;
    letter-spacing: 0;
}
.theme-metamask .mm-input-wrapper {
    border-radius: 8px;
    border-color: var(--color-border-default);
}
.theme-metamask .mm-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--color-border-default);
}
.theme-metamask .mm-btn-cancel {
    flex: 1;
    background-color: transparent;
    border: 1.5px solid var(--color-green-primary);
    color: var(--color-green-primary);
    border-radius: 9999px;
    height: 48px;
    font-weight: 600;
    cursor: pointer;
}
.theme-metamask .mm-btn-next {
    flex: 1;
    border-radius: 9999px;
    height: 48px;
}

/* ── Phantom Specific Styles ── */
.theme-phantom .ph-label {
    text-transform: none;
    font-size: 14px;
    font-weight: 600;
}
.theme-phantom .ph-input-wrapper {
    border-radius: 12px;
    border-color: var(--color-border-default);
}
.theme-phantom .ph-amount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.theme-phantom .ph-balance {
    font-size: 13px;
    color: var(--color-muted);
}
.theme-phantom .ph-unit {
    font-weight: 600;
}
.theme-phantom .ph-btn-next {
    border-radius: 12px;
    height: 50px;
    font-weight: 600;
}

/* ── Coinbase Specific Styles ── */
.theme-coinbase .cb-label {
    text-transform: none;
    font-size: 14px;
    font-weight: 600;
}
.theme-coinbase .cb-input-wrapper {
    border-radius: 8px;
    border-color: var(--color-border-default);
}
.theme-coinbase .cb-amount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.theme-coinbase .cb-balance {
    font-size: 13px;
    color: var(--color-muted);
}
.theme-coinbase .cb-btn-next {
    border-radius: 8px;
    height: 48px;
    font-weight: 600;
}

/* ── SafePal Specific Styles ── */
.theme-safepal .sp-label {
    text-transform: none;
    font-size: 14px;
    font-weight: 600;
}
.theme-safepal .sp-input-wrapper {
    border-radius: 10px;
    border-color: var(--color-border-default);
}
.theme-safepal .sp-amount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.theme-safepal .sp-balance {
    font-size: 13px;
    color: var(--color-muted);
}
.theme-safepal .sp-btn-next {
    border-radius: 10px;
    height: 48px;
    font-weight: 600;
}

/* ── OKX Specific Styles ── */
.theme-okx .ok-label {
    text-transform: none;
    font-size: 14px;
    font-weight: 600;
}
.theme-okx .ok-input-wrapper {
    border-radius: 8px;
    border-color: var(--color-border-default);
}
.theme-okx .ok-amount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.theme-okx .ok-balance {
    font-size: 13px;
    color: var(--color-muted);
}
.theme-okx .ok-btn-next {
    border-radius: 8px;
    height: 48px;
    font-weight: 600;
}

/* ── Rainbow Specific Styles ── */
.theme-rainbow .rb-label {
    text-transform: none;
    font-size: 14px;
    font-weight: 600;
}
.theme-rainbow .rb-input-wrapper {
    border-radius: 14px;
    border-color: var(--color-border-default);
}
.theme-rainbow .rb-amount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.theme-rainbow .rb-balance {
    font-size: 13px;
    color: var(--color-muted);
}
.theme-rainbow .rb-btn-next {
    border-radius: 9999px;
    height: 52px;
    font-weight: 700;
}

/* ── Uniswap Specific Styles ── */
.theme-uniswap .un-label {
    text-transform: none;
    font-size: 14px;
    font-weight: 600;
}
.theme-uniswap .un-input-wrapper {
    border-radius: 16px;
    border-color: var(--color-border-default);
}
.theme-uniswap .un-amount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.theme-uniswap .un-balance {
    font-size: 13px;
    color: var(--color-muted);
}
.theme-uniswap .un-btn-next {
    border-radius: 16px;
    height: 50px;
    font-weight: 600;
}

/* ── Rabby Specific Styles ── */
.theme-rabby .ry-label {
    text-transform: none;
    font-size: 14px;
    font-weight: 600;
}
.theme-rabby .ry-input-wrapper {
    border-radius: 8px;
    border-color: var(--color-border-default);
}
.theme-rabby .ry-amount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.theme-rabby .ry-balance {
    font-size: 13px;
    color: var(--color-muted);
}
.theme-rabby .ry-btn-next {
    border-radius: 8px;
    height: 48px;
    font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════
   PREMIUM KEYFRAME ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

/* Active border breathing glow */
@keyframes activeBorderGlow {
    0%, 100% {
        box-shadow:
            0 0 0 1px var(--color-green-border),
            var(--glow-sm) rgba(2, 192, 118, 0.15),
            var(--glow-md) rgba(2, 192, 118, 0.06);
    }
    50% {
        box-shadow:
            0 0 0 1px var(--color-green-border),
            var(--glow-sm) rgba(2, 192, 118, 0.25),
            var(--glow-lg) rgba(2, 192, 118, 0.1);
    }
}

/* Button shimmer sweep */
@keyframes shimmer {
    0% { background-position: 100% 0; }
    40% { background-position: -100% 0; }
    100% { background-position: -100% 0; }
}

/* Modal animated gradient border */
@keyframes gradientBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Staggered content entrance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subtle pulsing glow for disabled states */
@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.6;
        box-shadow: none;
    }
    50% {
        opacity: 0.72;
        box-shadow: 0 0 12px rgba(255, 255, 255, 0.02);
    }
}

/* Button click ripple */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.4;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Dual-ring orbital spinner (secondary ring) */
@keyframes orbitSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Confetti burst for success states */
@keyframes confettiBurst {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-120px) rotate(720deg) scale(0);
        opacity: 0;
    }
}

/* Animated number reveal / count up */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}


/* ═══════════════════════════════════════════════════════════
   SKELETON LOADING STATES
   ═══════════════════════════════════════════════════════════ */

@keyframes skeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Base skeleton class with animated shimmer */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-input) 25%,
        rgba(255, 255, 255, 0.06) 37%,
        var(--bg-input) 63%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.8s ease-in-out infinite;
    border-radius: 8px;
    pointer-events: none;
    user-select: none;
}

/* Text placeholder skeleton — single line */
.skeleton-text {
    height: 14px;
    width: 100%;
    border-radius: 6px;
    margin-bottom: 8px;
}
.skeleton-text:last-child {
    width: 65%;
}

/* Circle skeleton — avatars, icons */
.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Rectangle skeleton — cards, images */
.skeleton-rect {
    width: 100%;
    height: 56px;
    border-radius: 14px;
}


/* ═══════════════════════════════════════════════════════════
   UTILITY: FADE-IN-UP ENTRANCE FOR STAGGERED CONTENT
   ═══════════════════════════════════════════════════════════ */

.animate-fadeInUp {
    animation: fadeInUp 0.5s var(--transition-smooth) both;
}
.animate-fadeInUp:nth-child(2) { animation-delay: 0.06s; }
.animate-fadeInUp:nth-child(3) { animation-delay: 0.12s; }
.animate-fadeInUp:nth-child(4) { animation-delay: 0.18s; }
.animate-fadeInUp:nth-child(5) { animation-delay: 0.24s; }

/* Utility: count-up number animation */
.animate-countUp {
    animation: countUp 0.6s var(--transition-smooth) both;
}

/* Utility: confetti particle (apply via JS to spawned elements) */
.confetti-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 1px;
    animation: confettiBurst 1s var(--transition-smooth) forwards;
    pointer-events: none;
}
