:root {
    /* Raydium Color Scheme - Exact Match */
    --primary: #2bb085;
    --primary-dark: #239970;
    --primary-light: #6BD5FF;
    --primary-hover: #239970;
    --secondary: #2bb085;
    --success: #27AE60;
    --danger: #EB5757;
    --warning: #F2994A;
    
    /* Raydium Background Colors - Exact Match */
    --bg-primary: #171720; /* Main dark background */
    --bg-secondary: #242436; /* Panel/container background */
    --bg-tertiary: #2D2D44; /* Input fields, darker panels */
    --bg-hover: #2D2D44;
    --bg-active: #3D3D5C;
    
    /* Raydium Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #B8B8D1;
    --text-muted: #6C6C8A;
    --text-disabled: #4A4A5C;
    
    /* Raydium Border Colors */
    --border: #2D2D44;
    --border-light: #3D3D5C;
    --border-hover: #2bb085;
    
    /* Shadows - Raydium style */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    /* Accent color (flat, no gradients) */
    --accent: #2bb085;
    --accent-muted: rgba(43, 176, 133, 0.15);
    --accent-border: rgba(43, 176, 133, 0.4);
    
    /* Chart Colors - Raydium style */
    --chart-green: #00D9A5; /* Bullish/green candles */
    --chart-red: #FF6B9D; /* Bearish/red candles */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: #0f1118;
    color: var(--text-primary);
    min-height: 100vh;
    padding-top: 70px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#swap-page {
    background: #0f1118;
    padding: 0;
    margin: 0;
}

#swap-page.page.active {
    display: block;
    background: #0f1118;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(23, 23, 32, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 0 20px;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-logo-img {
    height: 34px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    display: block;
}

.nav-brand i {
    font-size: 1.2em;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-link {
    padding: 8px 12px;
    border-radius: 8px;
    color: #9ca3af;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 150ms ease;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.nav-link:hover {
    color: #ffffff;
    background: #1a1b26;
}

.nav-link.active {
    color: #ffffff;
    background: #1a1b26;
}

.nav-badge {
    display: inline-block;
    border-radius: 6px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 4px rgba(43, 176, 133, 0.3);
}

.btn-connect {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent-border);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

/* Override for gradient button in nav */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-total-value {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
}

.nav-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 27, 38, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(45, 46, 58, 0.3);
    border-radius: 10px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 150ms ease;
    position: relative;
}

.nav-icon-btn:hover {
    background: rgba(26, 27, 38, 0.8);
    backdrop-filter: blur(10px);
    color: #ffffff;
    border-color: rgba(45, 46, 58, 0.6);
}

.nav-icon-btn i {
    font-size: 18px;
}

.nav-notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #0c0d14;
}

.btn-connect-gradient-nav {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--accent-border);
    border-radius: 12px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
}

.btn-connect-gradient-nav:hover {
    background: var(--accent-muted);
    border-color: var(--accent);
}

.btn-connect:hover {
    background: var(--accent-muted);
    border-color: var(--accent);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Swap Page (Uniswap-style centered) */
/* ============================================
   RAYDIUM-STYLE SWAP PAGE STYLES
   ============================================ */

/* ============================================
   RAYDIUM SWAP PAGE - EXACT REPLICA
   ============================================ */

/* Swap Page Layout */
.swap-page-layout {
    display: flex;
    gap: 24px;
    padding: 24px;
    min-height: calc(100vh - 70px);
    justify-content: center;
    align-items: flex-start;
    background: #0f1118;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .swap-page-layout {
        flex-direction: column;
        align-items: center;
    }
}

/* Chart Card */
.swap-chart-card {
    flex: 1;
    min-width: 500px;
    max-width: 800px;
    background: #1c1e2a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

/* Chart Header */
.chart-header-swap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2d3348;
}

.chart-pair-info-swap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-token-icons-swap {
    display: flex;
    align-items: center;
}

.chart-token-icon-swap {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.chart-token-icon-overlap {
    margin-left: -8px;
}

.chart-pair-name-swap {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.chart-swap-pair-btn-swap {
    padding: 4px;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    transition: color 150ms ease;
}

.chart-swap-pair-btn-swap:hover {
    color: #ffffff;
}

/* OHLC Data */
.chart-ohlc-swap {
    display: flex;
    gap: 16px;
    font-size: 12px;
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

.ohlc-item-swap {
    color: #9ca3af;
}

.ohlc-value-swap {
    margin-left: 4px;
}

.ohlc-item-swap.high .ohlc-value-swap {
    color: #22c55e;
}

.ohlc-item-swap.low .ohlc-value-swap {
    color: #ef4444;
}

.ohlc-change-swap {
    font-weight: 500;
}

.ohlc-change-swap.positive {
    color: #22c55e;
}

.ohlc-change-swap.negative {
    color: #ef4444;
}

/* Chart Controls */
.chart-controls-swap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #1f2433;
}

.chart-controls-left-swap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-timeframe-selector-swap-new {
    display: flex;
    gap: 4px;
}

.chart-timeframe-btn-swap {
    padding: 4px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    cursor: pointer;
    transition: all 150ms ease;
}

.chart-timeframe-btn-swap:hover {
    color: #ffffff;
}

.chart-timeframe-btn-swap.active {
    color: #ffffff;
    background: #2d3348;
}

.chart-divider-swap {
    width: 1px;
    height: 16px;
    background: #2d3348;
    margin: 0 8px;
}

.chart-type-icons-swap {
    display: flex;
    gap: 4px;
}

.chart-type-btn-swap {
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #6b7280;
    cursor: pointer;
    transition: all 150ms ease;
}

.chart-type-btn-swap:hover,
.chart-type-btn-swap.active {
    color: #ffffff;
    background: #2d3348;
}

.chart-indicators-btn-swap {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 150ms ease;
}

.chart-indicators-btn-swap:hover {
    color: #ffffff;
}

.chart-controls-right-swap {
    display: flex;
    gap: 4px;
}

.chart-tool-btn-swap {
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #6b7280;
    cursor: pointer;
    transition: all 150ms ease;
}

.chart-tool-btn-swap:hover {
    color: #ffffff;
    background: #2d3348;
}

/* Chart Container */
.chart-container-swap {
    height: 380px;
    background: #131520;
    position: relative;
    overflow: hidden;
}

/* Unified swap timeframe buttons (header + footer) */
.swap-tf-btn {
    padding: 4px 8px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    transition: all 150ms ease;
    font-family: 'Inter', sans-serif;
}
.swap-tf-btn:hover {
    color: #ffffff;
}
.swap-tf-btn.active {
    color: #ffffff;
    background: #2d3348;
}

/* OHLC label styling */
.ohlc-label-swap {
    color: #6b7280;
    font-size: 11px;
}

/* Chart fullscreen overlay modal */
.chart-fs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.2s ease;
}
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}
.chart-fs-modal {
    width: 92vw;
    max-width: 1400px;
    height: 82vh;
    background: #0d0f17;
    border: 1px solid #1f2433;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.chart-fs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #1f2433;
    flex-shrink: 0;
}
.chart-fs-ohlc {
    font-size: 12px;
    color: #e5e7eb;
    margin-left: 16px;
    font-family: 'JetBrains Mono', monospace;
}
.chart-fs-timeframes {
    display: flex;
    gap: 4px;
}
.chart-fs-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #2d3348;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s;
}
.chart-fs-close:hover {
    color: #fff;
    background: #2d3348;
}
.chart-fs-container {
    flex: 1;
    min-height: 0;
}

/* Chart tool active state */
.chart-tool-btn-swap.active {
    color: #2bb085;
    background: rgba(43, 176, 133, 0.15);
}

/* Indicator panel dropdown */
.chart-indicator-panel {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: #1a1b26;
    border: 1px solid #2d3348;
    border-radius: 8px;
    padding: 8px 0;
    min-width: 200px;
    display: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.chart-indicator-panel.show { display: block; }
.chart-indicator-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    cursor: pointer;
    color: #e5e7eb;
    font-size: 13px;
    transition: background 150ms;
}
.chart-indicator-item:hover { background: #2d3348; }
.chart-indicator-item .indicator-check {
    color: #2bb085;
    opacity: 0;
    transition: opacity 150ms;
}
.chart-indicator-item.active .indicator-check { opacity: 1; }

/* Chart Footer */
.chart-footer-swap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    border-top: 1px solid #1f2433;
}

.chart-footer-left-swap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tradingview-logo-swap {
    width: 20px;
    height: 20px;
    opacity: 0.5;
}

.chart-footer-timeframes-swap {
    display: flex;
    gap: 4px;
}

.footer-timeframe-btn-swap {
    padding: 4px 8px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
    transition: all 150ms ease;
}

.footer-timeframe-btn-swap:hover {
    color: #ffffff;
}

.footer-timeframe-btn-swap.active {
    color: #2bb085;
    background: rgba(43, 176, 133, 0.1);
}

