* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #0b0e11;
    color: #eaecef;
    line-height: 1.5;
    overflow-x: hidden;
}

header {
    background-color: #0b0e11;
    border-bottom: 1px solid #1e2329;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo img {
    height: 24px;
    max-width: 100%;
}

.logo h1 {
    font-size: clamp(16px, 4vw, 18px);
    font-weight: 600;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: clamp(8px, 2vw, 20px);
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
}

.nav-links a {
    color: #eaecef;
    text-decoration: none;
    font-size: clamp(12px, 3vw, 14px);
    padding: 8px 12px;
    border-radius: 4px;
    white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
    background-color: #1e2329;
}

.user-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: clamp(12px, 3vw, 14px);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: #f0b90b;
    color: #0b0e11;
    font-weight: 600;
}

.btn-secondary {
    background-color: #1e2329;
    color: #eaecef;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #eaecef;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
}

@media (min-width: 1024px) {
    .container {
        flex-direction: row;
        height: calc(100vh - 60px);
    }
}

.sidebar {
    width: 100%;
    background-color: #0b0e11;
    border-right: 1px solid #1e2329;
    padding: 16px;
    overflow-y: auto;
    order: 2;
}

@media (min-width: 1024px) {
    .sidebar {
        width: 240px;
        order: 1;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .sidebar {
        width: 200px;
    }
}

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

.market-selector h3 {
    font-size: clamp(13px, 3vw, 14px);
    margin-bottom: 10px;
    color: #848e9c;
}

.market-tabs {
    display: flex;
    border-bottom: 1px solid #1e2329;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.market-tab {
    padding: 8px 12px;
    font-size: clamp(12px, 3vw, 14px);
    cursor: pointer;
    flex: 1;
    min-width: 60px;
    text-align: center;
}

.market-tab.active {
    color: #f0b90b;
    border-bottom: 2px solid #f0b90b;
}

.market-search {
    position: relative;
    margin-bottom: 15px;
}

.market-search input {
    width: 100%;
    padding: 8px 30px 8px 10px;
    background-color: #1e2329;
    border: 1px solid #1e2329;
    border-radius: 4px;
    color: #eaecef;
    font-size: clamp(12px, 3vw, 14px);
}

.market-list {
    list-style: none;
}

.market-item {
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    font-size: clamp(12px, 3vw, 14px);
    cursor: pointer;
    border-radius: 4px;
    flex-wrap: wrap;
    gap: 5px;
}

.market-item:hover {
    background-color: #1e2329;
}

.market-item.active {
    background-color: #1e2329;
    color: #f0b90b;
}

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

.market-change.positive {
    color: #0ecb81;
}

.market-change.negative {
    color: #f6465d;
}

.trading-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 16px;
    order: 1;
}

@media (min-width: 1024px) {
    .trading-area {
        order: 2;
        flex-direction: row;
    }
}

.trading-pair {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #1e2329;
    flex-wrap: wrap;
    gap: 10px;
}

.pair-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.pair-name {
    font-size: clamp(18px, 5vw, 24px);
    font-weight: 600;
}

.pair-fullname {
    color: #848e9c;
    font-size: clamp(12px, 3vw, 14px);
}

.price-info {
    text-align: right;
    flex: 1;
    min-width: 150px;
}

.current-price {
    font-size: clamp(20px, 6vw, 28px);
    font-weight: 600;
}

.price-change {
    font-size: clamp(12px, 3vw, 14px);
}

.price-change.positive {
    color: #0ecb81;
}

.price-change.negative {
    color: #f6465d;
}

.chart-container {
    background-color: #1e2329;
    border-radius: 4px;
    height: 300px;
    position: relative;
    overflow: hidden;
    min-height: 250px;
}

@media (min-width: 768px) {
    .chart-container {
        height: 400px;
    }
}

.chart-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #848e9c;
    padding: 20px;
}

.trading-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 1024px) {
    .trading-controls {
        flex-direction: row;
    }
}

.order-book {
    width: 100%;
    background-color: #1e2329;
    border-radius: 4px;
    padding: 16px;
    order: 2;
}

@media (min-width: 1024px) {
    .order-book {
        width: 280px;
        order: 1;
    }
}

.order-book-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: clamp(12px, 3vw, 14px);
    color: #848e9c;
}

