/* styles/pages/wallet.css */

/* === Wallet Specific Styles (Modern) === */
.modern-wallet-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    max-width: 650px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.02) 0%, rgba(74, 144, 226, 0.08) 100%);
    border-radius: 16px;
    border: 1px solid rgba(74, 144, 226, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.solana-logo {
    width: 56px;
    height: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 12px rgba(74, 144, 226, 0.3));
    transition: transform 0.3s ease;
}

.solana-logo:hover {
    transform: scale(1.05);
}

.balance-section {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    width: 100%;
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.balance-sol {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--theme-text);
    line-height: 1.1;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.balance-usd {
    font-size: 1.25rem;
    color: var(--theme-text-secondary);
    margin-bottom: 0;
    font-weight: 500;
    opacity: 0.9;
}

.refresh-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.2);
    color: var(--theme-text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.refresh-btn:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: var(--theme-accent);
    color: var(--theme-accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.3);
}

.refresh-btn .fa-spin {
    animation: professional-spin 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.refresh-btn:active {
    transform: translateY(0);
}

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

.balance-sol:has(+ .balance-usd:contains("Loading")) {
    opacity: 0.6;
    animation: pulse-loading 1.5s ease-in-out infinite;
}

@keyframes pulse-loading {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

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

.wallet-actions {
    display: flex;
    justify-content: center;
    gap: 24px;
    width: 100%;
    max-width: 480px;
    margin-bottom: 40px;
    padding: 0 8px;
}

.wallet-button {
    flex: 1 1 0px;
    padding: 16px 20px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    text-transform: none;
    letter-spacing: 0.02em;
}

.wallet-button:not(.secondary-btn) {
    background: linear-gradient(135deg, var(--theme-accent) 0%, #3a80d2 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wallet-button:not(.secondary-btn):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(74, 144, 226, 0.5);
    background: linear-gradient(135deg, #5ba0f2 0%, var(--theme-accent) 100%);
}

.wallet-button:hover {
    background-color: #3a80d2;
}

.wallet-button:not(.secondary-btn):active {
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.4);
}

.wallet-button.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--theme-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.wallet-button.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(74, 144, 226, 0.3);
    color: var(--theme-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.wallet-button.secondary-btn:active {
    transform: translateY(0);
}

.wallet-button i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.wallet-button:hover i {
    transform: scale(1.1);
}

/* Transaction History */
.transaction-history {
    width: 100%;
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.transaction-history h3 {
    text-align: left;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.05) 0%, rgba(74, 144, 226, 0.02) 100%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.transaction-history h3::before {
    content: "📊";
    font-size: 1.1rem;
}

.wallet-button:not(.secondary-btn):hover::before {
    left: 100%;
}

.wallet-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.3);
}

.wallet-button.secondary-btn:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.wallet-button:not(.secondary-btn)::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.wallet-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--theme-text-secondary) !important;
}

.wallet-button:disabled::before {
    display: none;
}

/* Subtle pulse animation for primary button when wallet has low balance */
.wallet-button.low-balance-pulse {
    animation: gentle-pulse 2s ease-in-out infinite;
}

@keyframes gentle-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(74, 144, 226, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(74, 144, 226, 0.6); }
}

.tx-list-status-message {
    font-size: 0.85em;
    color: var(--theme-text-secondary);
    text-align: center;
    margin: 12px 24px;
    padding: 12px;
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid rgba(255, 170, 0, 0.2);
    border-radius: 8px;
    min-height: auto;
    transition: all 0.3s ease;
}

/* Optional: Style for rate limit warning */
.tx-list-status-message:has(span[style*="var(--theme-bearish)"]) {
    color: var(--theme-bearish);
    font-weight: bold;
}

.tx-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 420px;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 144, 226, 0.3) rgba(255, 255, 255, 0.05);
}

.tx-list::-webkit-scrollbar {
    width: 6px;
}

.tx-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.tx-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(74, 144, 226, 0.4), rgba(74, 144, 226, 0.6));
    border-radius: 3px;
}

.tx-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(74, 144, 226, 0.6), var(--theme-accent));
}

.tx-list-empty, .tx-list-loading {
    text-align: center;
    color: var(--theme-text-secondary);
    padding: 40px 20px;
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
    margin: 12px 24px;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.tx-list-loading i {
    margin-right: 8px;
    color: var(--theme-accent);
}

.tx-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background-color: transparent;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

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

.tx-item:hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.08) 0%, rgba(74, 144, 226, 0.04) 100%);
    transform: translateX(4px);
}

