﻿/* ============================================
   CrabFun Sniper — Trading Dashboard Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* --- Reuse root variables from main style.css --- */

/* --- Page base --- */
.trading-page {
    margin: 0;
    padding: 0;
    background: #030B1A;
    color: var(--white);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Ambient background glow — animated */
.trading-page::before {
    content: '';
    position: fixed;
    top: -30%;
    left: -20%;
    width: 140%;
    height: 140%;
    background:
        radial-gradient(ellipse at 15% 50%, rgba(13, 115, 119, 0.08) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 20%, rgba(13, 115, 119, 0.06) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 80%, rgba(184, 115, 51, 0.05) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 0%, #030B1A 70%);
    pointer-events: none;
    z-index: 0;
    animation: ambientShift 20s ease-in-out infinite alternate;
}

/* Subtle scanline overlay */
.trading-page::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 0;
}

@keyframes ambientShift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-2%, 1%) scale(1.03); }
}

/* --- 3D Canvas Background --- */
#trading-3d-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.2;
    mix-blend-mode: screen;
}

/* ============================================
   TOP BAR
   ============================================ */
.trading-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(8, 8, 22, 0.92);
    backdrop-filter: blur(30px) saturate(1.4);
    -webkit-backdrop-filter: blur(30px) saturate(1.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

/* Gradient accent line under topbar */
.trading-topbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(13, 115, 119, 0.5) 20%,
        rgba(184, 115, 51, 0.6) 50%,
        rgba(13, 115, 119, 0.5) 80%,
        transparent 100%);
}

.topbar-left {
    display: flex;
    align-items: center;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--white);
}

.topbar-logo .logo-icon {
    font-size: 1.5rem;
}

.topbar-logo .logo-icon-img {
    width: auto;
    height: 72px;
    border-radius: 10px;
    object-fit: contain;
}

.topbar-title {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #B87333, #E8A87C, #14FFEC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(184, 115, 51, 0.3));
}

.topbar-subtitle {
    display: block;
    font-size: 0.7rem;
    color: var(--white-40);
    letter-spacing: 0.5px;
}

.topbar-version {
    margin-left: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(13, 115, 119, 0.15), rgba(184, 115, 51, 0.15));
    border: 1px solid rgba(13, 115, 119, 0.2);
    color: var(--teal);
    align-self: center;
}

.topbar-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.connection-label {
    font-size: 0.65rem;
    color: var(--white-40);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.connection-status.connecting {
    color: var(--yellow);
}

.connection-status.connected {
    color: var(--copper);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--yellow);
    animation: pulse-dot 1.5s infinite;
}

.connection-status.connected .status-dot {
    background: var(--copper);
    box-shadow: 0 0 10px var(--shadow-glow-copper), 0 0 20px rgba(184, 115, 51, 0.2);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.topbar-right {
    display: flex;
    gap: 8px;
}

.topbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--white-60);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-btn:hover {
    background: rgba(184, 115, 51, 0.08);
    border-color: rgba(184, 115, 51, 0.3);
    color: var(--copper);
    box-shadow: 0 0 20px rgba(184, 115, 51, 0.12), inset 0 0 15px rgba(184, 115, 51, 0.05);
    transform: translateY(-1px);
}

/* ============================================
   LAYOUT
   ============================================ */
.trading-layout {
    display: flex;
    padding-top: 60px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============================================
   SIDEBAR
   ============================================ */
.trading-sidebar {
    width: 390px;
    min-width: 390px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(6, 6, 18, 0.92);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    scrollbar-width: thin;
    scrollbar-color: rgba(13, 115, 119, 0.2) transparent;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
}

.trading-sidebar::-webkit-scrollbar {
    width: 4px;
}

.trading-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(13, 115, 119, 0.3), rgba(184, 115, 51, 0.3));
    border-radius: 4px;
}

.sidebar-card {
    background: rgba(12, 12, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: visible;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.sidebar-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 17px;
    background: linear-gradient(135deg,
        rgba(13, 115, 119, 0.15) 0%,
        rgba(184, 115, 51, 0.08) 50%,
        rgba(13, 115, 119, 0.1) 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.sidebar-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(13, 115, 119, 0.06);
    transform: translateY(-1px);
}

.sidebar-card:hover::before {
    opacity: 1;
}

.sidebar-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--white-80);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px 16px 0 0;
}

.sidebar-card-body {
    padding: 14px 16px;
}

/* --- Wallet --- */
.wallet-connect-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #B87333, #E8A87C);
    border: none;
    color: var(--bg-dark);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.wallet-connect-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.wallet-connect-btn:hover::before {
    left: 100%;
}

.wallet-connect-btn.connected {
    background: rgba(184, 115, 51, 0.08);
    border: 1px solid rgba(184, 115, 51, 0.2);
    color: var(--white);
    box-shadow: inset 0 0 20px rgba(184, 115, 51, 0.05);
}

.wallet-connect-btn.connected::before {
    display: none;
}

.wallet-connect-btn.connected strong {
    color: var(--copper);
}

.wallet-connect-btn.connected span {
    color: var(--white-60);
}

.wallet-connect-btn span {
    display: block;
}

.wallet-connect-btn strong {
    display: block;
    font-size: 0.95rem;
}

.wallet-connect-btn:hover {
    box-shadow: 0 0 30px rgba(184, 115, 51, 0.35), 0 8px 25px rgba(184, 115, 51, 0.15);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.wallet-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.wallet-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 10px;
}

.wallet-icon.phantom {
    background: rgba(13, 115, 119, 0.15);
    border: 1px solid rgba(13, 115, 119, 0.25);
}

.wallet-icon.solflare {
    background: rgba(255, 165, 0, 0.15);
    border: 1px solid rgba(255, 165, 0, 0.25);
}