.chart-footer-right-swap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-timestamp-swap {
    font-size: 11px;
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    color: #6b7280;
}

.chart-scale-btns-swap {
    display: flex;
    gap: 8px;
}

.chart-scale-btn-swap {
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 150ms ease;
}

.chart-scale-btn-swap:hover,
.chart-scale-btn-swap.active {
    color: #2bb085;
}

.chart-settings-btn-swap {
    padding: 4px;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    transition: color 150ms ease;
}

.chart-settings-btn-swap:hover {
    color: #ffffff;
}

/* Swap Panel Wrapper */
.swap-panel-wrapper {
    width: 420px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Swap Header */
.swap-header-new {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.swap-header-left-new {
    display: flex;
    align-items: center;
    gap: 12px;
}

.buy-crypto-btn-new {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 150ms ease;
}

.buy-crypto-btn-new:hover i {
    color: #22d9a0;
}

.buy-crypto-btn-new i {
    font-size: 18px;
    color: #2bb085;
    transition: color 150ms ease;
}

/* Inline Buy Panel */
.buy-inline-panel {
    margin-top: -1px;
}

.buy-inline-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.buy-inline-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 150ms ease;
}

.buy-inline-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.buy-inline-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

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

.buy-fiat-selector,
.buy-token-selector {
    position: relative;
}

.buy-inline-select {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 16px;
}

.buy-inline-providers {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.buy-provider-option {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 150ms ease;
}

.buy-provider-option:hover {
    border-color: rgba(43, 176, 133, 0.4);
    background: rgba(43, 176, 133, 0.06);
}

.buy-provider-option.selected {
    border-color: #2bb085;
    background: rgba(43, 176, 133, 0.1);
}

.provider-name {
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 2px;
}

.provider-desc {
    font-size: 12px;
    color: #6b7280;
}

.buy-now-inline-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.buy-inline-disclaimer {
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    margin: 0;
}

.swap-header-right-new {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slippage-btn-new {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: #232536;
    border: 1px solid #2d3348;
    border-radius: 8px;
    cursor: pointer;
    transition: all 150ms ease;
}

.slippage-btn-new:hover {
    border-color: #3d4563;
}

.slippage-btn-new i {
    width: 14px;
    height: 14px;
    color: #9ca3af;
}

.slippage-btn-new span {
    font-size: 12px;
    color: #ffffff;
}

.swap-header-icon-btn-new {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 150ms ease;
}

.swap-header-icon-btn-new:hover {
    background: #232536;
    color: #ffffff;
}

.swap-header-icon-btn-new i {
    width: 18px;
    height: 18px;
}

/* Swap Card */
.swap-card-new {
    background: #1c1e2a;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Input Section */
.swap-input-section-new {
    margin-bottom: 8px;
}

.swap-input-label-new {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.swap-label-text-new {
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
}

.swap-balance-section-new {
    display: flex;
    align-items: center;
    gap: 8px;
}

.swap-balance-icon-new {
    width: 14px;
    height: 14px;
    color: #6b7280;
}

.swap-balance-value-new {
    font-size: 12px;
    color: #6b7280;
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

.swap-max-btn-new,
.swap-half-btn-new {
    padding: 4px 8px;
    background: #232536;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    transition: all 150ms ease;
}

.swap-max-btn-new:hover,
.swap-half-btn-new:hover {
    color: #ffffff;
}

/* Token Input Container */
.token-input-container-new {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #232536;
    border-radius: 16px;
    border: 1px solid transparent;
    transition: all 150ms ease;
}

.token-input-container-new:focus-within {
    border-color: #2bb085;
    box-shadow: 0 0 0 2px rgba(43, 176, 133, 0.1);
}

/* Token Selector */
.token-selector-new {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #1c1e2a;
    border-radius: 12px;
    cursor: pointer;
    min-width: 120px;
    transition: all 150ms ease;
}

.token-selector-new:hover {
    background: #282a3e;
}

.token-selector-icon-new {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.token-selector-symbol-new {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.token-selector-chevron-new {
    width: 16px;
    height: 16px;
    color: #6b7280;
    margin-left: auto;
}

/* Amount Input */
.amount-input-wrapper-new {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.amount-input-new {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 24px;
    font-weight: 600;
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    color: #ffffff;
    text-align: right;
}

.amount-input-new::placeholder {
    color: #4b5563;
}

.amount-usd-value-new {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Swap Arrow */
.swap-arrow-container-new {
    display: flex;
    justify-content: center;
    margin: -4px 0;
    position: relative;
    z-index: 1;
}

.swap-arrow-btn-new {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1c1e2a;
    border: 4px solid #0f1118;
    border-radius: 12px;
    cursor: pointer;
    transition: all 150ms ease;
}

.swap-arrow-btn-new:hover {
    background: #282a3e;
    transform: rotate(180deg);
}

.swap-arrow-btn-new i {
    width: 20px;
    height: 20px;
    color: #2bb085;
}

/* Swap Details */
.swap-details-new {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #2d3348;
}

.swap-details-row-new {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 12px;
}

.swap-details-label-new {
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
}

.swap-details-value-new {
    color: #ffffff;
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

.swap-details-value-new.positive {
    color: #22c55e;
}

.swap-details-value-new.muted {
    color: #6b7280;
}

/* Connect Wallet Button */
.connect-wallet-btn-new {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    background: #239970;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 200ms ease;
}

.connect-wallet-btn-new:hover:not(:disabled) {
    background: #1e8560;
    box-shadow: 0 0 30px rgba(35, 153, 112, 0.3);
    transform: translateY(-1px);
}

.connect-wallet-btn-new:disabled {
    background: #2d3348;
    color: #6b7280;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.connect-wallet-btn-new.error {
    background: #2d3348;
    color: #ef4444;
}

/* Left Column - Chart Panel - Raydium Style */
.swap-chart-panel {
    background: var(--bg-secondary);
    border-radius: 16px;
    margin: 8px 4px 8px 8px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 16px);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.chart-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 16px;
}

.chart-pair-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.pair-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pair-icons-overlap {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 4px;
}

.pair-token-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-secondary);
}

.pair-icon-back {
    position: relative;
    z-index: 1;
}

.pair-icon-front {
    position: relative;
    margin-left: -8px;
    z-index: 2;
}

.pair-display span {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-primary);
}

.pair-switch-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.pair-switch-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.chart-timeframe-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 8px;
}

.chart-timeframe-display span {
    color: var(--text-primary);
    font-weight: 500;
}

.chart-indicators-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.chart-indicators-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.chart-fx-label {
    font-size: 0.8em;
    color: var(--text-muted);
}

.chart-ohlcv-display {
    display: flex;
    gap: 12px;
    font-size: 0.85em;
    color: var(--text-muted);
    flex-wrap: wrap;
    align-items: center;
}

.chart-ohlcv-display span {
    color: var(--text-muted);
    white-space: nowrap;
}

.chart-ohlcv-display span span {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 4px;
}

.chart-ohlcv-display .price-change {
    margin-left: 4px;
}

.chart-ohlcv-display .price-change.positive {
    color: #4ade80;
}

.chart-ohlcv-display .price-change.negative {
    color: #f87171;
}

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

.chart-control-icon {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.chart-control-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.chart-control-icon.active {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

.chart-container-main {
    flex: 1;
    position: relative;
    min-height: 400px;
    padding: 16px 20px;
}

.chart-container-main canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-controls-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}

.chart-timeframe-selector-swap {
    display: flex;
    gap: 4px;
}

.timeframe-btn-swap {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85em;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.timeframe-btn-swap:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.timeframe-btn-swap.active {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

.chart-time-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-time-display span {
    font-size: 0.85em;
    color: var(--text-muted);
}

.chart-options-swap {
    display: flex;
    gap: 12px;
}

.chart-options-swap label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85em;
    color: var(--text-muted);
    cursor: pointer;
}

.chart-options-swap input[type="checkbox"] {
    cursor: pointer;
}

/* Right Column - Swap Interface Panel - Raydium Style */
.swap-interface-panel {
    background: var(--bg-secondary);
    border-radius: 16px;
    margin: 8px 8px 8px 4px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 16px);
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.swap-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.swap-tab-header {
    display: flex;
    gap: 0;
}

.swap-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -2px;
    position: relative;
}

.swap-tab:hover {
    color: var(--text-primary);
}

.swap-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.swap-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 8px rgba(43, 176, 133, 0.5);
}

.swap-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.swap-header-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.swap-header-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.swap-header-icon i {
    font-size: 0.9em;
}

.swap-form-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.swap-input-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.swap-quick-amounts-top {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-bottom: 4px;
}

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

.swap-label {
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: 500;
}

.swap-token-input-wrapper {
    display: flex;
    gap: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    transition: border-color 0.2s;
    align-items: center;
    min-height: 72px;
}

.swap-token-input-wrapper:focus-within {
    border-color: var(--primary);
}

.swap-token-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
    flex-shrink: 0;
}

.swap-token-selector:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.token-icon-large {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.token-symbol-large {
    font-weight: 600;
    font-size: 1em;
    color: var(--text-primary);
}

.swap-token-selector i {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-left: auto;
}

.swap-amount-input-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    flex: 1;
    min-width: 0;
    gap: 4px;
}

.swap-amount-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5em;
    font-weight: 600;
    outline: none;
    width: 100%;
    text-align: right;
    padding: 0;
    margin: 0;
}

.swap-estimated-value-inline {
    font-size: 0.75em;
    color: var(--text-muted);
    text-align: right;
}

.swap-amount-input::-webkit-inner-spin-button,
.swap-amount-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.swap-amount-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.swap-quick-amounts-top {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.swap-quick-amounts {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.quick-amount-btn {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-amount-btn:hover {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.swap-estimated-value {
    padding-top: 6px;
    padding-right: 16px;
    font-size: 0.85em;
    color: var(--text-muted);
    text-align: right;
    align-self: flex-end;
}

.swap-direction-container {
    display: flex;
    justify-content: center;
    margin: -12px 0;
    position: relative;
    z-index: 10;
}

.swap-direction-btn {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 50%;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.3em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.swap-direction-btn:hover {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
    transform: rotate(180deg) scale(1.08);
}

.swap-direction-btn:active {
    transform: rotate(180deg) scale(1.0);
}

.swap-info-details {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid var(--border);
}

.swap-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.swap-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.swap-info-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: 500;
}

.info-tooltip-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.info-tooltip-btn:hover {
    color: var(--text-primary);
}

.swap-info-value {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text-primary);
}

.swap-info-separator {
    color: var(--text-muted);
    font-size: 0.9em;
}

.swap-price-update-notification {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(43, 176, 133, 0.1);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 8px;
    backdrop-filter: blur(10px);
}

.price-update-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-update-label {
    font-size: 0.9em;
    color: var(--text-primary);
    font-weight: 500;
}

.price-update-accept-btn {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--accent-border);
    border-radius: 8px;
    color: var(--accent);
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.price-update-accept-btn:hover {
    background: var(--accent-muted);
    border-color: var(--accent);
}

.swap-execute-btn {
    width: 100%;
    padding: 16px;
    background: transparent;
    border: 1px solid var(--accent-border);
    border-radius: 16px;
    color: var(--accent);
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

.swap-execute-btn:hover:not(:disabled) {
    background: var(--accent-muted);
    border-color: var(--accent);
}

.swap-execute-btn:active:not(:disabled) {
    opacity: 0.8;
}

.swap-execute-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: var(--border-color);
    color: var(--text-disabled);
}

.swap-execute-btn:disabled:hover {
    transform: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .swap-layout-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
    
    .swap-chart-panel {
        min-height: 500px;
        max-height: 600px;
    }
    
    .swap-interface-panel {
        border-left: none;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 768px) {
    .swap-layout-container {
        height: auto;
        min-height: calc(100vh - 80px);
    }
    
    .chart-panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-controls-top {
        width: 100%;
        justify-content: flex-end;
    }
    
    .swap-token-input-wrapper {
        flex-direction: column;
    }
    
    .swap-token-selector {
        width: 100%;
        justify-content: space-between;
    }
    
    .swap-amount-input {
        text-align: left;
    }
    
    .swap-quick-amounts {
        justify-content: flex-start;
    }
}

.swap-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    min-height: calc(100vh - 70px);
}

.swap-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.swap-card {
    max-width: 480px;
    width: 100%;
}

.swap-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
}

.swap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.swap-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5em;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.swap-input-group {
    margin-bottom: 20px;
}

.swap-input-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.balance {
    color: var(--text-muted);
}

.swap-input {
    display: flex;
    gap: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.swap-input input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5em;
    outline: none;
}

.swap-input input::placeholder {
    color: var(--text-muted);
}

.btn-token-select {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-token-select:hover {
    background: var(--bg-tertiary);
}

.btn-token-select img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.swap-divider {
    display: flex;
    justify-content: center;
    margin: -10px 0;
    position: relative;
    z-index: 1;
}

.btn-swap-direction {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-swap-direction:hover {
    background: var(--bg-tertiary);
    transform: rotate(180deg);
}

.swap-info {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 15px;
    margin: 20px 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.info-row:last-child {
    margin-bottom: 0;
}

.btn-primary {
    width: 100%;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent-border);
    padding: 16px;
    border-radius: 16px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.15s ease;
    letter-spacing: 0.3px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-muted);
    border-color: var(--accent);
}

.btn-primary:active:not(:disabled) {
    opacity: 0.8;
}

.btn-primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: var(--border-color);
    color: var(--text-disabled);
}

.swap-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
}

.card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.pool-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
}

.stat-item span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

/* Pools Page (Raydium-style) */
.pools-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 2em;
}

/* Pool Type Tabs */
.pool-type-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.pool-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.pool-tab:hover {
    color: var(--text-primary);
}

.pool-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.pool-tab i {
    font-size: 0.9em;
}

/* Filters Bar */
.pools-filters-bar {
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-input-large {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 1em;
    outline: none;
    min-width: 300px;
}

.search-input-large::placeholder {
    color: var(--text-muted);
}

.filter-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    outline: none;
    min-width: 150px;
}

/* Pools Table View */
.pools-table-view {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.pools-table {
    width: 100%;
    border-collapse: collapse;
}

.pools-table thead {
    background: var(--bg-tertiary);
}

.pools-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pools-table td {
    padding: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-primary);
}

.pools-table tbody tr {
    transition: background 0.2s;
}

.pools-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.pool-row-tokens {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pool-row-tokens .token-pair {
    display: flex;
    align-items: center;
}

.pool-row-tokens img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    margin-left: -10px;
}

.pool-row-tokens img:first-child {
    margin-left: 0;
}

.pool-row-name {
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pool-row-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8em;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.pool-row-fee {
    font-weight: 600;
    color: var(--primary);
}

.pool-row-actions {
    display: flex;
    gap: 10px;
}

.pool-row-actions button {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.pool-row-actions button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pools-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.pools-empty-state h3 {
    margin: 20px 0 10px;
    color: var(--text-primary);
}

.pools-empty-state p {
    margin-bottom: 30px;
}

.search-input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 1em;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.pools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.pool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.pool-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.pool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.pool-tokens {
    display: flex;
    align-items: center;
    gap: 10px;
}

.token-pair {
    display: flex;
    align-items: center;
}

.token-pair img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    margin-left: -10px;
}

.token-pair img:first-child {
    margin-left: 0;
}

.pool-label {
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8em;
    color: var(--text-muted);
}

.pool-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.pool-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pool-stat-label {
    color: var(--text-muted);
    font-size: 0.85em;
}

.pool-stat-value {
    font-size: 1.1em;
    font-weight: 600;
}

/* Analytics Page */
.analytics-container {
    max-width: 1400px;
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: var(--primary);
}

.stat-content {
    flex: 1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-change {
    font-size: 0.85em;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

.stat-change.neutral {
    color: var(--text-muted);
}

.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.chart-card h3 {
    margin-bottom: 20px;
}

.top-pools-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.top-pools-section h2 {
    margin-bottom: 20px;
}

/* Tokens Page */
.tokens-container {
    max-width: 1400px;
    margin: 0 auto;
}

.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-tertiary);
}

.data-table th {
    padding: 15px;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
}

.data-table td {
    padding: 15px;
    border-top: 1px solid var(--border);
}

.data-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.token-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.token-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.token-name {
    font-weight: 600;
}

.token-symbol {
    color: var(--text-muted);
    font-size: 0.9em;
}

.price-change {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
}

.price-change.positive {
    background: rgba(39, 174, 96, 0.2);
    color: var(--success);
}

.price-change.negative {
    background: rgba(235, 87, 87, 0.2);
    color: var(--danger);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.5em;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5em;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-large {
    max-width: 600px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9em;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 1em;
    outline: none;
    transition: all 0.2s;
}

.form-group input[type="number"]:focus,
.form-group input[type="text"]:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 176, 133, 0.1);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

.form-hint {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.85em;
}

.input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-suffix input {
    padding-right: 60px;
}

.input-suffix {
    position: absolute;
    right: 15px;
    color: var(--text-muted);
    font-size: 0.9em;
    pointer-events: none;
}

.full-width {
    width: 100%;
}

.fee-options {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.fee-btn {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.fee-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.fee-btn.active {
    background: var(--accent-muted);
    border-color: var(--accent);
    color: var(--accent);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.form-actions button {
    flex: 1;
}

.form-actions .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.token-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.token-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.token-item:hover {
    background: var(--bg-tertiary);
}

.token-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.token-details {
    flex: 1;
}

.token-details .token-name {
    display: block;
    font-weight: 600;
}

.token-details .token-symbol {
    display: block;
    color: var(--text-muted);
    font-size: 0.9em;
}

.setting-item {
    margin-bottom: 25px;
}

.setting-item label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.slippage-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.slippage-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.slippage-btn:hover {
    background: var(--bg-primary);
}

.slippage-btn.active {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

#customSlippage {
    flex: 1;
    min-width: 100px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 8px;
    outline: none;
}

#txDeadline {
    width: 100px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 8px;
    outline: none;
    margin-right: 10px;
}

/* Responsive */
@media (max-width: 1024px) {
    .swap-container {
        grid-template-columns: 1fr;
    }
    
    .swap-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .pools-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
}

/* Launchpad Styles */
.launchpad-container {
    max-width: 1400px;
    margin: 0 auto;
}

.launchpad-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.launch-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.launch-tab:hover { color: var(--text-primary); }
.launch-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.launch-tab i { font-size: 0.9em; }

.launchpad-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.launchpad-info h2 {
    margin-bottom: 15px;
    font-size: 2em;
}

.launchpad-info p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1em;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.feature-card i {
    font-size: 2em;
    color: var(--primary);
    margin-bottom: 15px;
}

.feature-card h3 {
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 15px;
}

.feature-btn {
    background: transparent;
    border: 1px solid var(--accent-border);
    color: var(--accent);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
    width: 100%;
}

.feature-btn:hover {
    background: var(--accent-muted);
    border-color: var(--accent);
}

.feature-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.launch-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.launch-type-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.launch-type-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.launch-type-card i {
    font-size: 2.5em;
    color: var(--primary);
    margin-bottom: 15px;
}

.launch-type-card h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.launch-type-card p {
    color: var(--text-muted);
    font-size: 0.9em;
}

.launches-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.launch-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s;
}

.launch-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

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

.launch-token-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.launch-token-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.launch-token-info h3 {
    margin: 0;
    color: var(--text-primary);
}

.launch-symbol {
    color: var(--text-muted);
    font-size: 0.9em;
}

.launch-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.launch-status.active {
    background: rgba(39, 174, 96, 0.2);
    color: var(--success);
}

.launch-status.upcoming {
    background: rgba(242, 153, 74, 0.2);
    color: var(--warning);
}

.launch-status.completed {
    background: rgba(43, 176, 133, 0.2);
    color: var(--primary);
}

.launch-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 15px;
}

.launch-stat {
    text-align: center;
}

.launch-stat .stat-label {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-bottom: 5px;
}

.launch-stat .stat-value {
    color: var(--text-primary);
    font-size: 1.2em;
    font-weight: 600;
}

.launch-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.launch-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
}

.launch-actions {
    display: flex;
    gap: 10px;
}

/* Portfolio Styles */
.portfolio-container {
    max-width: 1400px;
    margin: 0 auto;
}

.portfolio-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.portfolio-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
}

.portfolio-stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.portfolio-stat-card .stat-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--text-primary);
}

