/* ============================================================================
   WALLET CONNECTOR — DEGEN X
   Axiom-style Exchange modal: Convert / Deposit / Buy
   ============================================================================ */

/* ============================================================================
   DEPOSIT BUTTON — CONNECTED STATE
   ============================================================================ */
.hdr-deposit.connected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: rgba(0,255,65,0.08);
    border: 1px solid rgba(0,255,65,0.25);
}
.hdr-deposit.connected:hover {
    background: rgba(0,255,65,0.14);
    border-color: rgba(0,255,65,0.45);
}
.wallet-status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #00ff41;
    box-shadow: 0 0 8px rgba(0,255,65,0.6);
    animation: wsd-pulse 2s ease-in-out infinite;
}
@keyframes wsd-pulse {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:0.5; transform:scale(1.3); }
}

/* ============================================================================
   MODAL OVERLAY
   ============================================================================ */
.wallet-modal {
    position: fixed; inset: 0;
    z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}
.wallet-modal.active { opacity: 1; visibility: visible; }

.wallet-modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ============================================================================
   MODAL CONTENT SHELL
   ============================================================================ */
.wallet-modal-content {
    position: relative; z-index: 1;
    background: #1a1a22;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    width: 90%; max-width: 420px;
    max-height: 85vh; overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.04) inset;
    animation: exm-slide .22s ease;
}
@keyframes exm-slide {
    from { transform: translateY(-16px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* scrollbar */
.wallet-modal-content::-webkit-scrollbar { width: 5px; }
.wallet-modal-content::-webkit-scrollbar-track { background: transparent; }
.wallet-modal-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* ============================================================================
   EXCHANGE MODAL — HEADER
   ============================================================================ */
.exm-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.25rem 0;
}
.exm-title {
    font-size: 1.25rem; font-weight: 700; color: #fff;
    letter-spacing: -0.01em;
}
.exm-close {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: rgba(255,255,255,0.5);
    transition: all .15s;
}
.exm-close:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* ============================================================================
   TABS — Axiom style
   ============================================================================ */
.exm-tabs {
    display: flex; gap: 0;
    margin: 1rem 1.25rem 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 3px;
}
.exm-tab {
    flex: 1;
    padding: 0.55rem 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255,255,255,0.45);
    font-size: 0.9rem; font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}
.exm-tab:hover { color: rgba(255,255,255,0.75); }
.exm-tab.active {
    background: #2c2c38;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ============================================================================
   BODY AREA
   ============================================================================ */
.exm-body {
    padding: 1.1rem 1.25rem 1.25rem;
    display: flex; flex-direction: column; gap: 0.75rem;
}

/* ============================================================================
   CONVERT TAB
   ============================================================================ */
.exm-subtitle {
    font-size: 0.82rem; color: rgba(255,255,255,0.4);
    margin: 0 0 0.1rem;
}

/* input box (used in Convert & Buy) */
.exm-input-box {
    background: #111118;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    transition: border-color .15s;
}
.exm-input-box:focus-within {
    border-color: rgba(255,255,255,0.18);
}
.exm-input-top {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.45rem;
}
.exm-input-label {
    font-size: 0.8rem; color: rgba(255,255,255,0.4); font-weight: 500;
}
.exm-balance-label, .exm-sol-price {
    font-size: 0.8rem; color: rgba(255,255,255,0.4);
}
.exm-bal-num { color: #5b8af5; font-weight: 600; }

.exm-input-row {
    display: flex; align-items: center; gap: 0.6rem;
}
.exm-input {
    flex: 1;
    background: transparent; border: none; outline: none;
    font-size: 1.4rem; font-weight: 600; color: #fff;
    font-family: 'IBM Plex Mono', monospace;
    min-width: 0;
}
.exm-input::placeholder { color: rgba(255,255,255,0.2); }
/* hide number arrows */
.exm-input::-webkit-outer-spin-button,
.exm-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.exm-input[type=number] { -moz-appearance: textfield; }

.exm-token-btn {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff; font-size: 0.95rem; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    transition: all .15s;
    flex-shrink: 0;
}
.exm-token-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}
.exm-token-static {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    color: #fff; font-size: 0.95rem; font-weight: 600;
    flex-shrink: 0;
}
.exm-input-hint {
    font-size: 0.76rem; color: rgba(255,255,255,0.28);
    margin-top: 0.35rem;
}

/* swap button */
.exm-swap-wrap {
    display: flex; justify-content: center; margin: -0.1rem 0;
}
.exm-swap-btn {
    width: 36px; height: 36px;
    background: #252530;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: rgba(255,255,255,0.6);
    transition: all .15s;
}
.exm-swap-btn:hover {
    background: #2e2e3e;
    color: #fff;
    transform: rotate(180deg);
}

/* ============================================================================
   DEPOSIT TAB — Connect Wallet
   ============================================================================ */
.exm-connect-header { margin-bottom: 0.25rem; }
.exm-connect-title {
    font-size: 1.05rem; font-weight: 700; color: #fff; margin: 0 0 0.5rem;
}
.exm-connect-desc {
    font-size: 0.83rem; color: rgba(255,255,255,0.45);
    line-height: 1.55; margin: 0;
}

.exm-wallets {
    display: flex; flex-direction: column; gap: 0.55rem;
    margin-top: 0.25rem;
}
.exm-wallet-row {
    display: flex; align-items: center; gap: 0.9rem;
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    cursor: pointer; text-align: left;
    transition: all .15s;
    width: 100%;
}
.exm-wallet-row:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}
.exm-wallet-disabled { opacity: 0.55; }
.exm-wallet-disabled:hover {
    border-color: rgba(255,255,255,0.1);
    transform: none;
    box-shadow: none;
}
.exm-wallet-logo {
    width: 38px; height: 38px;
    border-radius: 10px; object-fit: cover;
    flex-shrink: 0;
}
.exm-wallet-name {
    flex: 1; font-weight: 600; font-size: 0.95rem; color: #fff;
}
.exm-wallet-badge {
    padding: 0.3rem 0.85rem;
    border-radius: 6px;
    font-size: 0.8rem; font-weight: 600;
    flex-shrink: 0;
}
.exm-badge-connect {
    background: linear-gradient(135deg, #4f6ef7, #3a54e0);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79,110,247,0.35);
}
.exm-badge-install {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.6);
}
.exm-install-hint {
    font-size: 0.78rem; color: rgba(255,255,255,0.35);
    margin: 0.25rem 0 0; text-align: center;
}

/* ============================================================================
   DEPOSIT TAB — Connected Wallet
   ============================================================================ */
.exm-connected-header {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: rgba(79,110,247,0.08);
    border: 1px solid rgba(79,110,247,0.2);
    border-radius: 12px;
}
.exm-provider-logo {
    width: 36px; height: 36px;
    border-radius: 9px; object-fit: cover; flex-shrink: 0;
}
.exm-connected-meta { flex: 1; min-width: 0; }
.exm-connected-title {
    font-size: 0.85rem; font-weight: 700; color: #fff;
}
.exm-connected-name {
    font-size: 0.78rem; color: rgba(255,255,255,0.45); margin-top: 1px;
}
.exm-connected-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #00ff41;
    box-shadow: 0 0 8px rgba(0,255,65,0.7);
    flex-shrink: 0;
    animation: wsd-pulse 2s ease-in-out infinite;
}