.wallet-icon.sollet {
    background: rgba(184, 115, 51, 0.15);
    border: 1px solid rgba(184, 115, 51, 0.25);
}

.wallet-alt-btn {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--white-80);
    cursor: pointer;
    font-size: 0.8rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wallet-alt-btn small {
    display: block;
    margin-top: 4px;
    color: var(--white-40);
    font-size: 0.7rem;
    line-height: 1.4;
}

.wallet-alt-btn:hover {
    border-color: rgba(184, 115, 51, 0.25);
    background: rgba(184, 115, 51, 0.04);
}

/* --- Bot Control --- */
.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-badge.stopped {
    background: rgba(255, 71, 87, 0.1);
    color: var(--red);
    border: 1px solid rgba(255, 71, 87, 0.2);
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.3);
}

.status-badge.running {
    background: rgba(184, 115, 51, 0.1);
    color: var(--copper);
    border: 1px solid rgba(184, 115, 51, 0.2);
    animation: pulse-glow 2s infinite;
    text-shadow: 0 0 10px rgba(184, 115, 51, 0.4);
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(184, 115, 51, 0.2); }
    50% { box-shadow: 0 0 15px rgba(184, 115, 51, 0.4); }
}

.bot-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.bot-btn {
    padding: 12px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.bot-start {
    background: linear-gradient(135deg, #B87333, #E8A87C);
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(184, 115, 51, 0.2);
}

.bot-start:hover {
    box-shadow: 0 0 25px rgba(184, 115, 51, 0.4), 0 8px 25px rgba(184, 115, 51, 0.2);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.bot-stop {
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
}

.bot-stop:hover:not(:disabled) {
    background: rgba(255, 71, 87, 0.1);
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.2);
}

.bot-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* --- Settings inputs --- */
.setting-group {
    margin-bottom: 12px;
}

.setting-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--white-60);
    margin-bottom: 6px;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-inputs span {
    color: var(--white-40);
    font-size: 0.8rem;
}

.setting-input {
    background: rgba(6, 6, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 9px 12px;
    color: var(--white);
    font-size: 0.82rem;
    width: 80px;
    font-family: var(--font-body);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.setting-input:focus {
    outline: none;
    border-color: rgba(184, 115, 51, 0.4);
    box-shadow: 0 0 15px rgba(184, 115, 51, 0.1), inset 0 0 10px rgba(184, 115, 51, 0.03);
}

.setting-input.full {
    width: 100%;
}

select.setting-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.4)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

select.setting-input option {
    background: #0a0a1e;
    color: var(--white);
}

.advanced-settings-btn {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--white-60);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 6px;
}

.advanced-settings-btn:hover {
    border-color: rgba(184, 115, 51, 0.3);
    color: var(--copper);
    background: rgba(184, 115, 51, 0.04);
}

.advanced-panel {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--white-05);
}

.advanced-panel.open {
    display: block;
}

/* --- Toggle switch --- */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-group label {
    margin-bottom: 0;
}

.toggle {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.toggle.active {
    background: linear-gradient(135deg, #B87333, #E8A87C);
    border-color: transparent;
    box-shadow: 0 0 15px rgba(184, 115, 51, 0.2);
}

.toggle-knob {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--white);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55), transform 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle.active .toggle-knob {
    left: 22px;
}

/* --- Stats mini grid --- */
.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-mini-card {
    background: rgba(8, 8, 22, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-mini-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--copper), var(--teal));
    opacity: 0.5;
    border-radius: 2px 2px 0 0;
}

