/* FoxyStock - Криптовалютная биржа в стиле invest.foxyco.in */
:root {
    --primary: #ff6b35;
    --primary-dark: #e55a2b;
    --primary-light: #ff8c42;
    --secondary: #4ecdc4;
    --accent: #667eea;
    --bg-dark: #0a0a0f;
    --bg-card: #13131a;
    --bg-card-hover: #1a1a24;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --border-color: #2a2a3a;
    --success: #4ade80;
    --warning: #fbbf24;
    --error: #f87171;
    --gradient-primary: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    --gradient-secondary: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    --gradient-accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --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);
    --shadow-glow: 0 0 20px rgba(255, 107, 53, 0.4);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.1) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(255, 140, 66, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.main > .container {
    padding-top: 8px !important;
}

.container > .trading-layout {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Header */
.header {
    background: rgba(19, 19, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 6px 0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    min-height: 48px !important;
    max-height: 48px !important;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 36px !important;
    max-height: 36px !important;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px !important;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1 !important;
}

.nav {
    display: flex;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.3s ease;
    position: relative;
    padding: 4px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after,
.nav-link:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu.hidden {
    display: none;
}

.user-name {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 5px 14px !important;
    border: none;
    border-radius: 5px !important;
    font-weight: 600;
    font-size: 11px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    line-height: 1.2 !important;
    min-height: 28px !important;
    max-height: 28px !important;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.6);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-buy {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: white;
}

.btn-sell {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
}

.btn-block {
    width: 100%;
    padding: 10px;
    font-size: 13px;
}

/* Main Layout */
.main {
    padding: 0 0 32px 0;
    min-height: calc(100vh - 80px);
}

.main > .container {
    padding-top: 8px;
}

.trading-layout {
    display: flex;
    flex-direction: column;
    gap: 4px !important;
    min-height: calc(100vh - 160px);
    height: auto;
    max-height: none;
    overflow-y: visible;
    overflow-x: hidden;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.trading-layout > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.trading-layout > *:not(:first-child) {
    margin-top: 4px !important;
}

.markets-top {
    margin-bottom: 0 !important;
}

.chart-section {
    margin-top: 0px !important;
}

.markets-top + .chart-section {
    margin-top: 0px !important;
}

/* Markets Top Section */
.markets-top {
    margin-bottom: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    position: relative;
    flex-shrink: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    margin-top: 0 !important;
    padding-top: 0 !important;
    width: 100%;
    max-width: 100%;
}

.markets-top::before {
    display: none;
}

/* Markets Sidebar (legacy, для обратной совместимости) */
.markets-sidebar {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    position: relative;
}

.markets-sidebar::before {
    display: none;
}

.sidebar-header {
    margin-bottom: 12px;
}

.markets-list {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.markets-top .sidebar-header {
    margin-bottom: 8px;
}

.markets-top .sidebar-header h2 {
    font-size: 14px;
    margin-bottom: 8px;
}

.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    width: 16px;
    height: 16px;
}

.search-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.markets-list {
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: hidden;
    overflow-y: hidden;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

.markets-top .markets-list {
    flex-direction: row;
    flex-wrap: nowrap;
}

.market-item {
    padding: 6px 8px;
    background: var(--bg-card-hover);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    flex-shrink: 1;
    flex-grow: 0;
    min-width: 0;
    max-width: none;
    margin-bottom: 0;
    white-space: nowrap;
    gap: 4px;
}

.market-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 10px 0 0 10px;
}

.market-item:hover {
    background: rgba(255, 107, 53, 0.05);
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateX(4px);
}

.market-item:hover::before {
    opacity: 0.6;
}

.market-item.active {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(255, 140, 66, 0.05) 100%);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2), 0 4px 16px rgba(255, 107, 53, 0.15);
}

.market-item.active::before {
    opacity: 1;
}

.market-info {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    min-width: 0;
}

.market-name {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 0;
    white-space: nowrap;
}

.crypto-symbol {
    font-weight: 700;
    font-size: 11px;
    color: var(--text-primary);
}

.market-pair {
    font-size: 9px;
    color: var(--text-secondary);
}

.market-price {
    font-size: 10px;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

.market-change {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 4px;
    white-space: nowrap;
    margin-left: 4px;
    flex-shrink: 0;
}

.market-change.positive {
    color: var(--success);
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.market-change.negative {
    color: var(--error);
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* Chart Section - Full Width */
.chart-section {
    display: flex !important;
    flex-direction: column !important;
    overflow: visible;
    min-height: 450px !important;
    height: 450px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Trading Center (legacy) */
.trading-center {
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow: hidden;
    height: 100%;
    max-height: 100%;
}

.chart-container {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 12px;
    box-shadow: var(--shadow-md);
    display: flex !important;
    flex-direction: column !important;
    min-height: 450px !important;
    height: 450px !important;
    position: relative;
    overflow: visible;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Удалено - дубликат, используется стиль выше */

.chart-container::before {
    display: none;
}

.chart-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.chart-pair-name {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.chart-title {
    display: contents;
}

.chart-title h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.chart-price {
    font-size: 16px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity 0.15s ease;
}

.chart-price.price-flash {
    animation: priceFlash 0.3s ease;
}

@keyframes priceFlash {
    0% {
        opacity: 1;
        filter: brightness(1);
    }
    50% {
        opacity: 0.5;
        filter: brightness(1.5);
    }
    100% {
        opacity: 1;
        filter: brightness(1);
    }
}

.chart-change {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.zoom-level {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: center;
    padding: 0 4px;
}

.chart-change.positive {
    color: var(--success);
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.chart-change.negative {
    color: var(--error);
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

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

.chart-controls,
.chart-type-selector,
.zoom-controls {
    display: contents;
}

.timeframe-btn {
    padding: 6px 12px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

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

.timeframe-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.chart-wrapper {
    position: relative;
    min-height: 400px !important;
    height: 400px !important;
    overflow: visible;
    width: 100% !important;
    display: block !important;
    flex: 0 0 400px !important;
    box-sizing: border-box !important;
}

.chart-section .chart-wrapper {
    min-height: 400px !important;
    height: 400px !important;
    flex: 0 0 400px !important;
    box-sizing: border-box !important;
}

#trading-chart {
    width: 100% !important;
    height: 400px !important;
    min-height: 400px !important;
    display: block !important;
    max-width: 100% !important;
    cursor: grab;
    user-select: none;
    visibility: visible !important;
    opacity: 1 !important;
}

#trading-chart:active {
    cursor: grabbing;
}

/* Order Book */
.orderbook-container {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: var(--shadow-md);
    flex: 0 0 auto;
    max-height: 400px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.orderbook-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 16px 16px 0 0;
    opacity: 0.8;
}

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

.orderbook-header h3 {
    font-size: 18px;
    font-weight: 700;
}

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

.orderbook-btn {
    padding: 6px 12px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.orderbook-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.orderbook-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.orderbook-sells,
.orderbook-buys {
    flex: 1;
    min-height: 120px;
}

.orderbook-header-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px 0;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.orderbook-rows {
    display: flex;
    flex-direction: column;
}

.orderbook-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 6px 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.orderbook-row:hover {
    background: var(--bg-card-hover);
}

.orderbook-row.sell {
    color: var(--error);
    font-weight: 600;
}

.orderbook-row.buy {
    color: var(--success);
    font-weight: 600;
}

.orderbook-spread {
    padding: 12px;
    text-align: center;
    background: var(--bg-card-hover);
    border-radius: 10px;
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spread-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.spread-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Trading Panel */
.trading-panel {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    position: relative;
}

.trading-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 16px 16px 0 0;
    opacity: 0.8;
}

.panel-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-card-hover);
    padding: 4px;
    border-radius: 10px;
}

.panel-tab {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.panel-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

.panel-content {
    min-height: 200px;
}

.trading-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trading-form.hidden {
    display: none;
}

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

.form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    padding: 8px 10px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
    background: rgba(255, 107, 53, 0.05);
}

.form-input[readonly] {
    background: var(--bg-card);
    cursor: not-allowed;
}

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

.input-currency {
    position: absolute;
    right: 16px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

.balance-info {
    padding: 12px;
    background: var(--bg-card-hover);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.balance-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.balance-item span:first-child {
    color: var(--text-secondary);
}

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

.percentage-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.percent-btn {
    padding: 8px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Compact Trading Panel */
.trading-panel-bottom {
    margin-top: 8px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100px !important;
    position: relative !important;
    z-index: 1 !important;
}

.trading-panel-compact {
    background: var(--bg-card) !important;
    border-radius: 12px !important;
    border: 1px solid var(--border-color) !important;
    padding: 16px !important;
    box-shadow: var(--shadow-md) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 120px !important;
    position: relative !important;
    z-index: 1 !important;
}

.trading-form-compact {
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 50px !important;
    position: relative !important;
}

.compact-form-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
    width: 100%;
    justify-content: flex-start;
}

.compact-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
}

.compact-field.compact-percent {
    min-width: 160px;
    flex-shrink: 0;
}

.compact-field.compact-balance {
    min-width: 120px;
    flex-shrink: 0;
    margin-left: auto;
}

.compact-field.compact-action {
    min-width: 90px;
    flex-shrink: 0;
}

.compact-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin-bottom: 2px;
}

.compact-input {
    padding: 8px 10px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: inherit;
    width: 110px;
    min-width: 110px;
    box-sizing: border-box;
}

.compact-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
    background: rgba(255, 107, 53, 0.05);
}

.compact-input[readonly] {
    background: var(--bg-card);
    cursor: not-allowed;
}

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

.compact-input-with-button {
    display: flex;
    align-items: center;
    gap: 6px;
}

.compact-input-with-button .compact-input {
    flex: 1;
}

.btn-current-price {
    padding: 8px 12px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 70px;
}

.btn-current-price:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.btn-current-price:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(255, 107, 53, 0.3);
}

.compact-currency {
    position: absolute;
    right: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    pointer-events: none;
}

.compact-percent-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}

.compact-percent-btn {
    padding: 6px 10px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex: 1 1 0;
    min-width: 35px;
}

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

.compact-balance-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-right: 4px;
}

.compact-balance-value {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 600;
}

.compact-field.compact-balance {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding-bottom: 6px;
    gap: 6px;
}

.btn-buy-compact,
.btn-sell-compact {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    width: 100%;
    min-width: 90px;
}

.btn-buy-compact {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 2px 8px rgba(74, 222, 128, 0.3);
}

.btn-buy-compact:hover {
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.5);
    transform: translateY(-1px);
}

.btn-sell-compact {
    background: var(--gradient-error);
    color: white;
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.3);
}

.btn-sell-compact:hover {
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.5);
    transform: translateY(-1px);
}

.buy-form-compact {
    border-left: 3px solid var(--success);
    padding: 12px;
    background: rgba(74, 222, 128, 0.05);
    border-radius: 8px;
}

.sell-form-compact {
    border-left: 3px solid var(--error);
    padding: 12px;
    background: rgba(248, 113, 113, 0.05);
    border-radius: 8px;
}

/* Recent Trades */
.recent-trades {
    margin-top: auto;
}

.recent-trades h3 {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.trades-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.trade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: var(--bg-card-hover);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 11px;
    transition: all 0.2s ease;
}

.trade-item:hover {
    background: var(--bg-card);
    border-color: rgba(255, 107, 53, 0.2);
}

.trade-price {
    font-weight: 600;
}

.trade-price.buy {
    color: var(--success);
}

.trade-price.sell {
    color: var(--error);
}

.trade-amount {
    color: var(--text-secondary);
}

.trade-time {
    color: var(--text-secondary);
    font-size: 11px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 24px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-card-hover);
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

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

@media (max-width: 1200px) {
    .trading-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .markets-sidebar,
    .trading-panel {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        gap: 16px;
    }
    
    .header-actions {
        order: 2;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.market-item,
.orderbook-row,
.trade-item {
    animation: fadeIn 0.3s ease;
}

.hidden {
    display: none !important;
}