.portfolio-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.portfolio-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.portfolio-tab:hover { color: var(--text-primary); }
.portfolio-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.portfolio-tab i { font-size: 0.9em; }

.portfolio-content {
    margin-top: 30px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.liquidity-positions {
    display: grid;
    gap: 20px;
}

.position-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.rewards-list {
    display: grid;
    gap: 15px;
}

.reward-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Perpetuals Styles */
.perpetuals-container {
    max-width: 1600px;
    margin: 0 auto;
}

.perpetuals-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
}

.perpetual-market-selector {
    margin-bottom: 20px;
}

.market-select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 1.1em;
    cursor: pointer;
    outline: none;
}

.trading-view {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.trading-chart {
    height: 400px;
    margin-bottom: 20px;
}

.trading-panel {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.trading-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.trading-tab {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.trading-tab:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.trading-tab.active {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

.order-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-type {
    display: flex;
    gap: 10px;
}

.order-type-btn {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.order-type-btn.active {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

.order-input-group {
    display: flex;
    gap: 10px;
}

.order-input-group input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 8px;
    outline: none;
}

.order-input-group select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
}

.order-book {
    max-height: 300px;
    overflow-y: auto;
}

.order-book-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9em;
}

.market-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (max-width: 1024px) {
    .perpetuals-layout {
        grid-template-columns: 1fr;
    }
    
    .launchpad-content {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Info Pages Styles (XSwap-style) */
.info-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.info-header {
    margin-bottom: 30px;
}

.info-header h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
}

.info-tab {
    padding: 15px 30px;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    font-weight: 500;
}

.info-tab:hover {
    color: var(--text-primary);
}

.info-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.info-tab-content {
    display: none;
    margin-top: 30px;
}

.info-tab-content.active {
    display: block;
}

.nav-divider {
    width: 1px;
    height: 30px;
    background: var(--border);
    margin: 0 10px;
}

/* Overview Page */
.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.overview-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    color: var(--primary);
    flex-shrink: 0;
}

.stat-content-large {
    flex: 1;
}

.stat-content-large .stat-label {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.stat-value-large {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.overview-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.chart-card-large {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
}

.chart-card-large h3 {
    margin-bottom: 20px;
    font-size: 1.3em;
}

.chart-card-large canvas {
    max-height: 300px;
}

.overview-tables {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.table-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
}

.table-section h3 {
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Info Filters */
.info-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.search-input-large {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1em;
    outline: none;
}

.search-input-large::placeholder {
    color: var(--text-muted);
}

.filter-select-large {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    outline: none;
    min-width: 200px;
}

/* Large Data Tables */
.data-table-large {
    width: 100%;
    border-collapse: collapse;
}

.data-table-large thead {
    background: var(--bg-tertiary);
}

.data-table-large th {
    padding: 18px;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border);
}

.data-table-large td {
    padding: 18px;
    border-bottom: 1px solid var(--border);
}

.data-table-large tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.data-table-large tbody tr:hover {
    background: var(--bg-tertiary);
}

.pools-table-section,
.tokens-table-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
}

/* Responsive for Info Pages */
@media (max-width: 1024px) {
    .overview-charts {
        grid-template-columns: 1fr;
    }
    
    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .info-tabs {
        flex-wrap: wrap;
    }
    
    .info-tab {
        padding: 12px 20px;
        font-size: 0.9em;
    }
    
    .overview-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-icon-large {
        width: 60px;
        height: 60px;
        font-size: 2em;
    }
    
    .stat-value-large {
        font-size: 2em;
    }
    
    .info-filters {
        flex-direction: column;
    }
    
    .filter-select-large {
        width: 100%;
    }
}

/* Token Info Display */
.token-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.token-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
}

.token-info .token-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
    line-height: 1.2;
}

.token-info .token-symbol {
    font-size: 0.85em;
    color: var(--text-muted);
    line-height: 1.2;
}

/* Refined Button Styles */
.btn-primary {
    background: transparent;
    border: 1px solid var(--accent-border);
    color: var(--accent);
    font-weight: 600;
    transition: all 0.15s ease;
}

.btn-primary:hover {
    background: var(--accent-muted);
    border-color: var(--accent);
}

.btn-primary:active {
    opacity: 0.8;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Smooth Transitions */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Enhanced Card Hover Effects */
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Price Change Indicators */
.price-change {
    font-weight: 600;
    font-size: 0.9em;
}

.price-change.positive {
    color: var(--success);
}

.price-change.negative {
    color: var(--danger);
}

.price-change.neutral {
    color: var(--text-muted);
}

/* Stat Change Indicators */
.stat-change {
    font-size: 0.85em;
    font-weight: 500;
    margin-top: 4px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

.stat-change.neutral {
    color: var(--text-muted);
}

/* ============================================
   RAYDIUM-STYLE PERPETUALS PAGE STYLES
   ============================================ */

/* Perpetuals Container */
.perpetuals-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

/* Market Info Bar */
.perp-market-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 15px;
}

.market-info-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.market-pair-selector {
    display: flex;
    align-items: center;
}

.market-pair-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
}

.market-pair-btn:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
}

.market-pair-btn i {
    color: var(--text-muted);
    font-size: 0.9em;
}

.market-pair-btn i.active {
    color: #ffd700;
}

.market-price-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.current-price {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.market-details {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.market-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.75em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-primary);
}

.market-info-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.risk-rate-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.risk-label {
    font-size: 0.75em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.risk-value {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-primary);
}

/* Perpetuals Layout Grid */
.perpetuals-layout-grid {
    display: grid;
    grid-template-columns: 240px 1fr 380px;
    grid-template-rows: 1fr auto;
    gap: 1px;
    background: var(--border);
    flex: 1;
    overflow: hidden;
}

/* Left Sidebar - Trading Pairs */
.perp-pairs-sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    height: 100%;
}

