/* WalletPeoples Crypto Trading Platform Styles */
/* Dark Professional Theme */

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

html, body {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

body {
    padding-top: 120px; /* Space for fixed header */
    background: #0d1117;
}

.main-content {
    margin-top: 1px;
    min-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-bottom: 50px;
}

.trading-interface {
    margin-top: 20px; /* Normal spacing */
}

.chart-container {
    position: relative;
    margin-top: 20px;
    background: #1c212e;
    border-radius: 8px;
    padding: 10px;
}

.chart-toolbar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    background: rgba(28, 33, 46, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    gap: 10px;
    z-index: 100;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Wallet Modal Styles */
.wallet-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.wallet-modal-content {
    background: #1c212e;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

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

.wallet-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #fff;
}

.wallet-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.wallet-modal-close:hover {
    color: #fff;
}

.wallet-modal-body {
    padding: 16px;
}

.wallet-option {
    width: 100%;
    padding: 16px;
    margin: 8px 0;
    background: #2d3748;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

.wallet-option:hover {
    background: #374151;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wallet-option img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

/* WalletConnect QR Modal */
.wallet-connect-qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.qr-modal-content {
    background: #1c212e;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

.qr-modal-header h3 {
    margin: 0;
    color: #fff;
}

.qr-modal-body {
    padding: 24px;
    text-align: center;
}

.qr-modal-body p {
    color: #888;
    margin-bottom: 20px;
}

.qr-placeholder {
    width: 250px;
    height: 250px;
    margin: 0 auto 20px;
    background: #2d3748;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-loading {
    color: #888;
    font-size: 14px;
}

.wallet-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wallet-links a {
    padding: 12px 20px;
    background: #3b82f6;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s;
}

.wallet-links a:hover {
    background: #2563eb;
}

/* Connect button states */
#connectWalletBtn.connected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.wallet-icon {
    margin-right: 4px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

:root {
    --bg-primary: #0a0b0d;
    --bg-secondary: #12151a;
    --bg-tertiary: #1a1d23;
    --bg-card: #15181e;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --green: #10b981;
    --red: #ef4444;
    --blue: #3b82f6;
    --yellow: #f59e0b;
    --purple: #8b5cf6;
    --border: #2a2d35;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Top Header */
.top-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

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

.logo img {
    height: 75px;
    width: auto;
    object-fit: contain;
}

/* Chain Selector con scroll */
.chain-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    flex: 1;
    max-width: none;
    overflow: hidden;
    margin-right: 20px;
}

.chain-selector {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 5px 0;
}

.chain-selector::-webkit-scrollbar {
    display: none;
}

.chain-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Frecce di navigazione per le chain */
.chain-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    opacity: 0;
    pointer-events: none;
}

.chain-scroll-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--blue);
}

.chain-scroll-left {
    left: -5px;
}

.chain-scroll-right {
    right: -5px;
}

/* Mostra le frecce quando necessario */
.chain-selector-wrapper.show-left .chain-scroll-left,
.chain-selector-wrapper.show-right .chain-scroll-right {
    opacity: 1;
    pointer-events: auto;
}

/* Gradient per indicare scroll */
.chain-selector-wrapper::before,
.chain-selector-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.chain-selector-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-primary), transparent);
}

.chain-selector-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-primary), transparent);
}

.chain-selector-wrapper.show-left::before,
.chain-selector-wrapper.show-right::after {
    opacity: 1;
}

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

.chain-btn.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--blue);
}

.chain-btn img,
.chain-btn svg {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 0 0 auto;
    min-width: 400px;
}

.search-bar {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 160px;
}

.search-bar i {
    color: var(--text-muted);
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    font-size: 14px;
}

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

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

/* Language Selector */
.language-selector {
    position: relative;
}

.language-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    color: #fff;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #1c212e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    min-width: 150px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
}

.language-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    color: #fff;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lang-option.active {
    background: rgba(59, 130, 246, 0.2);
}

.lang-option svg {
    width: 24px;
    height: 18px;
}

.lang-option span {
    font-size: 14px;
    font-weight: 500;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    font-size: 18px;
    transition: color 0.2s;
}

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

.connect-wallet {
    background: var(--blue);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
}

.connect-wallet:hover {
    opacity: 0.9;
}

/* Main Layout */
.main-layout {
    display: flex;
    height: calc(100vh - 60px);
}

/* Hamburger Button - Hidden on desktop, shown on mobile */
.hamburger-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    margin-left: 15px;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: all 0.3s ease;
    position: relative;
}