.tx-item:active {
    transform: translateX(2px);
}

.tx-icon {
    margin-right: 16px;
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 12px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.tx-item.incoming .tx-icon {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.2) 0%, rgba(0, 200, 83, 0.1) 100%);
    color: var(--theme-bullish);
    border-color: rgba(0, 200, 83, 0.3);
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.2);
}

.tx-item.outgoing .tx-icon {
    background: linear-gradient(135deg, rgba(255, 61, 113, 0.2) 0%, rgba(255, 61, 113, 0.1) 100%);
    color: var(--theme-bearish);
    border-color: rgba(255, 61, 113, 0.3);
    box-shadow: 0 4px 12px rgba(255, 61, 113, 0.2);
}

/* Style for interaction/zero amount */
.tx-item:not(.incoming):not(.outgoing) .tx-icon {
    background: linear-gradient(135deg, rgba(160, 160, 176, 0.15) 0%, rgba(160, 160, 176, 0.08) 100%);
    color: var(--theme-text-secondary);
    border-color: rgba(160, 160, 176, 0.2);
}

/* Style for failed */
.tx-item.failed {
    opacity: 0.6;
}

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

.tx-item.failed .tx-icon {
    background: linear-gradient(135deg, rgba(255, 61, 113, 0.3) 0%, rgba(255, 61, 113, 0.15) 100%);
    color: var(--theme-bearish);
    border-color: rgba(255, 61, 113, 0.4);
    animation: subtle-shake 0.5s ease-in-out;
}

.tx-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.4;
    min-width: 0;
}

.tx-type {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--theme-text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-date {
    font-size: 0.8rem;
    color: var(--theme-text-secondary);
    opacity: 0.8;
    font-weight: 500;
}

.tx-amount {
    font-weight: 700;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.95rem;
    text-align: right;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tx-item.incoming .tx-amount {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.15) 0%, rgba(0, 200, 83, 0.08) 100%);
    color: var(--theme-bullish);
    border-color: rgba(0, 200, 83, 0.2);
}

.tx-item.outgoing .tx-amount {
    background: linear-gradient(135deg, rgba(255, 61, 113, 0.15) 0%, rgba(255, 61, 113, 0.08) 100%);
    color: var(--theme-bearish);
    border-color: rgba(255, 61, 113, 0.2);
}

/* Style amount for interaction/zero */
.tx-item:not(.incoming):not(.outgoing) .tx-amount {
    background: rgba(160, 160, 176, 0.1);
    color: var(--theme-text-secondary);
    border-color: rgba(160, 160, 176, 0.15);
}

/* Wallet Panels & Overlay */
.slide-up-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100vh;
    width: 100%;
    height: auto;
    max-height: 85vh;
    background: linear-gradient(135deg, var(--theme-section-bg) 0%, rgba(37, 42, 61, 0.95) 100%);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.3);
    z-index: 1050;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid rgba(74, 144, 226, 0.1);
    border-bottom: none;
}

.slide-up-panel.visible {
    bottom: 0;
}

.panel-content {
    padding: 32px 28px;
    padding-top: 56px;
    text-align: center;
    position: relative;
    max-height: calc(85vh - 60px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
}

.close-panel-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--theme-text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.panel-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-text);
    margin: 0 0 16px 0;
    text-align: center;
    background: linear-gradient(135deg, var(--theme-accent) 0%, #5ba0f2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-panel-btn:hover {
    background: rgba(255, 61, 113, 0.2);
    border-color: rgba(255, 61, 113, 0.4);
    color: var(--theme-bearish);
    transform: scale(1.05);
}

.panel-description {
    font-size: 0.95rem;
    color: var(--theme-text-secondary);
    margin-bottom: 28px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    opacity: 0.9;
}

.qr-code-container {
    margin: 24px auto 28px auto;
    width: clamp(200px, 50vw, 240px);
    height: clamp(200px, 50vw, 240px);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    padding: 16px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(74, 144, 226, 0.1);
    position: relative;
    overflow: hidden;
}

.qr-code-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--theme-accent), #5ba0f2, var(--theme-accent));
    border-radius: 16px;
    z-index: -1;
    animation: qr-border-glow 3s ease-in-out infinite;
}