.stat-mini-card:hover {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.stat-mini-icon {
    font-size: 1rem;
    margin-bottom: 4px;
    display: block;
}

.stat-mini-card strong {
    display: block;
    font-size: 1.1rem;
    font-family: var(--font-heading);
    margin-bottom: 2px;
    color: var(--white);
    text-shadow: 0 0 20px rgba(184, 115, 51, 0.15);
}

.stat-mini-card span:last-child {
    font-size: 0.65rem;
    color: var(--white-40);
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Stats period select --- */
.stats-period-select {
    background: rgba(6, 6, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 4px 12px;
    color: var(--white);
    font-size: 0.7rem;
    cursor: pointer;
    appearance: none;
    font-family: var(--font-body);
}

.stats-period-select:focus {
    outline: none;
    border-color: rgba(184, 115, 51, 0.4);
}

/* --- Chart tabs --- */
.chart-tabs {
    display: flex;
    gap: 4px;
}

.chart-tab {
    padding: 4px 10px;
    border-radius: 20px;
    background: transparent;
    border: none;
    color: var(--white-40);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-tab.active {
    background: linear-gradient(135deg, #B87333, #E8A87C);
    color: var(--bg-dark);
    box-shadow: 0 2px 10px rgba(184, 115, 51, 0.25);
}

.chart-tab:hover:not(.active) {
    color: var(--white);
}

#perfChart {
    width: 100% !important;
    height: 120px !important;
    margin-bottom: 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.perf-stats {
    display: flex;
    justify-content: space-between;
}

.perf-label {
    font-size: 0.7rem;
    color: var(--white-40);
    display: block;
}

.perf-value {
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.perf-value.green {
    color: var(--copper);
    text-shadow: 0 0 15px rgba(184, 115, 51, 0.3);
}

.perf-value.red {
    color: var(--red);
    text-shadow: 0 0 15px rgba(255, 71, 87, 0.3);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.trading-main {
    flex: 1;
    min-width: 0;
    padding: 24px;
    overflow-y: auto;
    height: calc(100vh - 60px);
    background: rgba(4, 4, 14, 0.5);
    scrollbar-width: thin;
    scrollbar-color: rgba(13, 115, 119, 0.15) transparent;
}

.trading-main::-webkit-scrollbar {
    width: 5px;
}

.trading-main::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(13, 115, 119, 0.2), rgba(184, 115, 51, 0.2));
    border-radius: 4px;
}

/* --- Monitoring Header --- */
.monitoring-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 22px;
    background: rgba(12, 12, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

.monitoring-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(184, 115, 51, 0.3), rgba(13, 115, 119, 0.3), transparent);
}

.monitoring-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.monitoring-title span:first-child {
    font-size: 1.3rem;
}

.monitoring-title h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.monitoring-subtitle {
    display: block;
    font-size: 0.72rem;
    color: var(--white-40);
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.monitoring-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--yellow);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--yellow);
    animation: pulse-dot 1.5s infinite;
}

.monitoring-status.connected {
    color: var(--copper);
}

.monitoring-status.connected .pulse-dot {
    background: var(--copper);
}

.monitoring-filters {
    display: flex;
    gap: 6px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(12, 12, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--white-60);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn.active {
    background: linear-gradient(135deg, #B87333, #E8A87C);
    color: var(--bg-dark);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(184, 115, 51, 0.25);
}

.filter-btn:hover:not(.active) {
    border-color: rgba(184, 115, 51, 0.3);
    color: var(--white);
    background: rgba(184, 115, 51, 0.06);
}

.filter-btn.icon-btn {
    padding: 8px 10px;
}

/* --- Token Table --- */
.token-table-wrapper {
    background: rgba(10, 10, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.token-table-wrapper.has-tokens {
    display: block;
}

/* ===== Token List (div-based grid) ===== */
.token-list-header {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1.2fr 1fr 1fr 1.2fr 0.8fr;
    padding: 14px 16px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--white-40);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(6, 6, 18, 0.5);
}

.token-list-item {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1.2fr 1fr 1fr 1.2fr 0.8fr;
    align-items: center;
    padding: 14px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--white-80);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.token-list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--copper), var(--teal));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0 2px 2px 0;
}

.token-list-item:hover {
    background: rgba(184, 115, 51, 0.03);
    box-shadow: inset 0 0 30px rgba(184, 115, 51, 0.02);
}

.token-list-item:hover::before {
    opacity: 1;
}

.token-list-item:last-child {
    border-bottom: none;
}

/* Token name cell */
.token-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.token-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #B87333, #E8A87C);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--bg-dark);
    box-shadow: 0 0 12px rgba(184, 115, 51, 0.2);
    position: relative;
}

.token-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(184, 115, 51, 0.3), rgba(13, 115, 119, 0.3));
    z-index: -1;
    opacity: 0.5;
}

.token-symbol {
    font-weight: 600;
}

.token-address {
    font-size: 0.7rem;
    color: var(--white-40);
}

/* Status badges */
.trade-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.trade-status.bought {
    background: rgba(184, 115, 51, 0.1);
    color: var(--copper);
    border: 1px solid rgba(184, 115, 51, 0.2);
}

.trade-status.sold {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.trade-status.pending {
    background: rgba(255, 193, 7, 0.1);
    color: var(--yellow);
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.trade-status.failed {
    background: rgba(255, 71, 87, 0.1);
    color: var(--red);
    border: 1px solid rgba(255, 71, 87, 0.2);
}

.pnl-positive {
    color: var(--copper);
    font-weight: 700;
    text-shadow: 0 0 12px rgba(184, 115, 51, 0.3);
}

.pnl-negative {
    color: var(--red);
    font-weight: 700;
    text-shadow: 0 0 12px rgba(255, 71, 87, 0.3);
}

/* Success rate bar */
.success-bar {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.success-bar-fill {
    height: 100%;
    background: var(--bar-color, #B87333);
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
    box-shadow: 0 0 8px var(--bar-color, #B87333);
}

.action-btn {
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--white-60);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn:hover {
    border-color: rgba(184, 115, 51, 0.3);
    color: var(--copper);
    background: rgba(184, 115, 51, 0.06);
    box-shadow: 0 0 12px rgba(184, 115, 51, 0.1);
}

/* --- Empty States --- */
.token-empty-state,
.token-searching-state {
    text-align: center;
    padding: 100px 20px;
}

.token-empty-state {
    background: rgba(10, 10, 28, 0.5);
    border: 1px dashed rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    margin-top: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.empty-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(12, 12, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    margin: 0 auto 24px;
    box-shadow: 0 0 40px rgba(184, 115, 51, 0.08), 0 0 80px rgba(13, 115, 119, 0.05);
    position: relative;
}

.empty-icon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(184, 115, 51, 0.2), rgba(13, 115, 119, 0.2));
    z-index: -1;
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

.token-empty-state h3,
.token-searching-state h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.token-empty-state p,
.token-searching-state p {
    color: var(--white-40);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.token-empty-state .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 12px;
    background: linear-gradient(135deg, #B87333, #E8A87C);
    color: var(--bg-dark);
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(184, 115, 51, 0.2);
}

.token-empty-state .btn:hover {
    box-shadow: 0 0 30px rgba(184, 115, 51, 0.35), 0 8px 25px rgba(184, 115, 51, 0.15);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Search spinner */
.search-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--copper);
    border-right: 3px solid var(--teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
    box-shadow: 0 0 20px rgba(184, 115, 51, 0.1);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   MODAL OVERLAY
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px) saturate(0.8);
    -webkit-backdrop-filter: blur(10px) saturate(0.8);
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-card {
    background: rgba(14, 14, 32, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    width: 400px;
    max-width: 92vw;
    overflow: hidden;
    animation: modalIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(13, 115, 119, 0.05);
    position: relative;
}

.modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--copper), var(--teal), var(--teal-light));
}

.modal-card.modal-large {
    width: 560px;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(30px) scale(0.92); filter: blur(8px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--white-10);
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--white-60);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close:hover {
    background: rgba(255, 71, 87, 0.1);
    color: var(--red);
    border-color: rgba(255, 71, 87, 0.3);
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.1);
}

.modal-body {
    padding: 20px 24px;
}

/* --- Wallet options --- */
.wallet-option-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--white);
    cursor: pointer;
    text-align: left;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.wallet-option-btn:last-child {
    margin-bottom: 0;
}

.wallet-option-btn:hover {
    border-color: rgba(184, 115, 51, 0.25);
    background: rgba(184, 115, 51, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 20px rgba(184, 115, 51, 0.08);
}

.wo-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.wo-info {
    flex: 1;
}

.wo-info strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

/* ============================================
   WALLET CONNECT MODAL — fully isolated
   ============================================ */

.wc-card {
    width: 370px;
    max-width: 92vw;
    background: #1a1d2e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.65), 0 0 60px rgba(184, 115, 51, 0.03);
    overflow: hidden;
    animation: modalIn 0.35s ease-out;
}

.wc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 14px;
    position: relative;
}

.wc-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

.wc-help {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;
}

.wc-help:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
}

.wc-help svg {
    width: 16px;
    height: 16px;
}

.wc-close {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: transparent;
    border: none;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.2s ease;
}

.wc-close svg {
    width: 16px;
    height: 16px;
}

.wc-close:hover {
    color: #ffffff;
}

.wc-list {
    padding: 2px 16px 10px;
}

.wc-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    background: #252838;
    border: none;
    color: #ffffff;
    cursor: pointer;
    text-align: left;
    margin-bottom: 6px;
    transition: background 0.15s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transform: none;
    box-shadow: none;
}