.exm-info-grid {
    display: flex; flex-direction: column; gap: 0;
    background: #111118;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    overflow: hidden;
}
.exm-info-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.exm-info-row:last-child { border-bottom: none; }
.exm-info-label {
    font-size: 0.8rem; color: rgba(255,255,255,0.4); font-weight: 500;
}
.exm-info-val {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem; color: #fff; font-weight: 500;
}
.exm-address-code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem; color: rgba(255,255,255,0.85);
}
.exm-copy-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    padding: 4px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: rgba(255,255,255,0.4);
    transition: all .15s;
}
.exm-copy-btn:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.exm-net-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #00ff41;
    box-shadow: 0 0 6px rgba(0,255,65,0.6);
}
.exm-bal-green { color: #00ff41 !important; font-weight: 600; }

.exm-noncustodial-note {
    font-size: 0.78rem; color: rgba(255,255,255,0.35);
    line-height: 1.55; margin: 0;
    padding: 0.6rem 0.85rem;
    background: rgba(139,92,246,0.06);
    border-left: 2px solid rgba(139,92,246,0.4);
    border-radius: 4px;
}

.exm-connected-actions {
    display: flex; gap: 0.6rem;
}
.exm-copy-addr-btn {
    flex: 1; padding: 0.7rem;
    background: linear-gradient(135deg, #4f6ef7, #3a54e0);
    border: none; border-radius: 10px;
    color: #fff; font-weight: 600; font-size: 0.9rem;
    cursor: pointer;
    transition: opacity .15s;
    box-shadow: 0 2px 10px rgba(79,110,247,0.3);
}
.exm-copy-addr-btn:hover { opacity: 0.85; }
.exm-disconnect-btn {
    padding: 0.7rem 1.1rem;
    background: transparent;
    border: 1px solid rgba(255,68,85,0.4);
    border-radius: 10px;
    color: #ff4455; font-weight: 600; font-size: 0.9rem;
    cursor: pointer;
    transition: all .15s;
}
.exm-disconnect-btn:hover {
    background: rgba(255,68,85,0.1);
    border-color: #ff4455;
}

/* ============================================================================
   BUY TAB
   ============================================================================ */
.exm-buy-top {
    display: flex; justify-content: space-between; align-items: center;
    gap: 0.75rem;
}
.exm-buy-network {
    display: flex; align-items: center; gap: 0.5rem;
    flex: 1; padding: 0.65rem 0.85rem;
    background: #111118;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    font-size: 0.92rem; font-weight: 600; color: #fff;
}
.exm-buy-balance {
    flex: 1; padding: 0.65rem 0.85rem;
    background: #111118;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    font-size: 0.82rem; color: rgba(255,255,255,0.45);
    text-align: right;
}
.exm-buy-balance span { color: rgba(255,255,255,0.7); }

.exm-buy-meta {
    display: flex; justify-content: space-between;
    margin-top: -0.15rem;
}
.exm-minimum {
    font-size: 0.8rem; color: #e85454; font-weight: 500;
}
.exm-approx {
    font-size: 0.8rem; color: rgba(255,255,255,0.35);
}
.exm-onramper {
    text-align: right;
    font-size: 0.78rem; color: rgba(255,255,255,0.3);
    padding-top: 0.25rem;
    margin-top: auto;
}

/* ============================================================================
   FOOTER — Action Button (Confirm / Buy)
   ============================================================================ */
.exm-footer {
    margin-top: 0.5rem;
}
.exm-action-btn {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, #4f6ef7, #3a54e0);
    border: none; border-radius: 12px;
    color: #fff; font-size: 1rem; font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
    box-shadow: 0 4px 16px rgba(79,110,247,0.35);
    letter-spacing: 0.01em;
}
.exm-action-btn:hover:not(:disabled) { opacity: 0.88; }
.exm-action-btn:disabled {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.25);
    cursor: not-allowed;
    box-shadow: none;
}

/* ============================================================================
   NOTIFICATIONS
   ============================================================================ */
.wallet-notification {
    position: fixed; top: 90px; right: 20px;
    z-index: 100001;
    padding: 0.95rem 1.35rem 0.95rem 3rem;
    background: rgba(10,10,18,0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    color: #fff; font-size: 0.88rem; font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04) inset;
    transform: translateX(420px); opacity: 0;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    max-width: 340px;
    line-height: 1.4;
}
.wallet-notification::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}
.wallet-notification.show { transform: translateX(0); opacity: 1; }
.wallet-notification.success {
    border-color: rgba(0,255,65,0.35);
    background: rgba(0,30,10,0.75);
}
.wallet-notification.success::before {
    background: rgba(0,255,65,0.2);
    box-shadow: 0 0 12px rgba(0,255,65,0.3);
    content: '✓';
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #00ff41; font-weight: 700;
}
.wallet-notification.error {
    border-color: rgba(255,68,85,0.35);
    background: rgba(40,5,8,0.75);
}
.wallet-notification.error::before {
    background: rgba(255,68,85,0.2);
    box-shadow: 0 0 12px rgba(255,68,85,0.3);
    content: '✕';
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #ff4455; font-weight: 700;
}
.wallet-notification.info {
    border-color: rgba(79,110,247,0.35);
    background: rgba(8,12,40,0.75);
}
.wallet-notification.info::before {
    background: rgba(79,110,247,0.2);
    box-shadow: 0 0 12px rgba(79,110,247,0.3);
    content: 'i';
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: #4f6ef7; font-weight: 700; font-style: italic;
}

/* ============================================================================
   LEGACY — kept for backward compat
   ============================================================================ */
.wallet-modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:1.25rem; }
.wallet-modal-header h2 { font-size:1.35rem; font-weight:700; color:#fff; margin:0; }
.wallet-modal-close { background:transparent; border:1px solid rgba(255,255,255,0.1); border-radius:8px; width:34px; height:34px; display:flex; align-items:center; justify-content:center; cursor:pointer; color:rgba(255,255,255,0.5); transition:all .15s; }
.wallet-modal-close:hover { background:rgba(255,255,255,0.05); color:#fff; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 480px) {
    .wallet-modal-content { width: 96%; border-radius: 14px; max-height: 90vh; }
    .wallet-modal-overlay { background: rgba(0,0,0,0.85); }
    .exm-header { padding: 0.75rem 0.9rem 0; }
    .exm-tabs { margin: 0.6rem 0.9rem 0; gap: 2px; }
    .exm-tab { padding: 7px 0; font-size: 0.82rem; }
    .exm-body { padding: 0.7rem 0.9rem 0.9rem; }
    .exm-input { font-size: 1.1rem; }
    .exm-input-box { padding: 10px; }
    .exm-action-btn { padding: 0.7rem; font-size: 0.9rem; }
    .exm-connect-title { font-size: 1rem; }
    .exm-connect-desc { font-size: 0.75rem; margin-bottom: 10px; }
    .exm-wallet-row { padding: 10px 12px; }
    .exm-wallet-logo { width: 32px; height: 32px; }
    .exm-install-hint { font-size: 0.7rem; margin: 8px 0 0; }
    .wallet-notification { right: 8px; left: 8px; max-width: none; }
}
@media (max-width: 480px) and (max-height: 750px) {
    .wallet-modal { padding-top: 1vh; }
    .wallet-modal-content { max-height: 94vh; }
    .exm-header { padding: 0.6rem 0.8rem 0; }
    .exm-body { padding: 0.5rem 0.8rem 0.7rem; }
    .exm-connect-desc { display: none; }
    .exm-wallet-row { padding: 8px 10px; }
    .exm-wallet-logo { width: 28px; height: 28px; }
}
@media (max-height: 650px) {
    .wallet-modal-content { max-height: 96vh; margin-top: 2vh; }
    .exm-header { padding: 0.5rem 0.8rem 0; }
    .exm-tabs { margin: 0.4rem 0.8rem 0; }
    .exm-body { padding: 0.4rem 0.8rem 0.6rem; }
}

/* ============================================================================
   MOBILE CONNECT SECTION (QR + deeplinks)
   ============================================================================ */
.exm-mc {
    margin-top: 14px; padding: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px; background: rgba(255,255,255,0.015);
}
.exm-mc.exm-mc-hl {
    border-color: rgba(0,255,65,0.18);
    background: rgba(0,255,65,0.025);
}
.exm-mc-head { font-size: 0.84rem; font-weight: 600; color: #f0f0f2; margin-bottom: 4px; }
.exm-mc-sub { font-size: 0.72rem; color: rgba(255,255,255,0.35); margin: 0 0 12px; line-height: 1.5; }
.exm-mc-row { display: flex; gap: 12px; align-items: flex-start; }
.exm-mc-qr {
    width: 140px; height: 140px; flex-shrink: 0;
    border-radius: 10px; overflow: hidden; background: #0d0d14;
    display: flex; align-items: center; justify-content: center;
}
.exm-mc-qr img, .exm-mc-qr canvas { display: block; border-radius: 6px; }
.exm-mc-btns { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.exm-mc-btn {
    display: flex; align-items: center; gap: 7px; width: 100%;
    padding: 8px 10px; background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.06); border-radius: 9px;
    color: rgba(255,255,255,0.75); font-size: 0.76rem; font-weight: 500;
    cursor: pointer; transition: all 0.12s; white-space: nowrap;
}
.exm-mc-btn:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.1); color: #fff; }
.exm-mc-btn img { flex-shrink: 0; }
.exm-mc-warn { font-size: 0.65rem; color: rgba(255,180,0,0.5); margin: 10px 0 0; line-height: 1.4; }
.exm-mc-banner {
    background: rgba(0,255,65,0.07); border: 1px solid rgba(0,255,65,0.18);
    border-radius: 10px; padding: 8px 12px; font-size: 0.78rem;
    color: #00ff41; font-weight: 500; margin-bottom: 12px; text-align: center;
}
.exm-token-btn img, .exm-token-static img {
    width: 20px !important; height: 20px !important; border-radius: 50% !important;
}
@media (max-width: 480px) {
    .exm-mc-row { flex-direction: column; align-items: center; }
    .exm-mc-btns { width: 100%; }
    .exm-mc-qr { width: 120px; height: 120px; }
    .exm-mc { padding: 10px; }
}
@media (max-width: 480px) and (max-height: 750px) {
    .exm-mc { display: none; }
}