@keyframes qr-border-glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.qr-code-container img,
.qr-code-container canvas,
.qr-code-container svg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.wallet-address-display {
    word-break: break-all;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    margin: 16px 0 24px 0;
    padding: 16px 20px;
    background: rgba(74, 144, 226, 0.08);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--theme-text);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.wallet-address-display::before {
    content: '📋';
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 0.9rem;
    opacity: 0.6;
}

.wallet-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 30, 45, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}

.wallet-loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

@keyframes advanced-spin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.wallet-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid transparent;
}

.wallet-status-indicator.success {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.15) 0%, rgba(0, 200, 83, 0.08) 100%);
    color: var(--theme-bullish);
    border-color: rgba(0, 200, 83, 0.3);
    animation: success-pulse 0.6s ease-out;
}

.wallet-status-indicator.error {
    background: linear-gradient(135deg, rgba(255, 61, 113, 0.15) 0%, rgba(255, 61, 113, 0.08) 100%);
    color: var(--theme-bearish);
    border-color: rgba(255, 61, 113, 0.3);
    animation: error-shake 0.6s ease-out;
}

.wallet-status-indicator.warning {
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.15) 0%, rgba(255, 170, 0, 0.08) 100%);
    color: var(--theme-neutral);
    border-color: rgba(255, 170, 0, 0.3);
}

@keyframes success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

.balance-sol.updating {
    animation: balance-update 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes balance-update {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.wallet-button.processing {
    pointer-events: none;
    position: relative;
    overflow: hidden;
}

.wallet-button.processing::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: processing-sweep 1.5s ease-in-out infinite;
}

@keyframes processing-sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

.wallet-connection-status {
    position: absolute;
    top: 12px;
    left: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--theme-bullish);
    box-shadow: 0 0 8px rgba(0, 200, 83, 0.4);
    animation: connection-pulse 2s ease-in-out infinite;
}

.wallet-connection-status.disconnected {
    background: var(--theme-bearish);
    box-shadow: 0 0 8px rgba(255, 61, 113, 0.4);
    animation: none;
}

@keyframes connection-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.tx-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--theme-accent) 0%, #5ba0f2 100%);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom;
}

.tx-item:hover::before {
    transform: scaleY(1);
    transform-origin: top;
}

.loading-spinner-advanced {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(74, 144, 226, 0.2);
    border-top: 3px solid var(--theme-accent);
    border-radius: 50%;
    animation: advanced-spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.copy-feedback {
    display: inline-block;
    margin-left: 10px;
    color: var(--theme-bullish);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.copy-feedback.visible { 
    opacity: 1; 
}

/* Withdraw Panel Form */
.withdraw-form-modern {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
    max-width: 440px;
    margin: 12px auto 0 auto;
}

.withdraw-form-modern label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--theme-text);
    margin-bottom: 8px;
    display: block;
}

.address-input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.address-input-wrapper:focus-within {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
    background: rgba(74, 144, 226, 0.05);
}

.address-input-wrapper input:focus {
    outline: none;
    box-shadow: none;
}

.address-input-wrapper input {
    flex-grow: 1;
    padding: 16px 50px 16px 16px;
    margin-bottom: 0;
    border: none;
    background: transparent;
    color: var(--theme-text);
    font-size: 0.95rem;
}

.scan-qr-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.2);
    color: var(--theme-accent);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.withdraw-form-modern input[type="number"]:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
    background: rgba(74, 144, 226, 0.05);
    outline: none;
}

.scan-qr-btn:hover {
    background: rgba(74, 144, 226, 0.2);
    color: white;
    transform: translateY(-50%) scale(1.05);
}

.withdraw-form-modern input[type="number"] {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--theme-text);
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.validation-message {
    font-size: 0.85rem;
    color: var(--theme-bearish);
    min-height: 1.2em;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 61, 113, 0.1);
    border: 1px solid rgba(255, 61, 113, 0.2);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-4px);
}

.validation-message:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