.pairs-list {
    padding: 8px;
}

.pair-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.pair-item:hover {
    background: var(--bg-tertiary);
}

.pair-item.active {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary);
}

.pair-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.pair-symbol {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
}

.pair-price {
    font-size: 0.85em;
    color: var(--text-muted);
}

.pair-change {
    font-size: 0.85em;
    font-weight: 600;
}

.pair-change.positive {
    color: var(--success);
}

.pair-change.negative {
    color: var(--danger);
}

/* Chart Area */
.perp-chart-area {
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.chart-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-timeframe {
    color: var(--text-muted);
    font-size: 0.9em;
}

.chart-ohlc {
    display: flex;
    gap: 16px;
    font-size: 0.85em;
}

.chart-ohlc span {
    color: var(--text-muted);
}

.chart-ohlc span span {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 4px;
}

.chart-timeframe-selector {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.timeframe-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85em;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.timeframe-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.timeframe-btn.active {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

.chart-container {
    flex: 1;
    position: relative;
    min-height: 400px;
    padding: 16px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-volume {
    height: 120px;
    padding: 0 16px 16px;
}

.volume-chart-container {
    width: 100%;
    height: 100%;
}

.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.chart-control-left,
.chart-control-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-range-selector {
    display: flex;
    gap: 4px;
}

.range-btn {
    padding: 4px 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8em;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.range-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.range-btn.active {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

.current-time {
    font-size: 0.85em;
    color: var(--text-muted);
}

.chart-options {
    display: flex;
    gap: 12px;
}

.chart-options label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85em;
    color: var(--text-muted);
    cursor: pointer;
}

.chart-options input[type="checkbox"] {
    cursor: pointer;
}

/* Trading Panel */
.perp-trading-panel {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.wallet-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 20px;
}

.wallet-prompt-content {
    text-align: center;
    max-width: 300px;
}

.wallet-prompt-content i {
    font-size: 3em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.wallet-prompt-content h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.wallet-prompt-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 0.9em;
}

.perp-trading-form {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.perp-order-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.perp-order-tab {
    padding: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.perp-order-tab:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.perp-order-tab.active {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

.perp-order-tab[data-side="buy"].active {
    background: var(--success);
}

.perp-order-tab[data-side="sell"].active {
    background: var(--danger);
}

.perp-order-type-selector,
.perp-leverage-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.perp-order-type-selector label,
.perp-leverage-selector label {
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: 500;
}

.order-type-select,
.leverage-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95em;
    cursor: pointer;
    outline: none;
}

.perp-available-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.perp-available-balance span:first-child {
    font-size: 0.85em;
    color: var(--text-muted);
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-display span {
    font-weight: 600;
    color: var(--text-primary);
}

.icon-btn-small {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn-small:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--primary);
}

.perp-price-input,
.perp-quantity-input,
.perp-order-size {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.perp-price-input label,
.perp-quantity-input label,
.perp-order-size label {
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: 500;
}

.price-input-group,
.quantity-input-group,
.order-size-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
}

.price-input-group input,
.quantity-input-group input,
.order-size-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 1em;
    outline: none;
}

.price-currency,
.quantity-currency,
.order-size-currency {
    padding: 0 12px;
    font-size: 0.9em;
    color: var(--text-muted);
    font-weight: 500;
}

.price-quick-buttons {
    display: flex;
    gap: 4px;
}

.quick-price-btn {
    padding: 4px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-price-btn:hover {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

.order-size-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    color: var(--text-primary);
    font-size: 0.9em;
    cursor: pointer;
    outline: none;
}

.perp-percentage-slider {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-container {
    position: relative;
}

.slider-container input[type="range"] {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: var(--text-muted);
    margin-top: 4px;
}

.max-buy-btn {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.max-buy-btn:hover {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

.perp-order-btn {
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.perp-order-btn.buy-btn {
    background: var(--success);
}

.perp-order-btn.buy-btn:hover {
    background: #22c55e;
}

.perp-order-btn.sell-btn {
    background: var(--danger);
}

.perp-order-btn.sell-btn:hover {
    background: #ef4444;
}

.perp-tpsl-toggle,
.perp-reduce-only {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 40px;
    height: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    position: relative;
    transition: all 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 1px;
    left: 1px;
    transition: all 0.2s;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

.toggle-label {
    font-size: 0.9em;
    color: var(--text-primary);
    font-weight: 500;
}

.perp-tpsl-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.tpsl-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9em;
    cursor: pointer;
    outline: none;
}

.tpsl-tp,
.tpsl-sl {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tpsl-tp label,
.tpsl-sl label {
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: 500;
}

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

.tpsl-input-group input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95em;
    outline: none;
}

.tpsl-offset {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tpsl-offset input {
    flex: 1;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.85em;
    outline: none;
}

.tpsl-offset span {
    font-size: 0.85em;
    color: var(--text-muted);
}

.icon-btn-tiny {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75em;
    transition: all 0.2s;
}

.icon-btn-tiny:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--primary);
}

.perp-order-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.order-options-checkboxes,
.order-confirm-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.checkbox-label-small {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8em;
    color: var(--text-muted);
    cursor: pointer;
}

/* Order Book */
.perp-order-book {
    grid-column: 1;
    grid-row: 2;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    max-height: 300px;
    overflow: hidden;
}

.order-book-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.order-book-header h3 {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text-primary);
}

.precision-select {
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8em;
    cursor: pointer;
    outline: none;
}

.order-book-table {
    flex: 1;
    overflow-y: auto;
}

.order-book-table-inner {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.order-book-table-inner thead th {
    padding: 8px 12px;
    text-align: right;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8em;
    text-transform: uppercase;
    background: var(--bg-tertiary);
    position: sticky;
    top: 0;
}

.order-book-table-inner thead th:first-child {
    text-align: left;
}

.order-book-table-inner tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

.order-book-table-inner tbody tr:hover {
    background: var(--bg-tertiary);
}

.order-book-table-inner tbody td {
    padding: 4px 12px;
    text-align: right;
    color: var(--text-primary);
}

.order-book-table-inner tbody td:first-child {
    text-align: left;
}

.order-book-spread {
    background: var(--bg-tertiary);
}

.spread-row {
    padding: 8px 12px;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
}

.spread-percent {
    margin-left: 8px;
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Last Trades */
.perp-last-trades {
    grid-column: 2;
    grid-row: 2;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    max-height: 300px;
    overflow: hidden;
}

.last-trades-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.last-trades-header h3 {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text-primary);
}

.last-trades-table {
    flex: 1;
    overflow-y: auto;
}

.trades-table-inner {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.trades-table-inner thead th {
    padding: 8px 12px;
    text-align: right;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8em;
    text-transform: uppercase;
    background: var(--bg-tertiary);
    position: sticky;
    top: 0;
}

.trades-table-inner thead th:first-child {
    text-align: left;
}

.trades-table-inner tbody td {
    padding: 6px 12px;
    text-align: right;
    color: var(--text-primary);
}

.trades-table-inner tbody td:first-child {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.8em;
}

.trades-table-inner tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

.trades-table-inner tbody tr:hover {
    background: var(--bg-tertiary);
}

/* Positions Panel */
.perp-positions-panel {
    grid-column: 3;
    grid-row: 1 / 3;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.positions-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.positions-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.position-tab {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8em;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.position-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.position-tab.active {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

.positions-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.positions-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.position-tab-content {
    display: none;
}

.position-tab-content.active {
    display: block;
}

.positions-actions {
    margin-bottom: 12px;
}

.btn-secondary-small {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary-small:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
}

.positions-table-container {
    overflow-x: auto;
}

.positions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.positions-table thead th {
    padding: 8px 12px;
    text-align: right;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75em;
    text-transform: uppercase;
    background: var(--bg-tertiary);
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.positions-table thead th:first-child {
    text-align: left;
}

.positions-table tbody td {
    padding: 10px 12px;
    text-align: right;
    color: var(--text-primary);
    border-top: 1px solid var(--border);
    white-space: nowrap;
}

.positions-table tbody td:first-child {
    text-align: left;
}

.positions-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .perpetuals-layout-grid {
        grid-template-columns: 200px 1fr 340px;
    }
}

@media (max-width: 1200px) {
    .perpetuals-layout-grid {
        grid-template-columns: 180px 1fr 320px;
    }
    
    .market-details {
        gap: 16px;
    }
}

@media (max-width: 1024px) {
    .perpetuals-layout-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .perp-pairs-sidebar {
        display: none;
    }
    
    .perp-order-book,
    .perp-last-trades {
        grid-column: 1;
    }
    
    .perp-positions-panel {
        grid-column: 1;
        grid-row: auto;
        max-height: 400px;
    }
    
    .market-info-left {
        gap: 16px;
    }
    
    .market-details {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .perp-market-info-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .market-info-left {
        width: 100%;
    }
    
    .market-details {
        width: 100%;
        justify-content: space-between;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .chart-ohlc {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ============================================
   RAYDIUM PERPETUALS DESIGN SYSTEM - COMPLETE
   ============================================ */

/* Perpetuals Layout Grid - Raydium Style */
.perp-layout-grid {
    display: grid;
    grid-template-areas:
        "sidebar chart orderpanel"
        "sidebar positions orderpanel";
    grid-template-columns: 240px 1fr 320px;
    grid-template-rows: 1fr auto;
    height: calc(100vh - 70px);
    background: #0c0d14;
    overflow: hidden;
    position: relative;
    padding-bottom: 40px; /* Space for notification bar */
    border-radius: 8px;
}

/* Markets Sidebar (240px) */
.perp-markets-sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    background: rgba(12, 13, 20, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(45, 46, 58, 0.6);
    overflow: hidden;
    border-radius: 8px 0 0 8px;
}

.markets-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(45, 46, 58, 0.6);
    background: rgba(26, 27, 38, 0.3);
    border-radius: 8px 0 0 0;
}

.markets-sidebar-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.sidebar-collapse-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    transition: color 150ms ease;
}

.sidebar-collapse-btn:hover {
    color: #ffffff;
}

.markets-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 16px;
    padding: 0 12px;
    height: 36px;
    background: rgba(19, 20, 28, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(45, 46, 58, 0.5);
    border-radius: 10px;
}

.markets-search:focus-within {
    border-color: #2bb085;
}

.markets-search i {
    color: #6b7280;
    font-size: 14px;
}

.markets-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 13px;
}

.markets-search input::placeholder {
    color: #6b7280;
}

.markets-filters {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    margin-bottom: 8px;
    position: relative;
    align-items: center;
}

.filter-more-icon {
    position: absolute;
    right: 16px;
    color: #6b7280;
    font-size: 12px;
    pointer-events: none;
}

.filter-tab {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-tab:hover {
    color: #ffffff;
}

.filter-tab.active {
    color: #ffffff;
    background: rgba(26, 27, 38, 0.8);
    backdrop-filter: blur(8px);
}

.filter-badge {
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 6px;
    background: rgba(43, 176, 133, 0.9);
    backdrop-filter: blur(8px);
    color: #0c0d14;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(43, 176, 133, 0.3);
}

.markets-column-headers {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    padding: 8px 16px;
    font-size: 11px;
    color: #6b7280;
    border-bottom: 1px solid #1f2029;
}

.markets-column-headers span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.markets-column-headers i {
    font-size: 10px;
    opacity: 0.6;
}

.markets-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.market-item-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 10px 40px;
    cursor: pointer;
    transition: all 150ms ease;
    border-left: 2px solid transparent;
    position: relative;
    border-radius: 0 8px 8px 0;
    margin-right: 8px;
}

.market-item-row .market-item-info {
    padding-left: 0;
}

.market-item-row:hover {
    background: rgba(26, 27, 38, 0.6);
    backdrop-filter: blur(4px);
}

.market-item-row.active {
    background: rgba(30, 31, 42, 0.8);
    backdrop-filter: blur(8px);
    border-left-color: #2bb085;
    padding-left: 38px; /* Account for border */
}

.market-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.market-item-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.market-item-symbol-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.market-item-symbol {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

.leverage-badge {
    padding: 2px 4px;
    font-size: 9px;
    font-weight: 600;
    border-radius: 6px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.leverage-badge.x100 {
    background: rgba(43, 176, 133, 0.9);
    backdrop-filter: blur(8px);
    color: #0c0d14;
}

.leverage-badge.x20 {
    background: rgba(43, 176, 133, 0.9);
    backdrop-filter: blur(8px);
    color: #ffffff;
}

.leverage-badge.x10 {
    background: rgba(59, 130, 246, 0.9);
    backdrop-filter: blur(8px);
    color: #ffffff;
}

.market-item-volume {
    font-size: 11px;
    color: #6b7280;
}

.market-item-price-info {
    text-align: right;
}

.market-item-price {
    font-size: 13px;
    font-weight: 500;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #ffffff;
}

.market-item-change {
    font-size: 11px;
    font-weight: 500;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.market-item-change.positive {
    color: #22c55e;
}

.market-item-change.negative {
    color: #ef4444;
}

/* Chart Area */
.perp-chart-area {
    grid-area: chart;
    display: flex;
    flex-direction: column;
    background: #0c0d14;
    overflow: hidden;
}

.chart-market-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(45, 46, 58, 0.6);
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(12, 13, 20, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 0 8px 0 0;
}

.chart-market-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.market-selector-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #1a1b26;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    transition: background 150ms ease;
}

.market-selector-btn:hover {
    background: rgba(30, 31, 42, 0.8);
    border-color: rgba(45, 46, 58, 0.5);
}

.current-price-large {
    font-size: 20px;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #ffffff;
    margin-left: 16px;
}

.chart-market-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

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

.stat-label {
    font-size: 11px;
    color: #6b7280;
}

.stat-value {
    font-size: 13px;
    font-weight: 500;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #ffffff;
}

.stat-value.positive {
    color: #22c55e;
}

.stat-value.negative {
    color: #ef4444;
}

.stat-subtext {
    font-size: 11px;
    color: #6b7280;
    margin-left: 4px;
}

.layout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid #2d2e3a;
    color: #9ca3af;
    font-size: 12px;
    cursor: pointer;
    transition: all 150ms ease;
}

.layout-btn:hover {
    border-color: #3f4051;
    color: #ffffff;
}

.chart-timeframe-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(31, 32, 41, 0.6);
    background: rgba(12, 13, 20, 0.5);
    backdrop-filter: blur(4px);
}

.timeframe-buttons {
    display: flex;
    gap: 4px;
}

.timeframe-btn {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: rgba(26, 27, 38, 0.3);
    border: none;
    cursor: pointer;
    transition: all 150ms ease;
}

.timeframe-btn:hover {
    color: #ffffff;
}

.timeframe-btn.active {
    color: #ffffff;
    background: rgba(45, 46, 58, 0.8);
    backdrop-filter: blur(8px);
}

.chart-tools {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chart-tool-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    transition: all 150ms ease;
}

.chart-tool-btn:hover {
    background: rgba(26, 27, 38, 0.7);
    backdrop-filter: blur(8px);
    color: #ffffff;
    border-color: rgba(45, 46, 58, 0.6);
}

.chart-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    gap: 16px;
    font-size: 12px;
    background: rgba(12, 13, 20, 0.6);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(31, 32, 41, 0.6);
    border-radius: 0;
}

.chart-pair-label {
    color: #6b7280;
}

.chart-ohlc-data {
    display: flex;
    gap: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.chart-ohlc-data span {
    color: #6b7280;
}

.chart-ohlc-data span span {
    color: #ffffff;
}

.chart-ohlc-data .positive {
    color: #22c55e;
}

.chart-ohlc-data .negative {
    color: #ef4444;
}

.chart-container-main {
    flex: 1;
    min-height: 400px;
    background: rgba(12, 13, 20, 0.95);
    backdrop-filter: blur(10px);
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 0 0 8px 0;
}

.chart-container-main canvas {
    flex: 1;
    width: 100%;
    height: 100%;
}

.chart-volume-label {
    position: absolute;
    bottom: 80px;
    left: 16px;
    font-size: 11px;
    color: #6b7280;
    z-index: 10;
    pointer-events: none;
}

.chart-container-main canvas {
    width: 100%;
    height: 100%;
}

.chart-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid rgba(31, 32, 41, 0.6);
    background: rgba(12, 13, 20, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 0 0 8px 0;
}

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

.range-btn {
    padding: 4px 8px;
    font-size: 11px;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 150ms ease;
}

.range-btn:hover {
    color: #ffffff;
}

.range-btn.active {
    color: #ffffff;
}

.chart-footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-expand-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    transition: color 150ms ease;
}

.chart-expand-btn:hover {
    color: #ffffff;
}

.chart-expand-btn i {
    font-size: 14px;
}

.chart-timestamp {
    font-size: 11px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #6b7280;
}

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

.chart-scale-options label {
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chart-scale-options input[type="checkbox"]:checked + span {
    color: #2bb085;
}

/* Order Panel (320px) */
.perp-order-panel {
    grid-area: orderpanel;
    display: flex;
    flex-direction: column;
    background: #13141c;
    border-left: 1px solid #2d2e3a;
    overflow: hidden;
}

/* Order Book Section */
.orderbook-section {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #2d2e3a;
}

.orderbook-tabs {
    display: flex;
    border-bottom: 1px solid rgba(45, 46, 58, 0.6);
    background: rgba(19, 20, 28, 0.5);
    backdrop-filter: blur(4px);
    border-radius: 0 8px 0 0;
}

.orderbook-tab {
    flex: 1;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    background: rgba(19, 20, 28, 0.3);
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: all 150ms ease;
    border-radius: 0;
}

.orderbook-tab:hover {
    color: #ffffff;
}

.orderbook-tab.active {
    color: #ffffff;
    border-bottom-color: #2bb085;
}

.orderbook-precision {
    padding: 8px 12px;
    display: flex;
    justify-content: flex-end;
}

.orderbook-precision select {
    padding: 4px 8px;
    background: rgba(26, 27, 38, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(45, 46, 58, 0.5);
    border-radius: 6px;
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
}

.orderbook-headers {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 4px 12px;
    font-size: 11px;
    color: #6b7280;
}

.orderbook-asks {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
}

.orderbook-asks .orderbook-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.orderbook-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 2px 12px;
    font-size: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    position: relative;
    cursor: pointer;
    transition: all 150ms ease;
    border-radius: 4px;
    margin: 1px 4px;
}

.orderbook-row.ask {
    color: #ef4444;
}

.orderbook-row.ask:hover {
    background: rgba(239, 68, 68, 0.1);
}

.orderbook-row.bid {
    color: #22c55e;
}

.orderbook-row.bid:hover {
    background: rgba(34, 197, 94, 0.1);
}

.orderbook-row .price {
    text-align: left;
    position: relative;
    z-index: 1;
}

.orderbook-row .qty,
.orderbook-row .total {
    position: relative;
    z-index: 1;
}

.orderbook-row .qty,
.orderbook-row .total {
    text-align: right;
    color: #ffffff;
}

.orderbook-depth {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    width: var(--depth-width, 0%);
    height: 100%;
}

.orderbook-row.ask .orderbook-depth {
    background: rgba(239, 68, 68, 0.15);
    right: 0;
    left: auto;
}

.orderbook-row.bid .orderbook-depth {
    background: rgba(34, 197, 94, 0.15);
    right: 0;
    left: auto;
}

.orderbook-spread {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(12, 13, 20, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(31, 32, 41, 0.6);
    border-bottom: 1px solid rgba(31, 32, 41, 0.6);
    gap: 4px;
    border-radius: 6px;
    margin: 4px;
}

.spread-current-price {
    font-size: 16px;
    font-weight: 600;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #ffffff;
    text-align: center;
}

.spread-mark-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #22c55e;
}

.spread-mark-price i {
    font-size: 12px;
}

.spread-percent {
    font-size: 11px;
    color: #6b7280;
    text-align: center;
}

.orderbook-bids {
    max-height: 180px;
    overflow-y: auto;
}

.orderbook-bids .orderbook-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

/* Trading Form Section */
.trading-form-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.wallet-prompt {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid rgba(45, 46, 58, 0.6);
    background: rgba(19, 20, 28, 0.5);
    backdrop-filter: blur(4px);
    border-radius: 8px 0 0 0;
    display: none; /* Hidden when wallet is connected */
}

.wallet-prompt.show {
    display: block;
}

.wallet-prompt-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.wallet-prompt-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2bb085;
    margin-bottom: 8px;
}

.wallet-prompt-content p {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 16px;
}

.btn-connect-gradient {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--accent-border);
    border-radius: 10px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
}

.btn-connect-gradient:hover {
    background: var(--accent-muted);
    border-color: var(--accent);
}

.trading-form {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    display: none; /* Hidden when wallet not connected */
}

.trading-form.show {
    display: flex;
}

.buy-sell-toggle {
    display: flex;
    gap: 8px;
}

.buy-sell-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
    border: none;
    backdrop-filter: blur(8px);
}

.buy-sell-btn.buy {
    background: rgba(34, 197, 94, 0.95);
    backdrop-filter: blur(10px);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.buy-sell-btn.buy:not(.active) {
    background: rgba(26, 27, 38, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(45, 46, 58, 0.5);
    color: #22c55e;
}

.buy-sell-btn.sell {
    background: rgba(239, 68, 68, 0.95);
    backdrop-filter: blur(10px);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.buy-sell-btn.sell:not(.active) {
    background: rgba(26, 27, 38, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(45, 46, 58, 0.5);
    color: #ef4444;
}

.order-type-row {
    display: flex;
    gap: 8px;
}

.order-type-select {
    flex: 1;
    padding: 8px 12px;
    background: rgba(26, 27, 38, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(45, 46, 58, 0.5);
    border-radius: 8px;
    color: #ffffff;
    font-size: 13px;
    cursor: pointer;
}

.leverage-btn {
    padding: 8px 12px;
    background: rgba(26, 27, 38, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(45, 46, 58, 0.5);
    border-radius: 8px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms ease;
}

.leverage-btn:hover {
    border-color: rgba(63, 64, 81, 0.8);
    background: rgba(26, 27, 38, 0.9);
}

.available-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.available-balance-row > span {
    color: #6b7280;
}

.balance-value-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.balance-value-row > span:first-child {
    color: #ffffff;
}

.balance-value-row > span:last-child {
    color: #6b7280;
}

.info-icon-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 2px;
}

.price-input-group,
.quantity-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-input-group label,
.quantity-input-group label {
    font-size: 12px;
    color: #6b7280;
}

.input-with-quick-btns,
.input-with-select {
    display: flex;
    background: rgba(15, 16, 23, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(45, 46, 58, 0.5);
    border-radius: 10px;
    overflow: hidden;
}

.input-with-quick-btns:focus-within,
.input-with-select:focus-within {
    border-color: #2bb085;
}

.mono-input {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 14px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    text-align: right;
}

.input-currency {
    padding: 10px 12px;
    font-size: 12px;
    color: #6b7280;
}

.quick-price-btns {
    display: flex;
    gap: 4px;
    padding: 6px;
}

.quick-btn {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    background: rgba(26, 27, 38, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(45, 46, 58, 0.3);
    color: #6b7280;
    cursor: pointer;
    transition: all 150ms ease;
}

.quick-btn:hover {
    color: #ffffff;
}

.currency-select {
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
}

.current-price-reference {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #f43f5e;
    margin-top: -8px;
    margin-bottom: 4px;
}

.current-price-reference i {
    font-size: 12px;
}

.percentage-slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-input {
    width: 100%;
    height: 4px;
    background: rgba(45, 46, 58, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    appearance: none;
    outline: none;
    cursor: pointer;
}

.slider-input::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: rgba(43, 176, 133, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(43, 176, 133, 0.4);
    border: 2px solid rgba(12, 13, 20, 0.8);
}

.slider-input::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: rgba(43, 176, 133, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(12, 13, 20, 0.8);
    box-shadow: 0 2px 6px rgba(43, 176, 133, 0.4);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #6b7280;
    margin-top: 8px;
}

.slider-labels span:nth-child(2) {
    flex: 1;
    text-align: center;
}

.submit-order-btn {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
    border: none;
}

.submit-order-btn.buy {
    background: #22c55e;
    color: #ffffff;
}

.submit-order-btn.sell {
    background: #ef4444;
    color: #ffffff;
}

.submit-order-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.order-info-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-info-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.order-info-item span:first-child {
    color: #6b7280;
}

.order-info-item span:not(:first-child) {
    color: #ffffff;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.order-options-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #1f2029;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #9ca3af;
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: #2d2e3a;
    border-radius: 10px;
    cursor: pointer;
    transition: background 150ms ease;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 150ms ease;
}

.toggle-switch input:checked + .toggle-slider {
    transform: translateX(16px);
}

.toggle-switch input:checked ~ .toggle-slider {
    background: #2bb085;
}

.checkbox-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    border: 1px solid #2d2e3a;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"]:checked {
    background: #2bb085;
    border-color: #2bb085;
}

/* Positions Panel */
.perp-positions-panel {
    grid-area: positions;
    background: #0c0d14;
    border-top: 1px solid #2d2e3a;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    margin-bottom: 40px; /* Space for notification bar */
}

.positions-tabs-bar {
    display: flex;
    padding: 0 16px;
    border-bottom: 1px solid #2d2e3a;
    overflow-x: auto;
}

.positions-tab {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    background: rgba(26, 27, 38, 0.3);
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 150ms ease;
    border-radius: 8px 8px 0 0;
    margin-right: 4px;
}

.positions-tab:hover {
    color: #ffffff;
}

.positions-tab.active {
    color: #ffffff;
    border-bottom-color: #2bb085;
}

.positions-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
}

.positions-summary {
    display: flex;
    gap: 24px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 11px;
    color: #6b7280;
}

.summary-value {
    font-size: 14px;
    font-weight: 500;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #ffffff;
}

.positions-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.checkbox-small {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
}

.checkbox-small input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.icon-btn-small {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    transition: color 150ms ease;
}

.icon-btn-small:hover {
    color: #ffffff;
}

.close-all-btn {
    padding: 6px 12px;
    font-size: 12px;
    color: #ef4444;
    background: transparent;
    border: 1px solid #ef4444;
    border-radius: 4px;
    cursor: pointer;
    transition: all 150ms ease;
}

.close-all-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.positions-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.positions-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
}

.positions-empty.show {
    display: flex;
}

.positions-empty p {
    font-size: 13px;
    color: #6b7280;
}

.positions-table {
    width: 100%;
    border-collapse: collapse;
}

.positions-table thead {
    background: #13141c;
    border-bottom: 1px solid #1f2029;
}

.positions-table th {
    padding: 8px 16px;
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    text-align: left;
}

.positions-table tbody td {
    padding: 8px 16px;
    font-size: 12px;
    color: #ffffff;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    border-top: 1px solid #1f2029;
}

.positions-table tbody tr:hover {
    background: #1a1b26;
}

/* Scrollbar Styling for Perpetuals */
.perp-markets-sidebar::-webkit-scrollbar,
.orderbook-asks::-webkit-scrollbar,
.orderbook-bids::-webkit-scrollbar,
.positions-content::-webkit-scrollbar {
    width: 4px;
}

.perp-markets-sidebar::-webkit-scrollbar-track,
.orderbook-asks::-webkit-scrollbar-track,
.orderbook-bids::-webkit-scrollbar-track,
.positions-content::-webkit-scrollbar-track {
    background: #1f2029;
}

.perp-markets-sidebar::-webkit-scrollbar-thumb,
.orderbook-asks::-webkit-scrollbar-thumb,
.orderbook-bids::-webkit-scrollbar-thumb,
.positions-content::-webkit-scrollbar-thumb {
    background: #3f4051;
    border-radius: 2px;
}

.perp-markets-sidebar::-webkit-scrollbar-thumb:hover,
.orderbook-asks::-webkit-scrollbar-thumb:hover,
.orderbook-bids::-webkit-scrollbar-thumb:hover,
.positions-content::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Notification Bar */
.perp-notification-bar {
    position: fixed;
    bottom: 0;
    left: 240px;
    right: 320px;
    height: 40px;
    background: rgba(19, 20, 28, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(45, 46, 58, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    border-radius: 8px 8px 0 0;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-content i {
    font-size: 14px;
}

.notification-badge {
    font-size: 12px;
    color: #2bb085;
    font-weight: 500;
}

.notification-timestamp {
    font-size: 11px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #6b7280;
}

.notification-message {
    font-size: 12px;
    color: #ffffff;
}

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

.notification-pagination {
    font-size: 11px;
    color: #6b7280;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.notification-close {
    font-size: 11px;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 150ms ease;
}

.notification-close:hover {
    color: #ffffff;
}

/* Order Size Row */
.order-size-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.order-size-select {
    padding: 4px 8px;
    background: rgba(26, 27, 38, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(45, 46, 58, 0.5);
    border-radius: 6px;
    color: #ffffff;
    font-size: 11px;
    cursor: pointer;
}

.order-size-currency {
    font-size: 11px;
    color: #6b7280;
}

/* Favorite Star Button */
.favorite-star-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    transition: color 150ms ease;
}

.favorite-star-btn:hover {
    color: #f59e0b;
}

.favorite-star-btn i {
    font-size: 16px;
}

/* Positions Toolbar Right */
.positions-toolbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.positions-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.positions-pagination {
    font-size: 11px;
    color: #6b7280;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.positions-empty-message {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
}

/* Market Item Star Icon */
.market-item-row {
    position: relative;
}

.market-item-favorite {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #f59e0b;
    font-size: 12px;
    z-index: 1;
}

.market-item-row.active .market-item-favorite {
    left: 14px; /* Account for border */
}

/* Ensure all numeric values use monospace */
.current-price-large,
.stat-value,
.market-item-price,
.market-item-change,
.orderbook-row,
.spread-current-price,
.spread-mark-price,
.summary-value,
.mono-input,
.balance-value-row span:first-child {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* Chart Info Bar - Fix spacing */
.chart-info-bar {
    padding: 8px 16px;
    border-bottom: 1px solid #1f2029;
}

/* Order Book - Ensure proper depth bar width calculation */
.orderbook-row {
    overflow: hidden;
}

.orderbook-depth {
    width: var(--depth-percent, 0%);
}

/* Trading Form Section - Add relative positioning for favorite button */
.trading-form-section {
    position: relative;
}

/* Fix chart container to fill available space */
.chart-container-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chart-container-main canvas {
    flex: 1;
    width: 100%;
    height: 100%;
}

/* Market Stats - Better alignment */
.chart-market-stats {
    flex-wrap: wrap;
    gap: 24px;
}

.market-stat {
    min-width: fit-content;
}

/* Filter tabs - Add chevron for more options */
.markets-filters {
    position: relative;
}

.markets-filters::after {
    content: '>';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 12px;
    pointer-events: none;
}

/* ============================================================================
   LaunchLab Cards
   ============================================================================ */

.launch-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.15s;
}

.launch-card:hover {
    border-color: #2bb085;
    transform: translateY(-2px);
}

.launch-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 12px;
}

.launch-card-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.launch-card-title {
    flex: 1;
    min-width: 0;
}

.launch-card-title h3 {
    font-size: 1em;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.launch-card-title .launch-card-symbol {
    font-size: 0.85em;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.launch-status-badge {
    font-size: 0.7em;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.launch-status-badge.active {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.launch-status-badge.graduated {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.launch-card-desc {
    padding: 0 16px;
    font-size: 0.85em;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.launch-card-progress {
    padding: 12px 16px;
}

.launch-progress-bar-outer {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.launch-progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
    transition: width 0.4s ease;
}

.launch-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.78em;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.launch-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border-color);
    border-top: 1px solid var(--border-color);
}

.launch-card-stats .lcs-item {
    background: var(--bg-secondary);
    padding: 10px 16px;
    text-align: center;
}

.launch-card-stats .lcs-label {
    font-size: 0.72em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}

.launch-card-stats .lcs-value {
    font-size: 0.9em;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.launch-card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.launch-card-actions button {
    flex: 1;
    padding: 10px 0;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88em;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s;
}

.launch-card-actions button:hover {
    opacity: 0.85;
}

.launch-btn-buy {
    background: transparent;
    border: 1px solid var(--accent-border) !important;
    color: var(--accent);
}

.launch-btn-buy:hover {
    background: var(--accent-muted);
}

.launch-btn-view {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color) !important;
}

.launch-btn-trade {
    background: #10b981;
    color: #fff;
}

.launch-type-card:hover {
    border-color: #2bb085 !important;
    transform: translateY(-3px);
}

/* More menu hover */
.more-menu-item:hover {
    background: var(--bg-tertiary) !important;
}

/* Connected wallet button */
.btn-connect-gradient-nav.connected {
    background: transparent;
    border: 1px solid var(--chart-green);
    color: var(--chart-green);
}

/* ============================================================================
   Responsive Design — Mobile / Tablet / Desktop
   ============================================================================ */

@media (max-width: 1200px) {
    .swap-layout {
        flex-direction: column;
    }
    .swap-chart-section {
        width: 100%;
        max-width: 100%;
    }
    .swap-panel-section {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 1024px) {
    .nav-links {
        gap: 4px;
    }
    .nav-link {
        padding: 8px 10px;
        font-size: 13px;
    }
    .nav-total-value {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 12px;
    }

    .nav-container {
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-links {
        order: 3;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 8px;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-actions {
        gap: 4px;
    }

    .nav-actions .nav-icon-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .btn-connect-gradient-nav {
        padding: 6px 12px;
        font-size: 12px;
    }

    .main-content {
        padding: 12px;
    }

    .page-header {
        flex-direction: column;
        gap: 12px;
    }

    .page-header .btn-primary {
        width: 100%;
    }

    .swap-layout {
        flex-direction: column;
    }

    .swap-chart-section {
        display: none;
    }

    .swap-panel-section {
        width: 100%;
        max-width: 100%;
    }

    .pools-table-wrapper {
        overflow-x: auto;
    }

    .pools-table {
        min-width: 700px;
    }

    .launches-grid {
        grid-template-columns: 1fr !important;
    }

    .modal-content {
        width: 95vw;
        max-width: 95vw;
        margin: 10px;
    }

    .modal-large .modal-content,
    .modal-content.modal-large {
        width: 95vw;
        max-width: 95vw;
    }

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

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

@media (max-width: 480px) {
    .nav-logo-img {
        height: 24px;
        max-width: 150px;
    }

    .nav-link {
        font-size: 12px;
        padding: 6px 8px;
        white-space: nowrap;
    }

    .nav-badge {
        display: none;
    }

    .swap-panel {
        padding: 16px;
    }

    .swap-input-container {
        padding: 14px;
    }

    .token-select-btn {
        padding: 4px 10px;
        font-size: 12px;
    }

    h1 {
        font-size: 1.3em;
    }

    .pool-filters {
        flex-direction: column;
    }

    .search-input-large {
        max-width: 100% !important;
    }
}