.wc-row:last-child {
    margin-bottom: 0;
}

.wc-row:hover {
    background: #2e3245;
    transform: none;
    box-shadow: none;
}

.wc-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-icon svg {
    width: 42px;
    height: 42px;
    display: block;
    border-radius: 12px;
}

.wc-icon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 12px;
    overflow: hidden;
}

.wc-icon-grid svg {
    width: 100%;
    height: 100%;
    border-radius: 3px;
}

.wc-name {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wc-badge {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1;
}

.wc-badge-green {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
}

.wc-badge-purple {
    background: rgba(167, 139, 250, 0.12);
    color: #a78bfa;
}

.wc-badge-gray {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.45);
}

.wc-footer {
    padding: 14px 20px 22px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
}

.wc-link {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

.wc-link:hover {
    color: #ffffff;
}

/* Stagger animation for wallet rows */
.modal-overlay.show .wc-row:nth-child(1) { animation: modalItemIn 0.4s ease 0.05s both; }
.modal-overlay.show .wc-row:nth-child(2) { animation: modalItemIn 0.4s ease 0.1s both; }
.modal-overlay.show .wc-row:nth-child(3) { animation: modalItemIn 0.4s ease 0.15s both; }
.modal-overlay.show .wc-row:nth-child(4) { animation: modalItemIn 0.4s ease 0.2s both; }
.modal-overlay.show .wc-row:nth-child(5) { animation: modalItemIn 0.4s ease 0.25s both; }
.modal-overlay.show .wc-row:nth-child(6) { animation: modalItemIn 0.4s ease 0.3s both; }

/* --- Settings tabs --- */
.settings-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--white-10);
    padding-bottom: 12px;
    position: relative;
}

.stab-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--white-40);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stab-btn.active {
    background: linear-gradient(135deg, #B87333, #E8A87C);
    color: var(--bg-dark);
    box-shadow: 0 2px 10px rgba(184, 115, 51, 0.2);
}

.stab-btn:hover:not(.active) {
    color: var(--white);
    background: var(--white-05);
}

.stab-content {
    display: none;
    animation: tabFadeIn 0.35s ease;
}

.stab-content.active {
    display: block;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.s-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.s-group input,
.s-group select {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    background: rgba(6, 6, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--white);
    font-size: 0.85rem;
    font-family: var(--font-body);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.s-group input:focus,
.s-group select:focus {
    outline: none;
    border-color: rgba(184, 115, 51, 0.4);
    box-shadow: 0 0 15px rgba(184, 115, 51, 0.1), inset 0 0 10px rgba(184, 115, 51, 0.03);
}

.s-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.4)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
}

.s-group select option {
    background: #0a0a1e;
    color: var(--white);
}

.s-group small {
    display: block;
    margin-top: 6px;
    font-size: 0.7rem;
    color: var(--white-30);
}

.s-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.s-toggle label {
    margin-bottom: 0;
    flex: 1;
}

.s-toggle small {
    width: 100%;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--white-10);
}

.btn-modal-cancel,
.btn-modal-save {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-modal-cancel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--white-60);
}

.btn-modal-cancel:hover {
    background: rgba(255, 71, 87, 0.08);
    border-color: rgba(255, 71, 87, 0.3);
    color: var(--red);
}

.btn-modal-save {
    background: linear-gradient(135deg, #B87333, #E8A87C);
    color: var(--bg-dark);
}

.btn-modal-save:hover {
    box-shadow: 0 0 25px rgba(184, 115, 51, 0.3), 0 8px 20px rgba(184, 115, 51, 0.15);
    transform: translateY(-1px);
    filter: brightness(1.1);
}

/* --- Wallet details panel --- */
.wallet-details-panel {
    background: rgba(6, 6, 18, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}

.wd-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.wd-label {
    font-size: 0.75rem;
    color: var(--white-40);
}

.wd-value {
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-heading);
}

/* --- Additional status badges --- */
.trade-status.detected {
    background: rgba(13, 115, 119, 0.1);
    color: var(--teal-light);
    border: 1px solid rgba(13, 115, 119, 0.2);
}

.trade-status.analyzing {
    background: rgba(255, 193, 7, 0.1);
    color: var(--yellow);
    border: 1px solid rgba(255, 193, 7, 0.2);
    animation: pulse-glow-yellow 2s infinite;
}

@keyframes pulse-glow-yellow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 193, 7, 0.1); }
    50% { box-shadow: 0 0 10px rgba(255, 193, 7, 0.25); }
}

