/**
 * VAIX Dashboard Styles
 * Matches the landing page aesthetic with dark theme and cyan accents.
 */

/* Dashboard Container */
.vaix-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    overflow-x: hidden;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-title h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #F9FAFB;
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
}

.dashboard-subtitle {
    color: #9CA3AF;
    font-size: 0.875rem;
}

/* VAIX Chat Section - Compact Input-Only Mode */
.vaix-chat-section {
    margin-top: 16px;
    margin-bottom: 86px; /* Measured: match perpetual's ~94px gap */
    max-width: 600px;
    width: 100%;
}

/* VAIX Bot Label */
.vaix-bot-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #00D4FF;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.vaix-bot-label svg {
    opacity: 0.8;
}

/* Constrain the chat container to only show input area */
.vaix-chat-section #vaix-chat-container,
.vaix-chat-section .premium-chat,
.vaix-chat-section .premium-chat.chat3 {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Hide chat header completely */
.vaix-chat-section .chat-header {
    display: none !important;
}

/* Messages area - show when there are messages */
.vaix-chat-section .chat-messages {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 10, 20, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 16px;
}

/* Hide the welcome screen entirely on VAIX dashboard */
.vaix-chat-section .welcome-section {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Collapse the messages area when no real messages */
.vaix-chat-section .chat-messages {
    min-height: 0 !important;
}

.vaix-chat-section .chat-messages:not(.has-messages) {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Ensure messages container doesn't take unnecessary space */
.vaix-chat-section .messages-container {
    min-height: 0 !important;
}

/* Style the input area as a standalone prompt */
/* Override chat3.css padding-bottom: 120px which is for full-page chat */
.vaix-chat-section .chat-input-area {
    border: none;
    background: transparent;
    padding: 0;
    padding-bottom: 0 !important;
}

.vaix-chat-section .chat-input-container {
    background: rgba(0, 15, 25, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 8px 12px;
}

.vaix-chat-section .chat-input-container:focus-within {
    border-color: #00D4FF;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.15);
}

.vaix-chat-section .chat-input {
    background: transparent;
    border: none;
    color: #f0f0f0;
    font-size: 0.9rem;
}

.vaix-chat-section .chat-input::placeholder {
    color: #6B7280;
}

.vaix-chat-section .chat-input:focus {
    outline: none;
    box-shadow: none;
}

/* Style send button */
.vaix-chat-section .send-btn {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.vaix-chat-section .send-btn:hover {
    background: rgba(0, 212, 255, 0.3);
}

/* Hide voice overlay if not needed */
.vaix-chat-section .voice-input-overlay {
    display: none !important;
}

.dashboard-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-btn {
    background: rgba(0, 150, 255, 0.1);
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 8px;
    padding: 8px;
    color: #00D4FF;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(0, 150, 255, 0.2);
    border-color: rgba(0, 150, 255, 0.5);
}

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

.control-btn.spinning svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.chain-selector {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: #E5E7EB;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    cursor: pointer;
}

.chain-selector:focus {
    outline: none;
    border-color: #00D4FF;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(0, 150, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: rgba(0, 150, 255, 0.3);
    background: rgba(17, 24, 39, 0.8);
}

.stat-label {
    color: #9CA3AF;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    color: #F9FAFB;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.stat-change {
    font-size: 0.875rem;
    margin-top: 4px;
}

.stat-change.positive {
    color: #10B981;
}

.stat-change.negative {
    color: #EF4444;
}

.stat-sub {
    color: #6B7280;
    font-size: 0.75rem;
    margin-top: 4px;
}

.stat-sub span {
    color: #9CA3AF;
}

/* Chart Section - minimal styling to avoid white outline */
.chart-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    color: #F9FAFB;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.chart-timeframes {
    display: flex;
    gap: 8px;
}

.tf-btn {
    background: transparent;
    border: 1px solid rgba(0, 150, 255, 0.2);
    border-radius: 6px;
    padding: 6px 12px;
    color: #9CA3AF;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tf-btn:hover {
    border-color: rgba(0, 150, 255, 0.4);
    color: #E5E7EB;
}

.tf-btn.active {
    background: rgba(0, 150, 255, 0.2);
    border-color: #00D4FF;
    color: #00D4FF;
}

.chart-container {
    background: #0a0f19;
    border-radius: 8px;
    overflow: visible;
    min-height: 480px;
    border: 1px solid rgba(0, 150, 255, 0.1);
    box-shadow: none;
}

/* Area chart container */
.vaix-area-chart {
    width: 100%;
    height: 480px;
    background: #0c0f14;
}

.chart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding: 0 8px;
    font-size: 0.75rem;
    color: #6B7280;
}

/* Chart header layout */
.chart-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chart-price-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.chart-current-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: #F9FAFB;
    font-family: 'JetBrains Mono', monospace;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}

.chart-current-price.price-flash {
    color: #00cfff;
    text-shadow: 0 0 8px rgba(0, 207, 255, 0.6);
}

@keyframes price-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.chart-price-change {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
}

.chart-price-change.positive {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
}

.chart-price-change.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

/* Chart controls */
.chart-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-chain-selector {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 6px;
    padding: 6px 10px;
    color: #E5E7EB;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    cursor: pointer;
}

.chart-chain-selector:focus {
    outline: none;
    border-color: #00D4FF;
}

/* Chart status indicator */
.chart-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6B7280;
    transition: background 0.3s ease;
}

.live-dot.connected {
    background: #22c55e;
    animation: pulse-live 2s ease-in-out infinite;
}

.live-dot.error {
    background: #ef4444;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

.chart-tooltip {
    color: #9CA3AF;
    font-family: 'JetBrains Mono', monospace;
    min-width: 150px;
    text-align: center;
}

.chart-sources {
    color: #6B7280;
    font-size: 0.75rem;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.detail-card {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(0, 150, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
}

.detail-card h3 {
    color: #F9FAFB;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
}

/* Volume Breakdown */
.volume-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.volume-bar-container {
    width: 100%;
}

.volume-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.volume-buys {
    background: #10B981;
    transition: width 0.3s ease;
}

.volume-sells {
    background: #EF4444;
    transition: width 0.3s ease;
}

.volume-stats {
    display: flex;
    justify-content: space-between;
}

.volume-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.volume-stat .label {
    color: #6B7280;
    font-size: 0.75rem;
}

.volume-stat .value {
    color: #E5E7EB;
    font-size: 0.875rem;
    font-weight: 600;
}

.volume-stat .pct {
    font-size: 0.75rem;
}

.volume-stat.buys .pct {
    color: #10B981;
}

.volume-stat.sells .pct {
    color: #EF4444;
}

/* Token Info */
.token-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    color: #6B7280;
    font-size: 0.875rem;
}

.info-value {
    color: #E5E7EB;
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
}

.info-value.contract {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-btn {
    background: transparent;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 2px;
    transition: color 0.2s ease;
}

.copy-btn:hover {
    color: #00D4FF;
}

/* Daemon Section */
.daemon-section {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(0, 150, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.daemon-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6B7280;
}

.status-dot.running {
    background: #10B981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.stopped {
    background: #6B7280;
}

.status-dot.error {
    background: #EF4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    color: #9CA3AF;
    font-size: 0.875rem;
}

.daemon-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.daemon-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.daemon-label {
    color: #6B7280;
    font-size: 0.75rem;
}

.daemon-value {
    color: #E5E7EB;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
    margin: 4px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00D4FF, #0096FF);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Last Updated */
.last-updated {
    text-align: center;
    color: #6B7280;
    font-size: 0.75rem;
    padding: 16px 0;
}

.auto-refresh-note {
    color: #4B5563;
}

/* Predict VAIX Section */
.predict-section {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(0, 150, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.predict-section .section-header {
    margin-bottom: 16px;
}

.predict-section .section-header h2 {
    color: #F9FAFB;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

/* Predict Market Info Display */
.predict-market-info {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 255, 157, 0.05);
    border: 1px solid rgba(0, 255, 157, 0.1);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.predict-epoch,
.predict-countdown,
.predict-price {
    color: #9CA3AF;
}

.predict-epoch span,
.predict-countdown span,
.predict-price span {
    color: #00ff9d;
    font-weight: 600;
}

.predict-section.trading-closed .predict-market-info {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.predict-section.trading-closed .predict-countdown span {
    color: #ef4444;
}

/* Blinking ENDED indicator */
.predict-countdown span.ended-blink {
    color: #ff4444;
    animation: vaix-blink-pulse 1s infinite;
}

@keyframes vaix-blink-pulse {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 8px rgba(255, 68, 68, 0.8);
    }
    50% {
        opacity: 0.4;
        text-shadow: none;
    }
}

/* Pool Distribution Display */
.predict-pool-display {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-top: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.predict-pool-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
}

.predict-pool-label {
    font-size: 12px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.predict-pool-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #00D4FF;
}

.predict-pool-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.predict-pool-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.predict-pool-bar-label {
    font-size: 12px;
    font-weight: 700;
    width: 40px;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
}

.predict-pool-bar-label.bull { color: #10B981; }
.predict-pool-bar-label.bear { color: #EF4444; }

.predict-pool-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.predict-pool-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.predict-pool-bar-fill.bull {
    background: linear-gradient(90deg, #10B981 0%, rgba(16, 185, 129, 0.5) 100%);
}

.predict-pool-bar-fill.bear {
    background: linear-gradient(90deg, #EF4444 0%, rgba(239, 68, 68, 0.5) 100%);
}

.predict-pool-bar-amount {
    font-size: 12px;
    color: #9CA3AF;
    min-width: 60px;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
}

@media (max-width: 480px) {
    .predict-pool-display {
        flex-direction: column;
        gap: 10px;
        padding: 10px 12px;
    }

    .predict-pool-total {
        flex-direction: row;
        gap: 8px;
        width: 100%;
        justify-content: center;
    }

    .predict-pool-value {
        font-size: 16px;
    }

    .predict-pool-bars {
        width: 100%;
    }
}

/* Predict Amount Selection */
.predict-amounts {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.predict-amount-btn {
    flex: 1;
    min-width: 60px;
    padding: 10px 16px;
    background: rgba(0, 100, 150, 0.15);
    border: 1px solid rgba(0, 150, 255, 0.25);
    border-radius: 8px;
    color: #9CA3AF;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.2s ease;
}

.predict-amount-btn:hover {
    background: rgba(0, 150, 255, 0.2);
    border-color: rgba(0, 150, 255, 0.4);
    color: #00D4FF;
}

.predict-amount-btn.active {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00D4FF;
    color: #00D4FF;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

/* Custom Amount Input */
.predict-custom-amount {
    flex: 1;
    min-width: 80px;
    max-width: 120px;
    display: flex;
    align-items: center;
    background: rgba(0, 100, 150, 0.15);
    border: 1px solid rgba(0, 150, 255, 0.25);
    border-radius: 8px;
    padding: 0 12px;
    transition: all 0.2s ease;
}

.predict-custom-amount:hover {
    background: rgba(0, 150, 255, 0.2);
    border-color: rgba(0, 150, 255, 0.4);
}

.predict-custom-amount:focus-within,
.predict-custom-amount.active {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00D4FF;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.predict-custom-amount .currency-prefix {
    color: #9CA3AF;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    margin-right: 4px;
}

.predict-custom-amount:focus-within .currency-prefix,
.predict-custom-amount.active .currency-prefix {
    color: #00D4FF;
}

.custom-amount-input {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #9CA3AF;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    padding: 10px 0;
    -moz-appearance: textfield;
}

.custom-amount-input:focus,
.predict-custom-amount.active .custom-amount-input {
    color: #00D4FF;
}

.custom-amount-input::placeholder {
    color: #6B7280;
}

/* Hide number input spinners */
.custom-amount-input::-webkit-outer-spin-button,
.custom-amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.predict-buttons {
    display: flex;
    gap: 12px;
}

.predict-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.predict-btn svg {
    flex-shrink: 0;
}

.predict-btn span {
    font-family: 'JetBrains Mono', monospace;
}

/* Buy/Long Button - Green */
.predict-buy {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10B981;
}

.predict-buy:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10B981;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.predict-buy:active {
    transform: translateY(0);
}

/* Sell/Short Button - Red */
.predict-sell {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #EF4444;
}

.predict-sell:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #EF4444;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.predict-sell:active {
    transform: translateY(0);
}

/* Predict button mobile responsiveness */
@media (max-width: 480px) {
    .predict-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .predict-btn {
        padding: 14px 20px;
    }
}

/* Trading Section */
.trading-section {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(0, 150, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.trading-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.balance-display {
    display: flex;
    gap: 16px;
}

.balance-item {
    font-size: 0.875rem;
    color: #9CA3AF;
}

.balance-item span {
    color: #00D4FF;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

/* Auth Gate */
.trading-auth-gate {
    text-align: center;
    padding: 12px 16px;
}

.auth-btn {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #00D4FF, #0096FF);
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin: 0 8px;
    transition: all 0.2s ease;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.auth-btn.secondary {
    background: transparent;
    border: 1px solid rgba(0, 150, 255, 0.5);
    color: #00D4FF;
}

.auth-btn.secondary:hover {
    background: rgba(0, 150, 255, 0.1);
}

/* Trading Panel - hidden by default, shown via JS when logged in */
.trading-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.trading-panel.visible {
    display: flex;
}

/* Chain Toggle - matches header button style */
.chain-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.chain-btn {
    flex: 1;
    min-height: 44px;
    padding: 10px 12px;
    background: rgba(0, 50, 100, 0.3);
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 10px;
    color: #9DA3A8;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chain-btn:hover {
    background: rgba(0, 100, 255, 0.2);
    border-color: #00cfff;
    color: #00cfff;
}

.chain-btn.active {
    background: rgba(0, 150, 255, 0.3);
    border-color: #00cfff;
    color: #00cfff;
}

.chain-btn.active[data-chain="base"] {
    background: linear-gradient(135deg, rgba(0, 82, 255, 0.2), rgba(0, 132, 255, 0.3));
    border-color: #0084FF;
    color: #4F9EFF;
}

.chain-btn.active[data-chain="ethereum"] {
    background: linear-gradient(135deg, rgba(98, 126, 234, 0.2), rgba(98, 126, 234, 0.3));
    border-color: #627EEA;
    color: #8B9FF3;
}

.chain-btn.active[data-chain="solana"] {
    background: linear-gradient(135deg, rgba(153, 69, 255, 0.2), rgba(0, 255, 163, 0.15));
    border-color: #9945FF;
    color: #B87FFF;
}

/* Trade Tabs */
.trade-tabs {
    display: flex;
    gap: 8px;
}

.trade-tab {
    flex: 1;
    padding: 12px;
    background: rgba(0, 50, 100, 0.2);
    border: 1px solid rgba(0, 150, 255, 0.2);
    border-radius: 8px;
    color: #9CA3AF;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trade-tab:hover {
    background: rgba(0, 80, 150, 0.3);
    border-color: rgba(0, 150, 255, 0.4);
}

.trade-tab.active[data-side="buy"] {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10B981;
    color: #10B981;
}

.trade-tab.active[data-side="sell"] {
    background: rgba(239, 68, 68, 0.2);
    border-color: #EF4444;
    color: #EF4444;
}

/* Trade Form */
.trade-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trade-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trade-input-group label {
    font-size: 0.75rem;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.trade-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(0, 50, 100, 0.3);
    border: 1px solid rgba(0, 150, 255, 0.25);
    border-radius: 8px;
    overflow: hidden;
}

.trade-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px;
    color: #F9FAFB;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.125rem;
    outline: none;
}

.trade-input-wrapper input::placeholder {
    color: #4B5563;
}

.input-suffix {
    padding: 12px;
    color: #6B7280;
    font-size: 0.875rem;
    background: rgba(0, 0, 0, 0.2);
}

.input-suffix.vaix-suffix {
    color: #00D4FF;
    background: rgba(0, 150, 255, 0.15);
}

/* Binance-style Trade Form */
.trade-form.binance-style {
    gap: 12px;
}

.trade-form.binance-style .trade-input-group {
    gap: 6px;
}

/* Price Input (read-only market price) */
.trade-input-wrapper.price-input {
    background: rgba(0, 30, 60, 0.4);
    border-color: rgba(0, 100, 150, 0.3);
}

.trade-input-wrapper.price-input input {
    color: #10B981;
    font-weight: 600;
}

/* Input Hint (price display below field) */
.input-hint {
    font-size: 0.7rem;
    color: #6B7280;
    padding-left: 4px;
}

.input-hint span {
    color: #10B981;
    font-family: 'JetBrains Mono', monospace;
}

/* Percentage Buttons */
.percent-buttons {
    display: flex;
    gap: 6px;
}

.percent-btn {
    flex: 1;
    padding: 6px 8px;
    background: rgba(0, 80, 120, 0.2);
    border: 1px solid rgba(0, 150, 255, 0.15);
    border-radius: 4px;
    color: #9CA3AF;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.15s ease;
}

.percent-btn:hover {
    background: rgba(0, 150, 255, 0.2);
    border-color: rgba(0, 150, 255, 0.3);
    color: #00D4FF;
}

.percent-btn.active {
    background: rgba(0, 180, 255, 0.25);
    border-color: #00D4FF;
    color: #fff;
}

/* Total Row Highlight */
.quote-row.total-row {
    background: rgba(0, 150, 255, 0.1);
    margin: 4px -12px -12px -12px;
    padding: 10px 12px;
    border-radius: 0 0 8px 8px;
    border-top: 1px solid rgba(0, 150, 255, 0.2);
}

.quote-row.total-row .quote-value {
    color: #00D4FF;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Swap Direction Indicator - kept for potential future use */
.swap-direction {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: -4px 0;
    position: relative;
    z-index: 1;
}

.swap-arrow {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 100, 200, 0.3);
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 8px;
    color: #00D4FF;
}

.swap-arrow svg {
    opacity: 0.8;
}

/* VAIX Input Styling */
.trade-input-wrapper.vaix-input {
    border-color: rgba(0, 200, 255, 0.3);
    background: rgba(0, 80, 150, 0.2);
}

.trade-input-wrapper.vaix-input input {
    color: #00D4FF;
}

.vaix-quick .quick-amount-btn {
    background: rgba(0, 150, 255, 0.1);
    border-color: rgba(0, 200, 255, 0.2);
}

.vaix-quick .quick-amount-btn:hover {
    background: rgba(0, 200, 255, 0.2);
    border-color: rgba(0, 200, 255, 0.4);
}

/* Quick Amounts */
.quick-amounts {
    display: flex;
    gap: 8px;
}

.quick-amount-btn {
    flex: 1;
    padding: 8px;
    background: rgba(0, 100, 200, 0.15);
    border: 1px solid rgba(0, 150, 255, 0.2);
    border-radius: 6px;
    color: #00D4FF;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-amount-btn:hover {
    background: rgba(0, 150, 255, 0.25);
    border-color: rgba(0, 150, 255, 0.4);
}

.quick-amount-btn.active {
    background: rgba(0, 180, 255, 0.3);
    border-color: #00D4FF;
    color: #fff;
}

/* Quote Preview */
.quote-preview {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.quote-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.quote-row:last-child {
    border-bottom: none;
}

.quote-label {
    color: #6B7280;
    font-size: 0.8rem;
}

.quote-value {
    color: #E5E7EB;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.quote-value.warning {
    color: #F59E0B;
}

.quote-value.error {
    color: #EF4444;
}

.fee-row {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.fee-row .quote-label {
    color: #9CA3AF;
}

/* Execute Button */
.execute-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #10B981, #059669);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.execute-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.execute-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Funding Actions */
.funding-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.funding-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 8px;
    color: #00D4FF;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.funding-btn:hover {
    background: rgba(0, 150, 255, 0.1);
    border-color: rgba(0, 150, 255, 0.5);
}

.funding-btn.deposit {
    border-color: rgba(16, 185, 129, 0.5);
    color: #10B981;
}

.funding-btn.deposit:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10B981;
}

.funding-btn.withdraw {
    border-color: rgba(239, 68, 68, 0.3);
    color: #EF4444;
}

.funding-btn.withdraw:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Check Deposit - Real-time WebSocket monitoring */
.check-deposit-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.deposit-monitor {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 200, 150, 0.08);
    border: 1px solid rgba(0, 200, 150, 0.2);
    border-radius: 6px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: #9CA3AF;
}

.deposit-monitor .live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    animation: pulse-live 2s ease-in-out infinite;
}

.deposit-monitor .live-dot.disconnected {
    background: #6B7280;
    animation: none;
}

.deposit-monitor .live-dot.connecting {
    background: #F59E0B;
    animation: pulse-live 1s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px rgba(16, 185, 129, 0.6); }
    50% { opacity: 0.5; box-shadow: 0 0 8px rgba(16, 185, 129, 0.8); }
}

.deposit-monitor-text {
    color: #00C896;
}

.deposit-monitor.connected {
    border-color: rgba(16, 185, 129, 0.3);
}

.deposit-status {
    font-size: 12px;
    color: #9CA3AF;
    font-family: 'JetBrains Mono', monospace;
}

.deposit-status.success {
    color: #10B981;
    animation: highlight-success 0.5s ease;
}

.deposit-status.error {
    color: #EF4444;
}

@keyframes highlight-success {
    0% { background: rgba(16, 185, 129, 0.3); }
    100% { background: transparent; }
}

/* Deposit notification toast */
.deposit-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.5);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Notification Toast */
.vaix-trade-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.vaix-trade-notification.success {
    border-color: rgba(16, 185, 129, 0.5);
}

.vaix-trade-notification.error {
    border-color: rgba(239, 68, 68, 0.5);
}

.notif-icon {
    font-size: 1.25rem;
}

.notif-message {
    color: #E5E7EB;
    font-size: 0.9rem;
}

.notif-link {
    color: #00D4FF;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 4px 8px;
    background: rgba(0, 150, 255, 0.1);
    border-radius: 4px;
}

.notif-link:hover {
    background: rgba(0, 150, 255, 0.2);
}

.notif-close {
    background: transparent;
    border: none;
    color: #6B7280;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 4px;
}

.notif-close:hover {
    color: #E5E7EB;
}

/* Soft Notification - Small, subtle toast for validation messages */
.vaix-soft-notification {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(100, 116, 139, 0.4);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    font-size: 0.85rem;
    max-width: 280px;
    backdrop-filter: blur(8px);
}

.vaix-soft-notification.info {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.1);
}

.vaix-soft-notification.warning {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.1);
}

.vaix-soft-notification.error {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
}

.vaix-soft-notification.success {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.1);
}

.soft-notif-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.soft-notif-message {
    color: #E5E7EB;
    line-height: 1.4;
}

/* Button Spinner */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.trade-tab.processing {
    opacity: 0.8;
    cursor: wait;
}

/* Quote Loading Animation */
.quote-loading {
    display: inline-block;
    color: #6B7280;
    animation: quote-pulse 1s ease-in-out infinite;
}

@keyframes quote-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .vaix-dashboard {
        padding: 12px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-title h1 {
        font-size: 1.5rem;
    }

    /* Chat section mobile - match perpetual spacing */
    .vaix-chat-section {
        margin-top: 16px;
        margin-bottom: 5px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .daemon-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-container iframe {
        height: 450px !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .daemon-stats {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Chart section mobile fixes - prevent horizontal overflow */
    .chart-header-left {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .chart-header-left h2 {
        font-size: 1rem;
    }

    .chart-controls {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .chart-timeframes {
        gap: 4px;
    }

    .tf-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .chart-chain-selector {
        flex: 1;
        min-width: 0;
        font-size: 0.7rem;
        padding: 4px 6px;
    }

    .chart-price-display {
        font-size: 0.85rem;
    }

    .chart-current-price {
        font-size: 1rem;
    }

    /* Predict section mobile - wrap amount buttons */
    .predict-amounts {
        flex-wrap: wrap;
        gap: 6px;
    }

    .predict-amount-btn {
        min-width: 50px;
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .predict-custom-amount {
        min-width: 70px;
        max-width: 100px;
        padding: 0 8px;
    }

    .custom-amount-input {
        font-size: 0.8rem;
    }
}

/* Small mobile (375px) - enhanced text readability */
@media (max-width: 375px) {
    .stat-value {
        font-size: 1.1rem;
    }

    .stat-sub {
        font-size: 0.75rem;
    }

    .predict-epoch, .predict-countdown, .predict-price {
        font-size: 0.8rem;
    }

    .predict-btn span {
        font-size: 0.9rem;
    }

    /* Trading section text */
    .balance-display {
        font-size: 0.8rem;
    }

    /* General labels and secondary text */
    .chart-status,
    .chart-sources,
    .chart-tooltip {
        font-size: 0.75rem;
    }

    /* Ensure tap targets are at least 44px */
    .tf-btn,
    .predict-amount-btn,
    .predict-btn {
        min-height: 44px;
    }
}

/* ======================================
   Chain Badges & Aggregated Orderbook
   ====================================== */

/* Chain badges (inline in orderbook levels) */
.chain-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-right: 6px;
    flex-shrink: 0;
}

/* Base chain - cyan/blue theme */
.chain-badge.base {
    background: rgba(0, 132, 255, 0.2);
    color: #00D4FF;
    border: 1px solid rgba(0, 132, 255, 0.3);
}

/* Solana chain - purple theme */
.chain-badge.solana {
    background: rgba(153, 69, 255, 0.2);
    color: #9945FF;
    border: 1px solid rgba(153, 69, 255, 0.3);
}

/* Ethereum chain - blue-white theme */
.chain-badge.ethereum {
    background: rgba(98, 126, 234, 0.2);
    color: #627EEA;
    border: 1px solid rgba(98, 126, 234, 0.3);
}

/* Per-chain liquidity breakdown */
.chain-liquidity-breakdown {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.chain-liquidity-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chain-liq-value {
    color: #E5E7EB;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Orderbook level with chain indicator - updated layout for chain badge */
/* Use higher specificity to override vaix-leaderboard.css 3-column grid */
.orderbook-section .orderbook-level {
    display: grid;
    grid-template-columns: 36px 1fr 1fr 0.8fr;  /* Chain logo, Price, Size, Impact */
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: background 0.15s ease;
    position: relative;
    align-items: center;
}

.orderbook-section .orderbook-level:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Chain badge in orderbook levels - logo version */
.orderbook-section .orderbook-level .chain-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 4px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.orderbook-section .orderbook-level .chain-badge:hover {
    transform: scale(1.1);
}

/* Chain logo image */
.orderbook-section .orderbook-level .chain-badge .chain-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Base chain badge */
.orderbook-section .orderbook-level .chain-badge.base {
    background: rgba(0, 82, 255, 0.15);
    border: 1px solid rgba(0, 82, 255, 0.3);
}

.orderbook-section .orderbook-level .chain-badge.base:hover {
    box-shadow: 0 0 8px rgba(0, 82, 255, 0.4);
}

/* Solana chain badge */
.orderbook-section .orderbook-level .chain-badge.solana {
    background: rgba(153, 69, 255, 0.15);
    border: 1px solid rgba(153, 69, 255, 0.3);
}

.orderbook-section .orderbook-level .chain-badge.solana:hover {
    box-shadow: 0 0 8px rgba(153, 69, 255, 0.4);
}

/* Ethereum chain badge */
.orderbook-section .orderbook-level .chain-badge.ethereum {
    background: rgba(98, 126, 234, 0.15);
    border: 1px solid rgba(98, 126, 234, 0.3);
}

.orderbook-section .orderbook-level .chain-badge.ethereum:hover {
    box-shadow: 0 0 8px rgba(98, 126, 234, 0.4);
}

/* Arbitrum chain badge */
.orderbook-section .orderbook-level .chain-badge.arbitrum {
    background: rgba(40, 160, 240, 0.15);
    border: 1px solid rgba(40, 160, 240, 0.3);
}

.orderbook-section .orderbook-level .chain-badge.arbitrum:hover {
    box-shadow: 0 0 8px rgba(40, 160, 240, 0.4);
}

.orderbook-section .orderbook-level.chain-base::before {
    border-left: 2px solid #00D4FF;
}

.orderbook-section .orderbook-level.chain-solana::before {
    border-left: 2px solid #9945FF;
}

.orderbook-section .orderbook-level.chain-ethereum::before {
    border-left: 2px solid #627EEA;
}

/* Orderbook table header row */
.orderbook-row.header {
    display: grid;
    grid-template-columns: 36px 1fr 1fr 0.8fr;  /* Chain logo, Price, Size, Impact */
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.25rem;
}

.orderbook-row.header .col-chain {
    font-weight: 600;
    text-align: center;
}

.orderbook-row.header .col-price {
    font-weight: 600;
}

.orderbook-row.header .col-size {
    text-align: right;
    font-weight: 600;
}

.orderbook-row.header .col-impact {
    text-align: right;
    font-weight: 600;
}

/* Aggregated mode visual enhancements */
.orderbook-section[data-mode="aggregated"] .orderbook-side-header {
    position: relative;
}

.orderbook-section[data-mode="aggregated"] .orderbook-side-header::after {
    content: "All Chains";
    position: absolute;
    right: 0;
    font-size: 0.75rem;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Chain summary bar (shows total liquidity per chain) */
.chain-summary-bar {
    display: flex;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.chain-summary-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.chain-summary-segment.base {
    background: #00D4FF;
}

.chain-summary-segment.solana {
    background: #9945FF;
}

/* Responsive adjustments for chain badges */
@media (max-width: 768px) {
    .chain-badge {
        width: 22px;
        height: 22px;
        padding: 3px;
        margin-right: 4px;
    }

    .orderbook-level .chain-badge .chain-logo {
        width: 16px;
        height: 16px;
    }

    .chain-liquidity-breakdown {
        flex-direction: column;
        gap: 8px;
    }
}

/* ========================================
   Order Confirmation Modal
   ======================================== */

.order-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.order-modal {
    background: linear-gradient(180deg, #0d1520 0%, #0a0f19 100%);
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 150, 255, 0.1);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.order-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.order-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #F9FAFB;
    font-family: 'JetBrains Mono', monospace;
}

.order-modal-close {
    background: none;
    border: none;
    color: #6B7280;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.order-modal-close:hover {
    color: #F9FAFB;
}

.order-modal-body {
    padding: 20px;
}

/* Order Type Badge */
.order-type-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1rem;
}

.order-type-badge.buy {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10B981;
}

.order-type-badge.sell {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #EF4444;
}

.order-type-icon {
    font-size: 1.2rem;
}

/* Order Details */
.order-details {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.order-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.order-detail-row.total {
    padding-top: 12px;
}

.order-detail-label {
    color: #9CA3AF;
    font-size: 0.85rem;
}

.order-detail-value {
    color: #F9FAFB;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 500;
}

.order-detail-value.highlight {
    color: #00D4FF;
    font-size: 1.1rem;
    font-weight: 600;
}

.order-detail-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

/* Order Warning */
.order-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    margin-bottom: 16px;
    color: #F59E0B;
    font-size: 0.85rem;
}

.order-warning svg {
    flex-shrink: 0;
}

/* Modal Action Buttons */
.order-modal-actions {
    display: flex;
    gap: 12px;
}

.order-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'JetBrains Mono', monospace;
}

.order-btn.cancel {
    background: rgba(107, 114, 128, 0.2);
    border: 1px solid rgba(107, 114, 128, 0.3);
    color: #9CA3AF;
}

.order-btn.cancel:hover {
    background: rgba(107, 114, 128, 0.3);
    color: #F9FAFB;
}

.order-btn.confirm {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border: none;
    color: #fff;
}

.order-btn.confirm:hover {
    background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.order-btn.confirm.sell {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

.order-btn.confirm.sell:hover {
    background: linear-gradient(135deg, #F87171 0%, #EF4444 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.order-btn.confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 480px) {
    .order-modal {
        max-width: 100%;
        margin: 10px;
    }

    .order-modal-actions {
        flex-direction: column;
    }
}

/* ========================================
   Professional Stacked Orderbook
   (Binance/Coinbase Pro Style)
   ======================================== */

.pro-orderbook {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(0, 150, 255, 0.15);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 24px;
}

.pro-orderbook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pro-orderbook-header h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #F9FAFB;
}

.pro-orderbook-mid {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pro-mid-price {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: #00D4FF;
}

.pro-mid-label {
    font-size: 0.75rem;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Column Headers */
.pro-orderbook-columns {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 60px;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.75rem;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pro-orderbook-columns .col-size,
.pro-orderbook-columns .col-depth {
    text-align: right;
}

/* Asks Section (Sells - RED) */
.pro-asks {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse; /* Best ask at bottom */
}

.pro-asks .pro-level {
    background: linear-gradient(to left, rgba(239, 68, 68, 0.1), transparent);
}

.pro-asks .pro-level:hover {
    background: linear-gradient(to left, rgba(239, 68, 68, 0.2), transparent);
}

.pro-asks .pro-level .pro-level-price {
    color: #EF4444;
}

.pro-asks .pro-level .pro-depth-bar {
    background: rgba(239, 68, 68, 0.4);
}

/* Bids Section (Buys - GREEN) */
.pro-bids {
    max-height: 200px;
    overflow-y: auto;
}

.pro-bids .pro-level {
    background: linear-gradient(to left, rgba(16, 185, 129, 0.1), transparent);
}

.pro-bids .pro-level:hover {
    background: linear-gradient(to left, rgba(16, 185, 129, 0.2), transparent);
}

.pro-bids .pro-level .pro-level-price {
    color: #10B981;
}

.pro-bids .pro-level .pro-depth-bar {
    background: rgba(16, 185, 129, 0.4);
}

/* Individual Level Row */
.pro-level {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 60px;
    gap: 8px;
    padding: 6px 16px;
    min-height: 36px;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    transition: background 0.15s ease;
    position: relative;
}

.pro-level:hover {
    cursor: pointer;
}

/* Chain badge in pro orderbook */
.pro-level .pro-chain-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 4px;
    border-radius: 6px;
    transition: transform 0.15s ease;
}

.pro-level .pro-chain-badge img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.pro-level .pro-chain-badge.base {
    background: rgba(0, 82, 255, 0.15);
    border: 1px solid rgba(0, 82, 255, 0.3);
}

.pro-level .pro-chain-badge.ethereum {
    background: rgba(98, 126, 234, 0.15);
    border: 1px solid rgba(98, 126, 234, 0.3);
}

.pro-level .pro-chain-badge.solana {
    background: rgba(153, 69, 255, 0.15);
    border: 1px solid rgba(153, 69, 255, 0.3);
}

.pro-level .pro-chain-badge.arbitrum {
    background: rgba(40, 160, 240, 0.15);
    border: 1px solid rgba(40, 160, 240, 0.3);
}

.pro-level-price {
    font-weight: 600;
}

.pro-level-size {
    text-align: right;
    color: #E5E7EB;
}

/* Depth bar container */
.pro-level-depth {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.pro-depth-bar {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.pro-depth-text {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    color: #9CA3AF;
}

/* Spread Indicator (Middle Bar) */
.pro-spread {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pro-spread-label {
    font-size: 0.75rem;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pro-spread-value {
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: #F59E0B;
}

.pro-spread-prices {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
}

.pro-best-ask {
    color: #EF4444;
}

.pro-best-bid {
    color: #10B981;
}

/* Pro orderbook footer */
.pro-orderbook-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: 0.75rem;
    color: #6B7280;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Loading state */
.pro-orderbook-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6B7280;
    font-size: 0.9rem;
}

/* Mobile responsive for pro orderbook */
@media (max-width: 768px) {
    .pro-orderbook-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 16px;
    }

    .pro-orderbook-columns {
        grid-template-columns: 32px 1fr 1fr 50px;
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .pro-level {
        grid-template-columns: 32px 1fr 1fr 50px;
        padding: 8px 12px;
        min-height: 44px; /* Touch-friendly height */
        font-size: 0.8rem;
    }

    .pro-level .pro-chain-badge {
        width: 24px;
        height: 24px;
    }

    .pro-level .pro-chain-badge img {
        width: 16px;
        height: 16px;
    }

    .pro-asks,
    .pro-bids {
        max-height: 180px;
    }

    .pro-spread {
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .pro-orderbook-columns {
        grid-template-columns: 28px 1fr 1fr;
        gap: 6px;
    }

    .pro-orderbook-columns .col-depth {
        display: none;
    }

    .pro-level {
        grid-template-columns: 28px 1fr 1fr;
        gap: 6px;
    }

    .pro-level-depth {
        display: none;
    }

    .pro-level .pro-chain-badge {
        width: 22px;
        height: 22px;
    }

    .pro-level .pro-chain-badge img {
        width: 14px;
        height: 14px;
    }
}

/* ===== COMMENTS SECTION ===== */
.vaix-comments-section {
    background: #111827;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.vaix-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.vaix-comments-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #F9FAFB;
    margin: 0;
}

.vaix-comments-count {
    font-size: 0.875rem;
    color: #9CA3AF;
}

/* Comment Form */
.vaix-comment-form {
    background: #1F2937;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.vaix-comment-input-wrapper {
    display: flex;
    gap: 12px;
}

.vaix-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(0, 212, 255, 0.3);
}

.vaix-comment-input {
    flex: 1;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: #F9FAFB;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 70px;
    max-height: 200px;
    transition: border-color 0.2s ease;
}

.vaix-comment-input:focus {
    outline: none;
    border-color: #00D4FF;
}

.vaix-comment-input::placeholder {
    color: #6B7280;
}

.vaix-comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.vaix-comment-char-count {
    font-size: 0.75rem;
    color: #6B7280;
}

.vaix-comment-submit {
    background: #00D4FF;
    color: #111827;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vaix-comment-submit:hover:not(:disabled) {
    background: #00B8E0;
    transform: translateY(-1px);
}

.vaix-comment-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Login Prompt */
.vaix-comment-login-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    background: #1F2937;
    border-radius: 8px;
    margin-bottom: 20px;
}

.vaix-comment-login-prompt span {
    color: #9CA3AF;
    font-size: 0.9rem;
}

.vaix-login-btn {
    background: #00D4FF;
    color: #111827;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vaix-login-btn:hover {
    background: #00B8E0;
    transform: translateY(-1px);
}

/* Replying Indicator */
.vaix-replying-to {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    margin-bottom: 16px;
}

.vaix-replying-to span {
    color: #9CA3AF;
    font-size: 0.875rem;
}

.vaix-replying-to strong {
    color: #00D4FF;
}

.vaix-cancel-reply {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #9CA3AF;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vaix-cancel-reply:hover {
    border-color: #EF4444;
    color: #EF4444;
}

/* Comments List */
.vaix-comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.vaix-comments-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6B7280;
    text-align: center;
    gap: 8px;
}

.vaix-comments-empty-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

/* Single Comment */
.vaix-comment-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #1F2937;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.2s ease;
}

.vaix-comment-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.vaix-comment-item.is-reply {
    margin-left: 52px;
    background: rgba(31, 41, 55, 0.6);
    border-left: 2px solid rgba(0, 212, 255, 0.3);
}

.vaix-comment-avatar-wrapper {
    flex-shrink: 0;
}

.vaix-comment-content {
    flex: 1;
    min-width: 0;
}

.vaix-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.vaix-comment-author {
    font-weight: 600;
    color: #F9FAFB;
    font-size: 0.9rem;
}

.vaix-comment-time {
    color: #6B7280;
    font-size: 0.75rem;
}

.vaix-comment-edited {
    color: #6B7280;
    font-size: 0.75rem;
    font-style: italic;
}

.vaix-comment-text {
    color: #D1D5DB;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

.vaix-comment-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.vaix-comment-action {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #6B7280;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.vaix-comment-action:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #9CA3AF;
}

.vaix-comment-action.liked {
    color: #EF4444;
}

.vaix-comment-action.delete:hover {
    color: #EF4444;
}

.vaix-like-icon {
    font-size: 1rem;
}

.vaix-like-count {
    min-width: 12px;
}

/* Replies Container */
.vaix-comment-replies {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Load More Button */
.vaix-load-more {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: #00D4FF;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vaix-load-more:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: #00D4FF;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .vaix-comments-section {
        padding: 16px;
        margin-top: 16px;
    }

    .vaix-comment-input-wrapper {
        flex-direction: column;
    }

    .vaix-comment-avatar {
        width: 36px;
        height: 36px;
    }

    .vaix-comment-form-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .vaix-comment-char-count {
        text-align: center;
    }

    .vaix-comment-submit {
        width: 100%;
    }

    .vaix-comment-item {
        padding: 12px;
    }

    .vaix-comment-item.is-reply {
        margin-left: 24px;
    }

    .vaix-comment-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .vaix-comment-login-prompt {
        flex-direction: column;
        gap: 12px;
    }
}

/* ================================
   AI AGENTS LEADERBOARD (same as /perpetual)
   ================================ */
.agents-leaderboard {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(17, 24, 39, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    overflow: hidden;
    max-width: 100%;
}

.agents-lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.agents-lb-title {
    font-size: 12px;
    font-weight: 700;
    color: #00cfff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agents-lb-link {
    font-size: 12px;
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.2s;
}

.agents-lb-link:hover {
    color: #00cfff;
}

.agents-lb-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.agents-lb-list::-webkit-scrollbar {
    display: none;
}

.agent-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    min-width: 140px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.agent-card:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.4);
}

.agent-rank {
    font-size: 14px;
    min-width: 20px;
    text-align: center;
}

.agent-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 2px solid var(--agent-color, #00cfff);
}

.agent-info {
    flex: 1;
    min-width: 0;
}

.agent-name {
    font-size: 12px;
    font-weight: 600;
    color: #F9FAFB;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-stats {
    display: flex;
    gap: 6px;
    font-size: 12px;
}

.agent-profit {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.agent-profit.positive { color: #10b981; }
.agent-profit.negative { color: #ef4444; }

.agent-winrate {
    color: #9CA3AF;
}

.agents-lb-empty {
    text-align: center;
    padding: 12px;
    color: #9CA3AF;
    font-size: 12px;
}

.agents-lb-loading {
    display: flex;
    justify-content: center;
    padding: 12px;
}

.agents-lb-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 212, 255, 0.2);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: agents-spin 0.8s linear infinite;
}

@keyframes agents-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .agents-leaderboard {
        padding: 8px 10px;
        margin-bottom: 10px;
        max-width: 100vw;
        overflow: hidden;
    }

    .agents-lb-list {
        max-width: 100%;
    }

    .agent-card {
        min-width: 120px;
        padding: 6px 8px;
    }

    .agent-avatar {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .agent-name {
        font-size: 12px;
    }
}

/* ============================================
   Time & Sales Section
   Wall Street-grade trade tape display
   ============================================ */

.time-sales-section {
    background: rgba(10, 15, 25, 0.9);
    border: 1px solid rgba(0, 150, 255, 0.2);
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
}

.time-sales-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 150, 255, 0.15);
    background: rgba(17, 24, 39, 0.4);
}

.time-sales-header h2 {
    color: #F9FAFB;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
}

/* Connection Status */
.time-sales-header .connection-status,
#timeSalesStatus {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
}

#timeSalesStatus.ts-connected {
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

#timeSalesStatus.ts-disconnected {
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

#timeSalesStatus.ts-connecting,
#timeSalesStatus.ts-reconnecting {
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Stats Bar */
.ts-stats-bar {
    display: flex;
    gap: 24px;
    padding: 12px 20px;
    background: rgba(17, 24, 39, 0.3);
    border-bottom: 1px solid rgba(0, 150, 255, 0.1);
}

.ts-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ts-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
}

.ts-stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: #F9FAFB;
}

/* Column Headers */
.ts-columns {
    display: grid;
    grid-template-columns: 100px 90px 80px 50px 40px 30px;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(0, 150, 255, 0.15);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
}

.ts-columns span {
    white-space: nowrap;
}

/* Trade List Container */
.ts-trade-list {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar */
.ts-trade-list::-webkit-scrollbar {
    width: 6px;
}

.ts-trade-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.ts-trade-list::-webkit-scrollbar-thumb {
    background: rgba(0, 150, 255, 0.3);
    border-radius: 3px;
}

.ts-trade-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 150, 255, 0.5);
}

/* Trade Row */
.ts-trade-row {
    display: grid;
    grid-template-columns: 100px 90px 80px 50px 40px 30px;
    gap: 8px;
    padding: 8px 20px;
    font-size: 0.8125rem;
    font-family: 'JetBrains Mono', monospace;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.15s ease;
}

.ts-trade-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Buy/Sell Colors */
.ts-trade-row.ts-buy {
    color: #10B981;
}

.ts-trade-row.ts-sell {
    color: #EF4444;
}

/* Side text styling */
.ts-trade-row .ts-side {
    font-weight: 600;
    font-size: 0.75rem;
}

/* Large Trade Highlighting */
.ts-trade-row.ts-large-trade {
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid #F59E0B;
}

.ts-trade-row.ts-medium-trade {
    border-left: 3px solid rgba(245, 158, 11, 0.4);
}

/* New Trade Animation */
.ts-trade-row.ts-new-trade {
    animation: ts-flash 0.5s ease-out;
}

.ts-trade-row.ts-buy.ts-new-trade {
    animation: ts-flash-buy 0.5s ease-out;
}

.ts-trade-row.ts-sell.ts-new-trade {
    animation: ts-flash-sell 0.5s ease-out;
}

@keyframes ts-flash-buy {
    0% {
        background: rgba(16, 185, 129, 0.3);
    }
    100% {
        background: transparent;
    }
}

@keyframes ts-flash-sell {
    0% {
        background: rgba(239, 68, 68, 0.3);
    }
    100% {
        background: transparent;
    }
}

@keyframes ts-flash {
    0% {
        background: rgba(255, 255, 255, 0.15);
    }
    100% {
        background: transparent;
    }
}

/* Individual Column Styling */
.ts-trade-row .ts-time {
    color: #9CA3AF;
    font-size: 0.75rem;
}

.ts-trade-row .ts-price {
    font-weight: 500;
}

.ts-trade-row .ts-size {
    color: #D1D5DB;
}

.ts-trade-row .ts-chain {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ts-trade-row .ts-chain img {
    border-radius: 50%;
    opacity: 0.8;
}

.ts-trade-row .ts-tx {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ts-trade-row .ts-tx a {
    color: #6B7280;
    transition: color 0.15s ease;
}

.ts-trade-row .ts-tx a:hover {
    color: #00D4FF;
}

/* No Trades Message */
.ts-no-trades {
    text-align: center;
    padding: 40px 20px;
    color: #6B7280;
    font-size: 0.875rem;
}

/* Footer */
.ts-footer {
    padding: 10px 20px;
    background: rgba(17, 24, 39, 0.3);
    border-top: 1px solid rgba(0, 150, 255, 0.1);
}

.ts-footer-text {
    font-size: 0.75rem;
    color: #6B7280;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ts-columns,
    .ts-trade-row {
        grid-template-columns: 70px 70px 60px 40px 30px 24px;
        gap: 4px;
        padding: 8px 12px;
    }

    .ts-stats-bar {
        gap: 16px;
        padding: 10px 12px;
        flex-wrap: wrap;
    }

    .ts-trade-row .ts-time {
        font-size: 0.75rem;
    }

    .ts-trade-row {
        font-size: 0.75rem;
    }

    .time-sales-header {
        padding: 12px 16px;
    }

    .time-sales-header h2 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .ts-columns,
    .ts-trade-row {
        grid-template-columns: 55px 60px 55px 35px 24px 20px;
        gap: 2px;
        padding: 6px 10px;
    }

    .ts-trade-list {
        max-height: 300px;
    }

    .ts-trade-row .ts-side {
        font-size: 0.75rem;
    }

    .ts-stat-value {
        font-size: 0.75rem;
    }
}