/* Sidebar collapsed state - Desktop only */
@media (min-width: 993px) {
    .sidebar.collapsed {
        width: 60px;
    }
    
    .sidebar.collapsed .nav-item {
        justify-content: center;
        padding: 10px;
    }
    
    .sidebar.collapsed .nav-item span {
        display: none;
    }
    
    .sidebar.collapsed .nav-item i {
        margin: 0;
        font-size: 18px;
    }
    
    .sidebar.collapsed .sidebar-footer {
        padding: 10px;
    }
    
    .sidebar.collapsed .sidebar-footer .nav-item span {
        display: none;
    }
}

.sidebar-nav {
    padding: 10px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: #ffffff !important;
}

.nav-item.active {
    background: var(--bg-tertiary);
    color: #ffffff !important;
}

.nav-item i {
    width: 20px;
    text-align: center;
    color: #ffffff !important;
}

.nav-item span {
    color: #ffffff !important;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--border);
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
}

/* Crypto Card Styles */
.crypto-card {
    background: linear-gradient(135deg, #1a1f2e 0%, #151a27 100%);
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 
                0 2px 8px rgba(255, 255, 255, 0.05) inset;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: cardGlow 3s ease-in-out infinite alternate;
}

@keyframes cardGlow {
    0% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(255, 255, 255, 0.05) inset; }
    100% { box-shadow: 0 8px 32px rgba(100, 200, 255, 0.2), 0 2px 8px rgba(255, 255, 255, 0.08) inset; }
}

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

.crypto-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crypto-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px;
}

.crypto-info {
    display: flex;
    flex-direction: column;
}

.crypto-symbol {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
}

.crypto-name {
    font-size: 11px;
    color: #8b92a8;
    text-transform: capitalize;
}

