/* KRC20 DEX Specific Styles */
.dex-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dex-container * {
    box-sizing: border-box;
}

.dex-container input::placeholder {
    color: rgba(255,255,255,0.5);
}

.dex-container input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.dex-container select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.dex-btn {
    transition: all 0.3s ease;
    font-family: inherit;
    border: none;
    cursor: pointer;
}

.dex-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.dex-btn:active {
    transform: translateY(0);
}

.dex-btn.primary {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.dex-btn.secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.dex-btn.danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.dex-btn.buy {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.dex-btn.sell {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.tab-btn.active,
.trade-tab-btn.active,
.order-tab-btn.active,
.pool-tab-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
}

.trade-tab-btn[data-side="buy"].active {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
}

.trade-tab-btn[data-side="sell"].active {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

.order-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.order-list::-webkit-scrollbar {
    width: 6px;
}

.order-list::-webkit-scrollbar-track {
    background: transparent;
}

.order-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.order-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
}

.order-item:hover {
    background: rgba(255,255,255,0.05);
}

.ask-order {
    color: #dc3545;
}

.bid-order {
    color: #28a745;
}

.wallet-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid;
    font-size: 14px;
    font-weight: 500;
}

.trading-panel,
.market-panel,
.user-panel {
    background: rgba(30, 30, 30, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

.chart-container,
.orderbook-container,
.my-orders,
.liquidity-pool,
.token-balances {
    background: rgba(30, 30, 30, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

.price-info {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Order book styling enhancements */
.order-book-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: #ccc;
    font-weight: 600;
}

/* Trading interface enhancements */
.trade-form input,
.trade-form select {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: white;
    padding: 12px;
    width: 100%;
    font-size: 16px;
}

.liquidity-form input,
.liquidity-form select {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: white;
    padding: 10px;
    width: 100%;
    font-size: 14px;
}

/* Status indicators */
.status-connected {
    color: #28a745;
    background: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
}

.status-disconnected {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
}

.status-warning {
    color: #ffc107;
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
}

/* Enhanced DEX Styles for new features */

/* Chart Styles */
.chart-timeframe.active {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    font-weight: 600 !important;
}

.chart-timeframe:hover:not(.active) {
    background: rgba(102, 126, 234, 0.25) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
    color: #667eea !important;
}

/* Order Book View Styles */
.orderbook-view.active {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    font-weight: 600 !important;
}

.orderbook-view:hover:not(.active) {
    opacity: 0.8;
    transform: translateY(-1px);
}

.orderbook-view[data-view="buy"]:hover:not(.active) {
    background: rgba(40, 167, 69, 0.25) !important;
    border-color: rgba(40, 167, 69, 0.5) !important;
    color: #28a745 !important;
}

.orderbook-view[data-view="sell"]:hover:not(.active) {
    background: rgba(220, 53, 69, 0.25) !important;
    border-color: rgba(220, 53, 69, 0.5) !important;
    color: #dc3545 !important;
}

/* Trade Item Styles */
.trade-item:hover {
    background: rgba(102, 126, 234, 0.08);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.order-item {
    transition: all 0.2s ease;
    border-radius: 2px;
}

.order-item:hover {
    background: rgba(102, 126, 234, 0.08);
    transform: translateX(2px);
}

/* Enhanced scrollbar for dark theme */
.trades-list,
.order-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.3) transparent;
}

.trades-list::-webkit-scrollbar,
.order-list::-webkit-scrollbar {
    width: 6px;
}

.trades-list::-webkit-scrollbar-track,
.order-list::-webkit-scrollbar-track {
    background: transparent;
}

.trades-list::-webkit-scrollbar-thumb,
.order-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.trades-list::-webkit-scrollbar-thumb:hover,
.order-list::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* Percentage Button Styles */
.percent-btn:hover,
.percent-btn-sell:hover {
    background: rgba(102, 126, 234, 0.25) !important;
    color: #667eea !important;
    transform: translateY(-1px);
}

.percent-btn:active,
.percent-btn-sell:active {
    background: rgba(102, 126, 234, 0.4) !important;
    transform: translateY(0);
}

/* Slippage Button Styles */
.slippage-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    font-weight: 600 !important;
}

.slippage-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 0.25) !important;
    color: #667eea !important;
    transform: translateY(-1px);
}

/* Enhanced scrollbar for trade lists */
.trades-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.trades-list::-webkit-scrollbar {
    width: 6px;
}

.trades-list::-webkit-scrollbar-track {
    background: transparent;
}

.trades-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.trades-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Market stats grid animation */
.market-stats > div {
    transition: all 0.3s ease;
}

.market-stats > div:hover {
    background: rgba(255,255,255,0.1) !important;
    transform: translateY(-2px);
}

/* Fee display styles */
.fee-display {
    color: #ffc107;
    font-size: 12px;
    margin-top: 5px;
}

/* Enhanced input focus states */
.dex-container input:focus,
.dex-container select:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2) !important;
}

/* Order type specific styles */
.order-market {
    border-left: 3px solid #17a2b8;
}

.order-limit {
    border-left: 3px solid #ffc107;
}

.order-stop {
    border-left: 3px solid #dc3545;
}

/* Loading states */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 1200px) {
    .dex-main {
        flex-direction: column !important;
    }
    
    .trading-panel,
    .user-panel {
        width: 100% !important;
    }
    
    .market-panel {
        order: -1;
    }
}

@media (max-width: 768px) {
    .dex-header {
        padding: 15px !important;
    }
    
    .dex-header > div {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .market-stats {
        grid-template-columns: 1fr !important;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Price change animations */
.price-up {
    color: #28a745 !important;
    animation: priceFlash 0.5s ease-in-out;
}

.price-down {
    color: #dc3545 !important;
    animation: priceFlash 0.5s ease-in-out;
}

@keyframes priceFlash {
    0% { background: rgba(255,255,255,0.1); }
    50% { background: rgba(255,255,255,0.2); }
    100% { background: transparent; }
}

/* Success/Error states */
.order-success {
    border: 1px solid #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.order-error {
    border: 1px solid #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.order-pending {
    border: 1px solid #ffc107;
    background: rgba(255, 193, 7, 0.1);
}