.trade-status.buying {
    background: rgba(13, 115, 119, 0.1);
    color: var(--teal);
    border: 1px solid rgba(13, 115, 119, 0.2);
}

.trade-status.selling {
    background: rgba(13, 115, 119, 0.1);
    color: var(--teal-light);
    border: 1px solid rgba(13, 115, 119, 0.2);
}

.trade-status.honeypot {
    background: rgba(255, 71, 87, 0.1);
    color: var(--red);
    border: 1px solid rgba(255, 71, 87, 0.2);
}

.trade-status.rug_pull {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.trade-status.skipped {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white-40);
    border: 1px solid var(--white-10);
}

/* --- Preview banner --- */
.preview-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 14px;
    background: rgba(13, 115, 119, 0.06);
    border: 1px solid rgba(13, 115, 119, 0.15);
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 20px rgba(13, 115, 119, 0.05);
}

.preview-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.preview-banner h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    margin: 0 0 4px;
    color: var(--teal);
}

.preview-banner p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--white-60);
}

/* --- Start from empty button --- */
.btn-start-empty {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 12px;
    background: linear-gradient(135deg, #B87333, #E8A87C);
    color: var(--bg-dark);
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(184, 115, 51, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-start-empty::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.btn-start-empty:hover::before {
    left: 100%;
}

.btn-start-empty:hover {
    box-shadow: 0 0 30px rgba(184, 115, 51, 0.35), 0 8px 25px rgba(184, 115, 51, 0.15);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* --- Notification System --- */
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
}

.notification {
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(14, 14, 32, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--white);
    font-size: 0.85rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 0, 0, 0.2);
    animation: notifyIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.notification.success {
    border-color: rgba(184, 115, 51, 0.3);
    background: linear-gradient(135deg, rgba(184, 115, 51, 0.1), rgba(14, 14, 32, 0.95));
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(184, 115, 51, 0.08);
}

.notification.error {
    border-color: rgba(255, 71, 87, 0.3);
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.1), rgba(14, 14, 32, 0.95));
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 71, 87, 0.08);
}

.notification.warning {
    border-color: rgba(255, 193, 7, 0.3);
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(14, 14, 32, 0.95));
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 193, 7, 0.08);
}

.notification.info {
    border-color: rgba(13, 115, 119, 0.3);
    background: linear-gradient(135deg, rgba(13, 115, 119, 0.1), rgba(14, 14, 32, 0.95));
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(13, 115, 119, 0.08);
}

.notification.fade-out {
    animation: notifyOut 0.3s ease forwards;
}

@keyframes notifyIn {
    from { opacity: 0; transform: translateX(60px) scale(0.9); filter: blur(4px); }
    to { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}

@keyframes notifyOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(60px) scale(0.9); }
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 0 0 14px 14px;
    background: linear-gradient(90deg, var(--copper), var(--teal-light));
    animation: notifyProgress 4s linear forwards;
}