.withdraw-status {
    margin-top: 16px;
    font-size: 0.95rem;
    text-align: center;
    min-height: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.withdraw-status a {
    color: var(--theme-accent);
    text-decoration: none;
    font-weight: 600;
}

.withdraw-status a:hover {
    text-decoration: underline;
}

.action-button {
    background: linear-gradient(135deg, var(--theme-accent) 0%, #3a80d2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.action-button:active {
    transform: translateY(0);
}

.action-button:hover::before {
    left: 100%;
}

.action-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(74, 144, 226, 0.5);
    background: linear-gradient(135deg, #5ba0f2 0%, var(--theme-accent) 100%);
}

.withdraw-form-modern .action-button:disabled {
    background-color: #555;
    cursor: not-allowed;
    opacity: 0.6;
}

/* QR Scanner Modal */
.qr-scanner-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.qr-scanner-modal.visible {
    opacity: 1;
    visibility: visible;
}

.qr-scanner-content {
    background: linear-gradient(135deg, var(--theme-section-bg) 0%, rgba(37, 42, 61, 0.95) 100%);
    padding: 24px;
    border-radius: 20px;
    width: 90%;
    max-width: 420px;
    position: relative;
    text-align: center;
    border: 1px solid rgba(74, 144, 226, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.qr-scanner-modal.visible .qr-scanner-content {
    transform: translateY(0);
}

.close-scanner-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--theme-text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-scanner-btn:hover {
    background: rgba(255, 61, 113, 0.2);
    border-color: rgba(255, 61, 113, 0.4);
    color: var(--theme-bearish);
    transform: scale(1.1);
}

.qr-reader-viewfinder {
    width: 100%;
    max-width: 280px;
    margin: 20px auto;
    border: 2px solid var(--theme-accent);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #000;
    box-shadow: 0 8px 32px rgba(74, 144, 226, 0.3);
}

.qr-reader-viewfinder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    background: linear-gradient(45deg, var(--theme-accent), #5ba0f2, var(--theme-accent));
    background-size: 200% 200%;
    animation: scanner-border-flow 3s ease-in-out infinite;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
}

@keyframes scanner-border-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.load-more-btn {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(74, 144, 226, 0.05) 100%);
    color: var(--theme-accent);
    border: 1px solid rgba(74, 144, 226, 0.3);
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 16px auto;
    display: block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.load-more-btn:hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2) 0%, rgba(74, 144, 226, 0.1) 100%);
    border-color: var(--theme-accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.2);
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.2), transparent);
    transition: left 0.6s;
}

.load-more-btn:hover::before {
    left: 100%;
}

.tx-list-loading-more {
    text-align: center;
    padding: 16px;
    color: var(--theme-text-secondary);
    font-size: 0.9rem;
    animation: loading-fade 1.5s ease-in-out infinite;
}

@keyframes loading-fade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.tx-list-end-message {
    text-align: center;
    padding: 16px;
    color: var(--theme-text-secondary);
    font-size: 0.85rem;
    font-style: italic;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.02);
    margin: 12px 24px;
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .modern-wallet-container {
        padding: 24px 16px;
        margin: 0 8px;
    }

    .balance-section {
        padding: 20px;
    }

    .balance-sol {
        font-size: 2.0rem;
    }

    .balance-usd {
        font-size: 1.0rem;
    }

    .wallet-actions {
        gap: 16px;
    }

    .qr-scanner-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
}

@media (max-width: 480px) {
    .balance-sol {
        font-size: 1.7rem;
    }

    .balance-usd {
        font-size: 0.8rem;
    }

    .tx-item {
        padding: 12px 16px;
    }

    .wallet-button {
        padding: 14px 16px;
        font-size: 0.95rem;
    }
}

@media (prefers-color-scheme: dark) {
    .qr-code-container {
        background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    .wallet-button {
        border: 2px solid;
    }

    .tx-item {
        border: 1px solid var(--theme-border);
    }

    .balance-section {
        border: 2px solid rgba(74, 144, 226, 0.3);
    }
}

.wallet-button:focus,
.tx-item:focus,
.action-button:focus {
    outline: 2px solid var(--theme-accent);
    outline-offset: 2px;
}

@media print {
    .modern-wallet-container {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }

    .wallet-actions,
    .refresh-btn {
        display: none !important;
    }
}

/* html5-qrcode may inject video/canvas elements */
#wallet-qr-reader video, #wallet-qr-reader canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
}

#wallet-scanner-status {
    font-size: 0.9rem;
    color: var(--theme-text-secondary);
}

/* Panel Overlay */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-overlay.visible {
    opacity: 1;
    visibility: visible;
}