.order-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-row {
    display: flex;
    justify-content: space-between;
    font-size: clamp(11px, 2.5vw, 13px);
    padding: 4px 0;
    flex-wrap: wrap;
}

.order-price {
    flex: 1;
    min-width: 70px;
}

.order-amount {
    flex: 1;
    text-align: right;
    min-width: 60px;
}

.order-total {
    flex: 1;
    text-align: right;
    color: #848e9c;
    min-width: 60px;
}

.order-bid .order-price {
    color: #0ecb81;
}

.order-ask .order-price {
    color: #f6465d;
}

.trading-panel {
    width: 100%;
    background-color: #1e2329;
    border-radius: 4px;
    padding: 16px;
    order: 1;
}

@media (min-width: 1024px) {
    .trading-panel {
        flex: 1;
        order: 2;
    }
}

.order-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.order-type-tab {
    padding: 8px 12px;
    background-color: #2b3139;
    border-radius: 4px;
    font-size: clamp(12px, 3vw, 14px);
    cursor: pointer;
    flex: 1;
    min-width: 80px;
    text-align: center;
}

.order-type-tab.active {
    background-color: #f0b90b;
    color: #0b0e11;
    font-weight: 600;
}

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

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

.form-label {
    font-size: clamp(12px, 3vw, 14px);
    color: #848e9c;
}

.form-input {
    padding: 10px;
    background-color: #0b0e11;
    border: 1px solid #1e2329;
    border-radius: 4px;
    color: #eaecef;
    font-size: clamp(12px, 3vw, 14px);
}

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

@media (min-width: 480px) {
    .form-row {
        flex-direction: row;
    }
}

.form-row .form-group {
    flex: 1;
}

.balance-info {
    font-size: clamp(11px, 2.5vw, 12px);
    color: #848e9c;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px;
}

.buy-btn, .sell-btn {
    font-weight: 600;
    padding: 12px;
    margin-top: 10px;
    width: 100%;
    font-size: clamp(13px, 3vw, 14px);
}

.buy-btn {
    background-color: #0ecb81;
    color: #0b0e11;
}

.sell-btn {
    background-color: #f6465d;
    color: #0b0e11;
}

.trade-history {
    width: 100%;
    background-color: #0b0e11;
    border-top: 1px solid #1e2329;
    padding: 16px;
    order: 3;
}

@media (min-width: 1024px) {
    .trade-history {
        width: 280px;
        border-left: 1px solid #1e2329;
        border-top: none;
        order: 3;
    }
}

.trade-history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: clamp(12px, 3vw, 14px);
    color: #848e9c;
    flex-wrap: wrap;
    gap: 10px;
}

.trade-tabs {
    display: flex;
    border-bottom: 1px solid #1e2329;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.trade-tab {
    padding: 8px 12px;
    font-size: clamp(12px, 3vw, 14px);
    cursor: pointer;
    flex: 1;
    min-width: 70px;
    text-align: center;
}

.trade-tab.active {
    color: #f0b90b;
    border-bottom: 2px solid #f0b90b;
}

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

.trade-row {
    display: flex;
    justify-content: space-between;
    font-size: clamp(11px, 2.5vw, 13px);
    padding: 4px 0;
    flex-wrap: wrap;
    gap: 5px;
}

.trade-time {
    color: #848e9c;
    min-width: 80px;
}

.trade-price {
    min-width: 70px;
}

.trade-price.positive {
    color: #0ecb81;
}

.trade-price.negative {
    color: #f6465d;
}

.trade-amount {
    text-align: right;
    min-width: 60px;
}

@media (max-width: 767px) {
    header {
        padding: 10px;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        order: 3;
        margin-top: 10px;
    }
    
    .nav-links.mobile-open {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .user-actions {
        margin-left: auto;
    }
    
    .trading-area {
        padding: 10px;
        gap: 12px;
    }
    
    .sidebar, .order-book, .trade-history {
        padding: 12px;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 14px;
    }
    
    .btn {
        padding: 6px 12px;
    }
    
    .pair-info {
        min-width: 100%;
    }
    
    .price-info {
        min-width: 100%;
        text-align: left;
    }
    
    .order-type-tab {
        padding: 6px 8px;
        font-size: 12px;
    }
}
