/* ===========================
   OrderBook Styles
   =========================== */

.orderbook-section {
    width: 320px;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
}

.orderbook {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.orderbook-header {
    padding: 10px 16px; /* 12px -> 10px로 축소 */
    border-bottom: 1px solid var(--border-color);
}

.orderbook-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Orderbook Content */
.orderbook-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0; /* 모든 패딩 제거 */
    margin: 0; /* 모든 마진 제거 */
}

.orderbook-asks {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color); /* 2px -> 1px로 축소 */
    margin: 0; /* 여백 제거 */
    padding: 0; /* 패딩 제거 */
}

.orderbook-bids {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: 1px solid var(--border-color); /* 2px -> 1px로 축소 */
    margin: 0; /* 여백 제거 */
}

/* 각 섹션 헤더 - 간소화 */
.orderbook-asks-header,
.orderbook-bids-header {
    padding: 6px 16px; /* 패딩 더 축소 */
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.section-label {
    display: block;
    font-size: 12px; /* 글자 크기 축소 */
    font-weight: 600;
    margin-bottom: 4px; /* 마진 더 축소 */
}

.orderbook-asks-header .section-label {
    color: #f6465d;
}

.orderbook-bids-header .section-label {
    color: #0ecb81;
}

.orderbook-grid-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    font-size: 11px; /* 글자 크기 축소 */
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0; /* 마진 제거 */
    padding: 0; /* 패딩 제거 */
}

.orderbook-grid-header span {
    text-align: right;
}

.orderbook-grid-header span:first-child {
    text-align: left;
}

/* 스크롤 영역 - 스크롤 제거 */
.asks-list,
.bids-list {
    flex: 1;
    overflow: visible; /* 스크롤 제거 */
    display: flex;
    flex-direction: column;
    padding: 0; /* 패딩 제거 */
    margin: 0; /* 마진 제거 */
}

.asks-list {
    flex-direction: column-reverse;
    background: rgba(246, 70, 93, 0.02);
    padding-top: 0; /* 상단 패딩 제거 */
    margin-top: 0; /* 상단 마진 제거 */
}

.bids-list {
    background: rgba(14, 203, 129, 0.02);
}

/* Order Row - 스타일 개선 */
.order-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 3px 16px; /* 패딩 축소 */
    font-size: 12px; /* 글자 크기 축소 */
    position: relative;
    cursor: pointer;
    transition: background 0.1s;
    line-height: 1.4; /* 높이 축소 */
}

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

.order-row::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    background: var(--color-sell);
    opacity: 0.08;
    transition: width 0.2s ease-out;
    z-index: 0;
}

.order-row.bid::before {
    background: var(--color-buy);
    opacity: 0.08;
}

.order-row:hover::before {
    opacity: 0.15;
}

.order-row span {
    position: relative;
    z-index: 1;
}

.order-price {
    text-align: left;
    font-weight: 600;
    font-family: var(--font-mono);
}

.order-row.ask .order-price {
    color: var(--color-sell);
}

.order-row.bid .order-price {
    color: var(--color-buy);
}

.order-amount,
.order-total {
    text-align: right;
    color: var(--text-primary);
}

/* 스프레드 구분선 */
.orderbook-spread {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid #f0b90b;
    border-bottom: 1px solid #f0b90b;
}

.spread-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 500;
}

.spread-value {
    font-size: 12px;
    color: #f0b90b;
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Current Price Divider - 삭제 또는 숨김 */
.current-price-divider {
    display: none;
}

/* Depth Bar Animation */
@keyframes depthBarExpand {
    from { width: 0; }
    to { width: var(--depth); }
}

.order-row[data-depth]::before {
    width: var(--depth);
    animation: depthBarExpand 0.3s ease-out;
}

/* Scrollbar Styling */
.asks-list::-webkit-scrollbar,
.bids-list::-webkit-scrollbar {
    width: 4px;
}

.asks-list::-webkit-scrollbar-track,
.bids-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.asks-list::-webkit-scrollbar-thumb,
.bids-list::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 2px;
}

.asks-list::-webkit-scrollbar-thumb:hover,
.bids-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .orderbook-section {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .orderbook-section {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .orderbook {
        max-height: 400px;
    }
}