.notification.error .notification-progress { background: linear-gradient(90deg, #ff4757, #ff6b6b); }
.notification.warning .notification-progress { background: linear-gradient(90deg, #ffc107, #ffdb4d); }
.notification.info .notification-progress { background: linear-gradient(90deg, #14FFEC, #48cae4); }

@keyframes notifyProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .trading-sidebar {
        width: 260px;
        min-width: 260px;
    }
}

@media (max-width: 1024px) {
    .trading-sidebar {
        width: 240px;
        min-width: 240px;
    }
}

@media (max-width: 768px) {
    .trading-layout {
        flex-direction: column;
    }

    .trading-sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    .topbar-center {
        display: none;
    }

    .monitoring-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .monitoring-filters {
        flex-wrap: wrap;
    }

    .token-table-wrapper {
        overflow-x: auto;
    }

    .token-list-header,
    .token-list-item {
        min-width: 700px;
    }
}

/* ============================================
   PREMIUM ENHANCEMENTS
   ============================================ */

/* New token row slide-in animation */
.token-list-item.new-row {
    animation: tokenSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tokenSlideIn {
    from {
        opacity: 0;
        transform: translateX(-15px);
        background: rgba(184, 115, 51, 0.06);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        background: transparent;
    }
}

/* Shimmer effect on live data cells */
.token-list-item .pnl-positive,
.token-list-item .pnl-negative {
    position: relative;
}

/* Premium scrollbar for the whole page */
.trading-page ::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.trading-page ::-webkit-scrollbar-track {
    background: transparent;
}

.trading-page ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(13, 115, 119, 0.2), rgba(184, 115, 51, 0.2));
    border-radius: 4px;
}

.trading-page ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(13, 115, 119, 0.35), rgba(184, 115, 51, 0.35));
}

/* Trade status badges — refined inner glow */
.trade-status {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    letter-spacing: 0.3px;
}

/* Wallet icon areas — refined backgrounds */
.wo-icon {
    background: rgba(184, 115, 51, 0.1);
    border-color: rgba(184, 115, 51, 0.15);
}

/* Premium text selection */
.trading-page ::selection {
    background: rgba(184, 115, 51, 0.25);
    color: var(--white);
}

/* Refined focus visible for accessibility */
.trading-page *:focus-visible {
    outline: 2px solid rgba(184, 115, 51, 0.4);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Sidebar card sequential entrance animation */
.sidebar-card:nth-child(1) { animation: cardFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both; }
.sidebar-card:nth-child(2) { animation: cardFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both; }
.sidebar-card:nth-child(3) { animation: cardFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both; }
.sidebar-card:nth-child(4) { animation: cardFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both; }
.sidebar-card:nth-child(5) { animation: cardFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both; }

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px) scale(0.96);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

/* Main content entrance */
.trading-topbar {
    animation: topbarSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes topbarSlideIn {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.monitoring-header {
    animation: fadeSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

.token-table-wrapper,
.token-empty-state {
    animation: fadeSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* ============================================
   THEME: Solana Night
   ============================================ */
.trading-page.theme-solana-night {
    background: #070714;
}

.theme-solana-night::before {
    background:
        radial-gradient(ellipse at 20% 40%, rgba(13, 115, 119, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 25%, rgba(20, 241, 149, 0.06) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 85%, rgba(13, 115, 119, 0.04) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 0%, #070714 70%) !important;
}

.theme-solana-night .trading-topbar::after {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(13, 115, 119, 0.6) 30%,
        rgba(20, 241, 149, 0.5) 70%,
        transparent 100%);
}

.theme-solana-night .topbar-title {
    background: linear-gradient(135deg, #0D7377, #E8A87C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(13, 115, 119, 0.3));
}

.theme-solana-night .topbar-version {
    background: linear-gradient(135deg, rgba(13, 115, 119, 0.2), rgba(20, 241, 149, 0.15));
    border-color: rgba(13, 115, 119, 0.25);
    color: #E8A87C;
}

.theme-solana-night .sidebar-card::before {
    background: linear-gradient(135deg,
        rgba(13, 115, 119, 0.2) 0%,
        rgba(20, 241, 149, 0.12) 100%);
}

.theme-solana-night .wallet-connect-btn {
    background: linear-gradient(135deg, #0D7377, #E8A87C);
}

.theme-solana-night .bot-start {
    background: linear-gradient(135deg, #0D7377, #E8A87C);
    box-shadow: 0 4px 15px rgba(13, 115, 119, 0.2);
}

.theme-solana-night .bot-start:hover {
    box-shadow: 0 0 25px rgba(13, 115, 119, 0.4), 0 8px 25px rgba(13, 115, 119, 0.2);
}

.theme-solana-night .filter-btn.active,
.theme-solana-night .chart-tab.active,
.theme-solana-night .stab-btn.active,
.theme-solana-night .btn-modal-save,
.theme-solana-night .btn-start-empty,
.theme-solana-night .token-empty-state .btn {
    background: linear-gradient(135deg, #0D7377, #E8A87C);
}

.theme-solana-night .toggle.active {
    background: linear-gradient(135deg, #0D7377, #E8A87C);
}

.theme-solana-night .stat-mini-card::before {
    background: linear-gradient(90deg, #0D7377, #E8A87C);
}

.theme-solana-night .token-icon {
    background: linear-gradient(135deg, #0D7377, #E8A87C);
    box-shadow: 0 0 12px rgba(13, 115, 119, 0.25);
}

.theme-solana-night .token-icon::after {
    background: linear-gradient(135deg, rgba(13, 115, 119, 0.3), rgba(20, 241, 149, 0.3));
}

.theme-solana-night .token-list-item::before {
    background: linear-gradient(180deg, #0D7377, #E8A87C);
}

.theme-solana-night .success-bar-fill {
    box-shadow: 0 0 8px var(--bar-color, #0D7377);
}

.theme-solana-night .monitoring-header::before {
    background: linear-gradient(90deg, transparent, rgba(13, 115, 119, 0.4), rgba(20, 241, 149, 0.3), transparent);
}

.theme-solana-night .modal-card::before {
    background: linear-gradient(90deg, #0D7377, #E8A87C);
}

.theme-solana-night .empty-icon::after {
    background: linear-gradient(135deg, rgba(13, 115, 119, 0.3), rgba(20, 241, 149, 0.2));
}

.theme-solana-night .search-spinner {
    border-top-color: #0D7377;
    border-right-color: #E8A87C;
    box-shadow: 0 0 20px rgba(13, 115, 119, 0.15);
}

.theme-solana-night ::selection {
    background: rgba(13, 115, 119, 0.3);
}

.theme-solana-night *:focus-visible {
    outline-color: rgba(13, 115, 119, 0.5);
}

/* ============================================
   THEME: Matrix Green
   ============================================ */
.trading-page.theme-matrix-green {
    background: #020a02;
}

.theme-matrix-green::before {
    background:
        radial-gradient(ellipse at 25% 50%, rgba(0, 255, 65, 0.07) 0%, transparent 45%),
        radial-gradient(ellipse at 75% 25%, rgba(184, 115, 51, 0.05) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 80%, rgba(0, 180, 80, 0.04) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 0%, #020a02 70%) !important;
}

.theme-matrix-green::after {
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        rgba(0, 255, 65, 0.015) 1px,
        rgba(0, 255, 65, 0.015) 2px
    ) !important;
}

.theme-matrix-green .trading-topbar {
    background: rgba(2, 10, 2, 0.92);
}

.theme-matrix-green .trading-topbar::after {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 255, 65, 0.5) 25%,
        rgba(184, 115, 51, 0.6) 50%,
        rgba(0, 255, 65, 0.5) 75%,
        transparent 100%);
}

.theme-matrix-green .topbar-title {
    background: linear-gradient(135deg, #00ff41, #B87333);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(0, 255, 65, 0.4));
}

.theme-matrix-green .topbar-version {
    background: rgba(0, 255, 65, 0.08);
    border-color: rgba(0, 255, 65, 0.2);
    color: #00ff41;
}

.theme-matrix-green .trading-sidebar {
    background: rgba(2, 8, 2, 0.95);
    border-right-color: rgba(0, 255, 65, 0.06);
}

.theme-matrix-green .sidebar-card {
    background: rgba(4, 14, 4, 0.85);
    border-color: rgba(0, 255, 65, 0.06);
}

.theme-matrix-green .sidebar-card::before {
    background: linear-gradient(135deg,
        rgba(0, 255, 65, 0.12) 0%,
        rgba(184, 115, 51, 0.08) 100%);
}

.theme-matrix-green .sidebar-card-header {
    border-bottom-color: rgba(0, 255, 65, 0.04);
}

.theme-matrix-green .wallet-connect-btn {
    background: linear-gradient(135deg, #00ff41, #B87333);
}

.theme-matrix-green .bot-start {
    background: linear-gradient(135deg, #00ff41, #B87333);
    box-shadow: 0 4px 15px rgba(0, 255, 65, 0.2);
}

.theme-matrix-green .bot-start:hover {
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.4), 0 8px 25px rgba(0, 255, 65, 0.2);
}

.theme-matrix-green .filter-btn.active,
.theme-matrix-green .chart-tab.active,
.theme-matrix-green .stab-btn.active,
.theme-matrix-green .btn-modal-save,
.theme-matrix-green .btn-start-empty,
.theme-matrix-green .token-empty-state .btn {
    background: linear-gradient(135deg, #00ff41, #B87333);
}

.theme-matrix-green .toggle.active {
    background: linear-gradient(135deg, #00ff41, #B87333);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.25);
}

.theme-matrix-green .stat-mini-card::before {
    background: linear-gradient(90deg, #00ff41, #B87333);
}

.theme-matrix-green .token-icon {
    background: linear-gradient(135deg, #00ff41, #B87333);
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.3);
}

.theme-matrix-green .token-icon::after {
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.3), rgba(184, 115, 51, 0.2));
}

.theme-matrix-green .token-list-item::before {
    background: linear-gradient(180deg, #00ff41, #B87333);
}

.theme-matrix-green .success-bar-fill {
    box-shadow: 0 0 8px var(--bar-color, #00ff41);
}

.theme-matrix-green .trading-main {
    background: rgba(1, 5, 1, 0.6);
}

.theme-matrix-green .monitoring-header {
    background: rgba(4, 14, 4, 0.7);
    border-color: rgba(0, 255, 65, 0.06);
}

.theme-matrix-green .monitoring-header::before {
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.35), transparent);
}

.theme-matrix-green .token-table-wrapper {
    background: rgba(3, 10, 3, 0.6);
    border-color: rgba(0, 255, 65, 0.05);
}

.theme-matrix-green .token-list-header {
    background: rgba(2, 8, 2, 0.5);
    border-bottom-color: rgba(0, 255, 65, 0.06);
}

.theme-matrix-green .modal-card {
    background: rgba(4, 14, 4, 0.98);
}

.theme-matrix-green .modal-card::before {
    background: linear-gradient(90deg, #00ff41, #B87333, #00ff41);
}

.theme-matrix-green .stat-mini-card {
    background: rgba(2, 8, 2, 0.7);
    border-color: rgba(0, 255, 65, 0.04);
}

.theme-matrix-green .stat-mini-card strong {
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
}

.theme-matrix-green .empty-icon::after {
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.25), rgba(184, 115, 51, 0.15));
}

.theme-matrix-green .search-spinner {
    border-top-color: #00ff41;
    border-right-color: #B87333;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.15);
}

.theme-matrix-green .notification.success {
    border-color: rgba(0, 255, 65, 0.3);
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.1), rgba(4, 14, 4, 0.95));
}

.theme-matrix-green ::selection {
    background: rgba(0, 255, 65, 0.25);
}

.theme-matrix-green *:focus-visible {
    outline-color: rgba(0, 255, 65, 0.5);
}

.theme-matrix-green .pnl-positive {
    color: #00ff41;
    text-shadow: 0 0 12px rgba(0, 255, 65, 0.4);
}

.theme-matrix-green .perf-value.green {
    color: #00ff41;
    text-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
}

.theme-matrix-green .connection-status.connected {
    color: #00ff41;
}

.theme-matrix-green .connection-status.connected .status-dot {
    background: #00ff41;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5), 0 0 20px rgba(0, 255, 65, 0.3);
}

/* ============================================
   PHASE 3-6: PREMIUM VISUAL EFFECTS
   ============================================ */

/* --- Button Ripple Effect --- */
.topbar-btn,
.wallet-connect-btn,
.filter-btn,
.bot-btn,
.wallet-option-btn,
.btn-modal-save,
.btn-modal-cancel,
.btn-start-empty {
    position: relative;
    overflow: hidden;
}

.ripple-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0);
    animation: rippleExpand 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleExpand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* --- 3D Card Tilt Perspective --- */
.sidebar-card {
    transform-style: preserve-3d;
    perspective: 800px;
}

/* --- Aurora / Northern Lights behind sidebar --- */
.trading-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(180deg,
            rgba(184, 115, 51, 0.03) 0%,
            transparent 20%,
            rgba(13, 115, 119, 0.02) 40%,
            transparent 60%,
            rgba(184, 115, 51, 0.03) 80%,
            transparent 100%);
    animation: auroraShift 8s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

.trading-sidebar {
    position: relative;
}

.trading-sidebar > * {
    position: relative;
    z-index: 1;
}

@keyframes auroraShift {
    0% {
        background-position: 0% 0%;
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        background-position: 0% 100%;
        opacity: 0.5;
    }
}

/* --- Noise/Grain Overlay --- */
.trading-page {
    position: relative;
}

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.035;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Skeleton Loading Shimmer --- */
.skeleton-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1.2fr 1fr;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.skeleton-block {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.07) 50%,
        rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

.skeleton-block.wide { height: 18px; }
.skeleton-block.narrow { max-width: 60%; }

.skeleton-row:nth-child(2) .skeleton-block { animation-delay: 0.15s; }
.skeleton-row:nth-child(3) .skeleton-block { animation-delay: 0.3s; }
.skeleton-row:nth-child(4) .skeleton-block { animation-delay: 0.45s; }
.skeleton-row:nth-child(5) .skeleton-block { animation-delay: 0.6s; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- @property for animated conic-gradient borders --- */
@property --border-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

/* --- Rotating Gradient Border on active/hovered card --- */
.sidebar-card.glow-border {
    border-color: transparent;
}

.sidebar-card.glow-border::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 17px;
    padding: 1px;
    background: conic-gradient(
        from var(--border-angle),
        transparent 25%,
        rgba(184, 115, 51, 0.5) 35%,
        rgba(13, 115, 119, 0.5) 50%,
        rgba(13, 115, 119, 0.4) 65%,
        transparent 75%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
    animation: rotateBorder 4s linear infinite;
}

@keyframes rotateBorder {
    to { --border-angle: 360deg; }
}

/* --- Token Row State Flash --- */
.token-list-item.state-flash {
    animation: rowStateFlash 0.6s ease;
}

@keyframes rowStateFlash {
    0% { background: rgba(184, 115, 51, 0.12); }
    100% { background: transparent; }
}

.token-list-item.state-flash-red {
    animation: rowStateFlashRed 0.6s ease;
}

@keyframes rowStateFlashRed {
    0% { background: rgba(255, 71, 87, 0.12); }
    100% { background: transparent; }
}

/* --- PnL Value Flash --- */
.pnl-flash-green {
    animation: pnlPulseGreen 0.5s ease;
}

@keyframes pnlPulseGreen {
    0% { text-shadow: 0 0 20px rgba(184, 115, 51, 0.8); transform: scale(1.15); }
    100% { text-shadow: none; transform: scale(1); }
}

.pnl-flash-red {
    animation: pnlPulseRed 0.5s ease;
}

@keyframes pnlPulseRed {
    0% { text-shadow: 0 0 20px rgba(255, 71, 87, 0.8); transform: scale(1.15); }
    100% { text-shadow: none; transform: scale(1); }
}

/* --- Data-reactive Background Flash --- */
.trading-page.profit-flash::before {
    animation: bgFlashGreen 0.8s ease !important;
}

@keyframes bgFlashGreen {
    0% { box-shadow: inset 0 0 200px rgba(184, 115, 51, 0.1); }
    100% { box-shadow: none; }
}

.trading-page.loss-flash::before {
    animation: bgFlashRed 0.8s ease !important;
}

@keyframes bgFlashRed {
    0% { box-shadow: inset 0 0 200px rgba(255, 71, 87, 0.08); }
    100% { box-shadow: none; }
}

/* --- Mouse-reactive Ambient Glow (CSS variable driven) --- */
.trading-page {
    --glow-x: 50%;
    --glow-y: 50%;
}

/* --- Premium Scrollbar Glow --- */
.trading-page ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(184, 115, 51, 0.3), rgba(13, 115, 119, 0.3));
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(184, 115, 51, 0.15);
}

.trading-page ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(184, 115, 51, 0.5), rgba(13, 115, 119, 0.5));
    box-shadow: 0 0 12px rgba(184, 115, 51, 0.3);
}

/* --- Stat Counter Transition --- */
.stat-mini-card strong {
    display: inline-block;
    transition: transform 0.3s ease;
}

.stat-mini-card strong.counting {
    transform: translateY(-2px);
}

/* --- Animated Chart Glow Point --- */
.chart-glow-point {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #B87333;
    box-shadow: 0 0 12px rgba(184, 115, 51, 0.6);
    animation: chartPointPulse 2s ease-in-out infinite;
}

@keyframes chartPointPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
}

/* wallet stagger animations moved to .wc-row rules above */

.modal-overlay.show .settings-grid {
    animation: modalItemIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
}

@keyframes modalItemIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Notification position relative for progress bar --- */
.notification {
    position: relative;
    overflow: hidden;
}

/* --- Settings tab sliding indicator --- */
.tab-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, #B87333, #E8A87C);
    border-radius: 2px;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(184, 115, 51, 0.4);
}

.theme-solana-night .tab-indicator {
    background: linear-gradient(90deg, #0D7377, #E8A87C);
    box-shadow: 0 0 10px rgba(13, 115, 119, 0.4);
}

.theme-matrix-green .tab-indicator {
    background: linear-gradient(90deg, #00ff41, #B87333);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.4);
}

/* --- Live breathing status ring --- */
.connection-status.connected .status-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(184, 115, 51, 0.3);
    animation: breatheRing 2s ease-in-out infinite;
}

.status-dot {
    position: relative;
}

@keyframes breatheRing {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.6); opacity: 0; }
}

/* --- Magnetic hover feedback --- */
.topbar-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s ease;
}

/* --- Empty state floating animation --- */
.empty-icon {
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* --- Search spinner upgrade --- */
.search-spinner {
    position: relative;
}

.search-spinner::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgba(184, 115, 51, 0.3);
    animation: spin 1.2s linear infinite reverse;
}

/* --- Modal overlay smooth backdrop --- */
.modal-overlay {
    transition: backdrop-filter 0.4s ease;
}

.modal-overlay.show {
    display: flex;
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(10px); }
}

/* --- Sidebar card hover micro-lift with 3D --- */
.sidebar-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(13, 115, 119, 0.08);
    transform: translateY(-2px);
}

/* --- Performance chart container glow --- */
#perfChart {
    border-radius: 8px;
    position: relative;
}

/* --- Token row hover upgrade --- */
.token-list-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease;
}

.token-list-item:hover {
    background: rgba(184, 115, 51, 0.04);
    box-shadow: inset 0 0 30px rgba(184, 115, 51, 0.03);
}

/* --- Prefers reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    #trading-3d-canvas { display: none !important; }
    .noise-overlay { display: none !important; }
}