.crypto-badge {
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    padding: 4px 8px;
    border-radius: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.badge-text {
    font-size: 10px;
    font-weight: bold;
    color: #000;
    text-transform: uppercase;
}

.crypto-card-body {
    margin-bottom: 10px;
}

.price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.current-price {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 10px;
    color: #8b92a8;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.price-value {
    font-size: 20px;
    font-weight: bold;
    color: #4fd1c5;
    text-shadow: 0 0 10px rgba(79, 209, 197, 0.5);
}

.price-change {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(0, 255, 136, 0.1);
}

.price-change.negative {
    background: rgba(255, 61, 87, 0.1);
}

.price-change .change-icon {
    font-size: 12px;
}

.price-change.positive .change-icon,
.price-change.positive .change-percent {
    color: #00ff88;
}

.price-change.negative .change-icon,
.price-change.negative .change-percent {
    color: #ff3d57;
}

.change-percent {
    font-size: 12px;
    font-weight: bold;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-box .stat-label {
    font-size: 9px;
    color: #8b92a8;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.stat-box .stat-value {
    font-size: 12px;
    font-weight: bold;
    color: #fff;
}

.stat-box .stat-value.high {
    color: #00ff88;
}

.stat-box .stat-value.low {
    color: #ff6b6b;
}

.mini-chart {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#miniChartCanvas {
    width: 100%;
    height: 60px;
}

.crypto-card-footer {
    display: flex;
    justify-content: center;
    align-items: center;
}

.update-time {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: #8b92a8;
}

.update-time i {
    font-size: 10px;
    animation: rotate 2s linear infinite;
}

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

/* Main Content */
.main-content {
    flex: 1;
    background: var(--bg-primary);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

/* When sidebar is collapsed, main content expands */
body.sidebar-collapsed .main-content {
    margin-left: 0;
    width: calc(100% - 60px);
}

body.sidebar-collapsed .swap-panel {
    width: 380px;
}

/* Swap Panel */
.swap-panel {
    width: 380px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
}

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

.swap-header h3 {
    font-size: 16px;
    font-weight: 500;
}

.connect-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

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

.tab-btn {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

.tab-btn:nth-child(2).active {
    background: var(--red);
    border-color: var(--red);
}

.market-info {
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.info-row span {
    flex: 1;
    padding: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
}

.info-row span:first-child {
    background: var(--bg-card);
    color: var(--text-primary);
}

.amount-input {
    margin-bottom: 20px;
}

.amount-input label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.amount-input input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
}

.amount-presets {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.amount-presets button {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.swap-button {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 20px;
}

.buy-button {
    background: var(--green);
    color: white;
}

.sell-button {
    background: var(--red);
    color: white;
}

.token-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.token-info-card h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

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

.info-item .label {
    font-size: 11px;
    color: var(--text-muted);
}

.info-item .value {
    font-size: 13px;
    color: var(--text-primary);
}

.info-item .value.green {
    color: var(--green);
}

.info-item .value.orange {
    color: var(--yellow);
}

.pool-info {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.pool-info h4 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.pool-value {
    font-size: 14px;
    color: var(--text-primary);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

.mobile-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Hamburger menu styling */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-menu-toggle:hover {
    background: var(--bg-tertiary);
    border-radius: 8px;
}

/* Keep hamburger visible on desktop */
@media (min-width: 993px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
}

/* Mobile Swap Button */
.mobile-swap-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--green);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 24px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 998;
}

/* Mobile Responsive Design */
@media (max-width: 1200px) {
    .chain-selector-wrapper {
        flex: 1;
    }
    
    .header-right {
        min-width: 250px;
    }
    
    .chain-scroll-btn {
        opacity: 1;
        pointer-events: auto;
    }
    
    .swap-panel {
        width: 320px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 1000;
        transition: transform 0.3s ease;
        width: 240px !important;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 240px !important;
        transform: translateX(-100%);
    }
    
    .sidebar.collapsed.active {
        transform: translateX(0);
    }
    
    body.sidebar-collapsed .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-backdrop.active {
        display: block;
    }
    
    .main-layout {
        flex-direction: column;
    }
    
    .swap-panel {
        position: fixed;
        right: 0;
        top: 60px;
        bottom: 0;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        width: 100%;
        max-width: 380px;
    }
    
    .swap-panel.active {
        transform: translateX(0);
    }
    
    .main-content {
        width: 100%;
        margin-left: 0;
    }
    
    .mobile-swap-toggle {
        display: flex;
    }
    
    /* Reset collapsed state on mobile */
    .sidebar.collapsed .nav-item {
        justify-content: flex-start;
        padding: 10px 14px;
    }
    
    .sidebar.collapsed .nav-item span {
        display: inline;
    }
    
    .sidebar.collapsed .nav-item i {
        margin-right: 10px;
        font-size: inherit;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 10px;
    }
    
    .header-left,
    .header-right {
        gap: 10px;
    }
    
    .search-bar {
        width: 140px;
    }
    
    .search-bar input {
        font-size: 12px;
    }
    
    .connect-wallet {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    /* Chain selector responsive */
    .chain-selector-wrapper {
        flex: 1;
        margin-right: 10px;
    }
    
    .header-right {
        min-width: 200px;
    }
    
    .chain-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .chain-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .chain-scroll-btn {
        width: 25px;
        height: 25px;
        font-size: 12px;
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Token info bar responsive */
    .token-info-bar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
    }
    
    .token-stats,
    .token-metrics {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .volume-info {
        width: 100%;
        margin-left: 0;
    }
    
    /* Chart responsive */
    .chart-container {
        margin: 5px;
        padding: 5px;
    }
    
    .chart-main {
        height: 300px;
        padding: 10px;
    }
    
    /* Bottom tabs responsive */
    .bottom-tabs {
        margin: 5px;
    }
    
    .tabs-header {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    /* Tables responsive */
    .transactions-table {
        overflow-x: auto;
        display: block;
    }
    
    .transactions-table table {
        min-width: 600px;
    }
    
    .token-table {
        overflow-x: auto;
        display: block;
    }
    
    .token-table table {
        min-width: 600px;
    }
    
    .swap-panel {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .logo span {
        display: none;
    }
    
    .search-bar {
        display: none;
    }
    
    .header-actions {
        gap: 5px;
    }
    
    .icon-btn {
        padding: 6px;
        font-size: 16px;
    }
    
    /* Token info mobile */
    .token-info-bar {
        font-size: 11px;
    }
    
    .token-main h2 {
        font-size: 14px;
    }
    
    .stat,
    .metric {
        min-width: 60px;
    }
    
    /* Chart controls mobile */
    .chart-controls button,
    .chart-tools button {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* Filters mobile */
    .tx-filters {
        flex-wrap: wrap;
    }
    
    .filter-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* Tables mobile */
    .token-table td,
    .transactions-table td {
        padding: 8px 5px;
        font-size: 11px;
    }
    
    /* Swipe indicators */
    .swipe-indicator {
        display: block;
        width: 40px;
        height: 4px;
        background: var(--text-muted);
        border-radius: 2px;
        margin: 10px auto;
    }
}

/* Bootstrap Override for Dark Theme */
.btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

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

.btn-primary {
    background: var(--blue);
    border-color: var(--blue);
    color: white;
}

.btn-success {
    background: var(--green);
    border-color: var(--green);
    color: white;
}

.btn-danger {
    background: var(--red);
    border-color: var(--red);
    color: white;
}

/* Touch-friendly elements */
@media (hover: none) {
    .nav-item,
    .tab,
    .filter-btn,
    .chain-btn,
    button {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Container responsive */
.container-fluid {
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}/* Wallet Menu Styles */
.wallet-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    min-width: 300px;
    margin-top: 10px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.wallet-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.wallet-menu-header span {
    font-weight: 600;
    color: var(--text-primary);
}

.wallet-menu-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallet-address {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-primary);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.wallet-address span {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wallet-address button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}

.wallet-balance {
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 6px;
    margin-bottom: 15px;
}

.wallet-balance span {
    color: var(--text-primary);
    font-size: 14px;
}

#wallet-balance {
    color: var(--primary);
    font-weight: 600;
}

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

.wallet-menu-actions button {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.wallet-menu-actions button:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.wallet-menu-actions button:last-child {
    background: rgba(255, 59, 48, 0.1);
    border-color: rgba(255, 59, 48, 0.3);
    color: #ff3b30;
}

.wallet-menu-actions button:last-child:hover {
    background: rgba(255, 59, 48, 0.2);
}

.connect-wallet {
    position: relative;
}

/* Mobile Responsive Styles */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

.mobile-blockchain-dropdown {
    display: none;
    position: relative;
}

.mobile-blockchain-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.mobile-blockchain-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.mobile-blockchain-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1c212e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px;
    margin-top: 10px;
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mobile-blockchain-list.active {
    display: block;
}

.mobile-blockchain-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    color: #fff;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
}

.mobile-blockchain-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-blockchain-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Mobile Media Queries */
@media (max-width: 768px) {
    body {
        padding-top: 0;
    }

    header {
        position: fixed;
        top: 0;
        height: 70px;
        padding: 0 10px;
    }

    .navbar {
        padding: 0;
    }
    
    /* Show hamburger button on mobile */
    .hamburger-btn {
        display: inline-block;
        position: absolute;
        right: 80px;
        top: 50%;
        transform: translateY(-50%);
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-blockchain-dropdown {
        display: block;
        order: 2;
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .logo {
        order: 1;
        flex: 0;
        margin-right: 10px;
    }

    .logo img {
        height: 35px;
    }

    .logo h1 {
        font-size: 16px;
        display: none;
    }

    .search-bar {
        display: none !important;
    }

    .chain-selector-wrapper {
        display: none;
    }

    .header-actions {
        order: 3;
        flex: 0;
        gap: 5px;
    }

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

    .connect-wallet-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .main-content {
        margin-top: 70px;
        padding: 10px;
    }

    .trading-interface {
        margin-top: 10px;
    }

    .trading-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .chart-container {
        height: 400px;
    }

    #tradingview-chart {
        height: 380px;
    }

    .order-book, .trade-panel {
        max-height: 300px;
    }

    .transactions-grid {
        padding: 10px;
    }

    .transaction-item {
        padding: 10px;
        font-size: 12px;
    }

    .transaction-amount {
        font-size: 14px;
    }

    /* Footer Mobile */
    footer {
        padding: 30px 10px;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .footer-section {
        margin-bottom: 20px;
    }

    .footer-section h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .footer-links {
        justify-content: center;
    }

    .footer-links a {
        font-size: 12px;
        padding: 5px 10px;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        padding-top: 20px;
        text-align: center;
    }

    .footer-bottom p {
        font-size: 12px;
    }

    /* Token Performance Bar Mobile */
    .token-performance-container {
        padding: 5px;
    }

    .token-performance-bar {
        gap: 5px;
        padding: 5px;
    }

    .token-item {
        min-width: 120px;
        padding: 8px;
    }

    .token-symbol {
        font-size: 12px;
    }

    .token-price {
        font-size: 14px;
    }

    .token-change {
        font-size: 11px;
    }

    /* Sidebar Mobile */
    .sidebar {
        z-index: 999;
    }
    
    .wallet-connect-section {
        display: block !important;
        padding: 15px;
    }
    
    .connect-wallet-sidebar {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    .trading-sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    .sidebar-content {
        padding: 10px;
    }

    .tabs {
        font-size: 12px;
    }

    .tab {
        padding: 8px 12px;
    }

    /* Stats Grid Mobile */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .mobile-blockchain-btn {
        padding: 8px 15px;
        font-size: 12px;
    }

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

    .token-item {
        min-width: 100px;
    }

    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .transaction-details {
        width: 100%;
    }
}
