html {
  font-size: 87.5%; /* 1rem = 14px (16px의 87.5%) */
  /* 거래소에서 많이 사용하는 폰트 적용 */
  font-family: 'IBM Plex Sans', 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 숫자가 들어가는 부분에 적용할 등너비 폰트 */
.price,
.amount,
.percentage,
.orderbook-cell,
.trade-cell,
.balance-value,
.asset-amount,
.countdown-timer,
.chart-number,
.volume-value,
.timer-value,
.form-control[type='number'],
.form-control.number {
  font-family: 'IBM Plex Mono', 'Roboto Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

:root {
  /* 다크 테마 (기본) */
  --bg-primary: #0b0e11;
  --bg-secondary: #161a1e;
  --border-color: #575757;
  --text-primary: #eaecef;
  --text-secondary: #848e9c;
  --btn-hover: rgba(132, 142, 156, 0.1);
  --chart-bg: #0b0e11;
  --input-bg: #0b0e11;
  --input-text: #eaecef;
  --input-border: #0b0e11;
  --input-group-bg: #0b0e11;
  --input-group-text: #848e9c;
  --progress-bg: #2a2e37;
  --progress-bar: #1e4dd8;
  --ask-color: rgb(246, 70, 93);
  --bid-color: rgb(14, 203, 129);
  --ask-bar: rgba(246, 70, 93, 0.15);
  --bid-bar: rgba(14, 203, 129, 0.15);
  --modal-bg: #0b0e11;
  --modal-border: #2a2e37;
  --alert-bg: #1e2126;
  --alert-border: #2a2e37;
  --scrollbar-track: #0b0e11;
  --scrollbar-thumb: #2a2e37;
  --table-hover-bg: #1e2126;
  --table-header-bg: #161a1e;
  --ask-volume-color: rgba(246, 70, 93, 0.2);
  --bid-volume-color: rgba(14, 203, 129, 0.2);
  --my-order-color: rgba(0, 123, 255, 0.5);
  /* 테마 토글 버튼 변수 */
  --theme-toggle-sun: #ffeb3b;
  --theme-toggle-moon: #ffffff;
  --theme-toggle-track: linear-gradient(to right, #3a3a3a, #505050);
  --theme-toggle-shadow: rgba(0, 0, 0, 0.4);
}

body:not(.dark) {
  /* 라이트 테마 */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --border-color: #dcdfe6;
  --text-primary: #2c3e50;
  --text-secondary: #606266;
  --btn-hover: rgba(0, 0, 0, 0.05);
  --chart-bg: #ffffff;
  --input-bg: #ffffff;
  --input-text: #2c3e50;
  --input-border: #ffffff;
  --input-group-bg: #ffffff;
  --input-group-text: #606266;
  --progress-bg: #e9ecef;
  --progress-bar: #007bff;
  --ask-color: #eb4d5c;
  --bid-color: #00b07c;
  --ask-bar: rgba(235, 77, 92, 0.25);
  --bid-bar: rgba(0, 176, 124, 0.25);
  --modal-bg: #ffffff;
  --modal-border: #dcdfe6;
  --alert-bg: #f5f5f5;
  --alert-border: #dcdfe6;
  --scrollbar-track: #ffffff;
  --scrollbar-thumb: #dcdfe6;
  --ask-volume-color: rgba(246, 70, 93, 0.2);
  --bid-volume-color: rgba(14, 203, 129, 0.2);
  --my-order-color: rgba(0, 123, 255, 0.3);
  /* 테마 토글 버튼 변수 */
  --theme-toggle-sun: #ff9800;
  --theme-toggle-moon: #666666;
  --theme-toggle-track: linear-gradient(to right, #84cdfa, #5ad1cd);
  --theme-toggle-shadow: rgba(0, 0, 0, 0.2);
}

body {
  width: 1920px;
  min-width: 1200px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

input {
  border-bottom: 1px solid var(--border-color) !important;
}

.custom-default-font-size {
  font-size: 1rem !important;
}

.container-fluid {
  max-width: 1920px;
  padding: 1rem 2rem;
}
.theme-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}
.orderbook-controls {
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 185px;
  background-color: var(--bg-primary);
  border-radius: 4px;
  border: 1px solid var(--border-color);
}
.control-middle {
  display: flex;
  align-items: center;
  width: 100%;
}
.control-bottom {
  height: 20px;
  display: flex;
  align-items: center;
  width: 100%;
}
.orderbook-table {
  width: 100%;
  font-family: 'IBM Plex Mono', 'Roboto Mono', Consolas, monospace;
}

.orderbook-header {
  display: flex;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  z-index: 2;
}

.orderbook-asks .orderbook-header {
  bottom: 0;
}

.orderbook-bids .orderbook-header {
  top: 0;
}

.orderbook-body {
  font-size: 12px;
}

.orderbook-row {
  display: flex;
  height: 19px;
  line-height: 19px;
  position: relative;
}

.orderbook-cell {
  flex: 1;
  text-align: right;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 좌우 분할 오더북에서 가격 열 색상 통일 */
.orderbook-split-view .ask-row .orderbook-cell:nth-child(1) {
  color: var(--ask-color);
}

.orderbook-split-view .bid-row .orderbook-cell:nth-child(2) {
  color: var(--bid-color);
}

/* 볼륨 바 스타일 */
.orderbook-asks .ask-row {
  position: relative;
}

.orderbook-asks .ask-row::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: var(--other-volume-percent);
  height: 100%;
  background-color: var(--ask-volume-color);
  z-index: 0;
}

.orderbook-asks .ask-row::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: var(--my-volume-percent);
  height: 100%;
  background-color: var(--my-order-color);
  z-index: 1;
}

.orderbook-bids .bid-row {
  position: relative;
}

.orderbook-bids .bid-row::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: var(--other-volume-percent);
  height: 100%;
  background-color: var(--bid-volume-color);
  z-index: 0;
}

.orderbook-bids .bid-row::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: var(--my-volume-percent);
  height: 100%;
  background-color: var(--my-order-color);
  z-index: 1;
}

/* 내 주문 스타일 */
.orderbook-row.my-order {
  background-color: transparent;
}

.orderbook-row.my-order:hover {
  background-color: transparent;
}

/* 호가창 스크롤 영역 */
.orderbook-asks,
.orderbook-bids {
  height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.orderbook-asks::-webkit-scrollbar,
.orderbook-bids::-webkit-scrollbar {
  width: 6px;
}

.orderbook-asks::-webkit-scrollbar-track,
.orderbook-bids::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.orderbook-asks::-webkit-scrollbar-thumb,
.orderbook-bids::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

/* 호가창 행 호버 효과 */
.orderbook-row:hover {
  background-color: var(--btn-hover);
}

.orderbook-container {
  display: flex;
  flex-direction: column;
  height: 784px;
  padding: 0;
  min-width: 306px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
}
.main-layout {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}
.orderbook-section {
  flex: 3.5;
  min-width: 600px;
}
.settings-section {
  flex: 6.5;
  min-width: 800px;
}
.table {
  margin: 0;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}
.table > thead > tr > th,
.table > tfoot > tr > th {
  border: none !important;
  font-weight: normal;
  height: 16px !important;
  line-height: 16px !important;
  color: var(--text-secondary);
  font-size: 11px;
  background-color: var(--bg-primary);
}
.table > tbody > tr > td {
  border: none !important;
  height: 19px !important;
  line-height: 19px !important;
  color: var(--text-primary);
}
.table > tbody > tr:hover {
  background-color: var(--btn-hover) !important;
}
.table > thead > tr {
  height: 16px !important;
}
.bid-row,
.ask-row {
  position: relative;
  height: 19px;
  line-height: 19px;
}
.bid-row td,
.ask-row td {
  padding: 0 4px !important;
  height: 19px !important;
  line-height: 19px !important;
}
/* 기존 구분 없는 규칙은 주석 처리 - 각 레이아웃별로 명확히 분리 */
/*
.bid-row td:first-child,
.bid-row .orderbook-cell:first-child {
  color: var(--bid-color) !important;
}
.ask-row td:first-child,
.ask-row .orderbook-cell:first-child {
  color: var(--ask-color) !important;
}
.orderbook-split-view .bid-row .orderbook-cell:nth-child(2) {
  color: var(--bid-color) !important;
}
.orderbook-split-view .ask-row .orderbook-cell:nth-child(1) {
  color: var(--ask-color) !important;
}
*/
.bid-row td:not(:first-child),
.ask-row td:not(:first-child) {
  color: var(--text-primary) !important;
}
.card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
}
.card-header {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  color: var(--text-primary);
}
.card-body {
  background-color: var(--bg-primary);
}
#tradingChart {
  height: 600px !important;
  border-radius: 0 0 0.375rem 0.375rem;
}
.chart-card {
  transition: all 0.3s ease;
  overflow: hidden;
}

.chart-collapsed {
  height: 48px !important; /* 헤더 높이만큼만 표시 */
  margin-bottom: 0.5rem;
}

.asset-card {
  background-color: var(--bg-secondary);
  border-radius: 0.375rem;
  padding: 1rem;
}
.asset-title {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.asset-amount {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}
.progress {
  background-color: var(--progress-bg);
}
.progress-bar {
  background-color: var(--progress-bar);
}
.form-control,
.form-select {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--input-text);
}
.form-control:focus,
.form-select:focus {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--input-text);
  box-shadow: none;
}
.input-group-text {
  background-color: var(--input-group-bg);
  border-color: var(--input-border);
  color: var(--input-group-text);
}
.form-control:read-only {
  background-color: var(--input-group-bg) !important;
  color: var(--input-text) !important;
  opacity: 0.8;
}
.form-control:disabled {
  background-color: var(--input-group-bg) !important;
  color: var(--input-text) !important;
  opacity: 0.6;
}
.modal-content {
  background-color: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-primary);
}
.modal-header {
  border-bottom-color: var(--border-color);
}
.modal-footer {
  border-top-color: var(--border-color);
}
.btn-close {
  filter: brightness(0) invert(1);
}
.text-muted {
  color: var(--text-secondary) !important;
  font-size: 0.7rem !important;
}

#tradingChart,
#customChart {
  width: 100%;
  height: 100%;
}

.custom-chart {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-chart canvas {
  width: 100%;
  height: 100%;
}

.btn-group .btn {
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-group .btn:hover {
  background-color: var(--bg-secondary);
}

.btn-group .btn.btn-primary {
  background-color: var(--progress-bar);
  border-color: var(--progress-bar);
  color: #fff;
}

.btn-group .btn.btn-outline-primary {
  background-color: transparent;
  border-color: var(--progress-bar);
  color: var(--progress-bar);
}
/* 오더북 볼륨 바 스타일 */
.ask-row,
.bid-row {
  position: relative;
  height: 19px;
  line-height: 19px;
}

.orderbook-table td {
  position: relative;
  z-index: 1;
  padding: 0 8px !important;
  height: 19px !important;
  line-height: 19px !important;
  text-align: right !important;
  background: transparent !important;
}

.orderbook-table th {
  padding: 0 8px !important;
  height: 16px !important;
  line-height: 16px !important;
  text-align: right !important;
  background: transparent !important;
}

.orderbook-table tr {
  position: relative;
}

.orderbook-table tbody {
  position: relative;
  background: transparent !important;
}

/* 볼륨 타입 선택 버튼 스타일 */
.current-price .btn-group {
  height: 20px;
}

.current-price .btn {
  padding: 0 8px;
  font-size: 11px;
  line-height: 18px;
}

.current-price .btn-primary {
  background-color: var(--progress-bar);
  border-color: var(--progress-bar);
}

.current-price .btn-outline-primary {
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.current-price .btn-outline-primary:hover {
  background-color: var(--input-bg);
  border-color: var(--progress-bar);
  color: var(--text-primary);
}

/* 오더북 스타일 수정 */
.volume-bg-cell {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ask-row .volume-bg {
  background-color: var(--ask-bar);
}

.bid-row .volume-bg {
  background-color: var(--bid-bar);
}

.ask-row td,
.bid-row td {
  position: relative;
  z-index: 1;
  background: transparent !important;
}

/* 차트 토글 관련 스타일 */
.chart-card {
  transition: all 0.3s ease;
  overflow: hidden;
}

.chart-collapsed {
  height: 48px !important; /* 헤더 높이만큼만 표시 */
  margin-bottom: 0.5rem;
}

.btn-link {
  color: var(--text-primary);
}

.btn-link:hover {
  color: var(--text-secondary);
}

/* orderbook-container table cell override */
.orderbook-container .table th {
  padding: 0 8px !important;
  height: 16px !important;
  line-height: 16px !important;
  text-align: right !important;
}
.orderbook-container .table td {
  padding: 0 8px !important;
  height: 19px !important;
  line-height: 19px !important;
  text-align: right !important;
}

/* 테이블 스타일 추가 */
.table {
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border-color: var(--border-color);
}

.table td,
.table th {
  border-color: var(--border-color);
  padding: 0.5rem;
}

.table-sm td,
.table-sm th {
  padding: 0.25rem;
}

.table tbody tr:hover {
  background-color: var(--btn-hover);
}

.form-control.bg-light {
  background-color: var(--input-group-bg) !important;
  color: var(--input-text) !important;
}

/* 오더북 테이블 스크롤 설정 추가 */
.orderbook-asks {
  display: flex;
  flex-direction: column-reverse;
  overflow-y: auto;
  overflow-x: hidden;
  height: 300px;
}

.orderbook-asks table {
  margin-bottom: 0;
}

.orderbook-bids {
  overflow-y: auto;
  overflow-x: hidden;
  height: 300px;
}

/* 테이블 헤더 고정 */
.orderbook-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--bg-primary);
}

/* 현재가 영역 고정 높이 */
.current-price {
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

/* 호가창 컨테이너 전체 높이 설정 */
.orderbook-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 입력 영역 고정 높이 */
.orderbook-inputs {
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
}
.chart {
  height: 100%;
  width: 100%;
}

.asset-info {
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 10px;
}

.asset-info .balance-value {
  font-family: 'Consolas', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.asset-info .balance-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 매도 설정 (상단) */
.control-top {
  height: 20px;
  display: flex;
  align-items: center;
  width: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.container {
  max-width: 1800px !important;
  padding: 0 20px;
}

.card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  color: var(--text-primary);
}

.card-body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.table {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  margin-bottom: 0;
}

.table th {
  background-color: var(--table-header-bg);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.table td {
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn {
  margin-right: 5px;
}

.btn-outline-secondary {
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-outline-secondary:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-primary {
  background-color: var(--progress-bar);
  border-color: var(--progress-bar);
}

.btn-warning {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #000;
}

.btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
}

.form-control,
.form-select {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--input-text);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--input-text);
  box-shadow: none;
}

.input-group-text {
  border-color: var(--input-border);
  color: var(--input-group-text);
}

.modal-content {
  background-color: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.modal-header {
  border-bottom-color: var(--border-color);
}

.modal-footer {
  border-top-color: var(--border-color);
}

.btn-close {
  filter: brightness(0) invert(1);
}

.alert {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.alert-warning {
  background-color: rgba(255, 193, 7, 0.1);
  border-color: #ffc107;
  color: #ffc107;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  border-color: #dc3545;
  color: #dc3545;
}

#tradingChart,
#customChart {
  background-color: var(--bg-primary);
  border-radius: 8px;
}

.orderbook-container {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.orderbook-asks,
.orderbook-bids {
  background-color: var(--bg-primary);
  border: none;
}

.asset-card {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 15px;
}

.asset-title {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.asset-amount {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
}

.progress {
  background-color: var(--progress-bg);
}

.progress-bar {
  background-color: var(--progress-bar);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.tooltip {
  --bs-tooltip-bg: var(--bg-secondary);
  --bs-tooltip-color: var(--text-primary);
}

.trend-settings-panel {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 15px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.trend-settings-panel .form-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.trend-settings-panel .form-control,
.trend-settings-panel .form-select {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--input-text);
  font-size: 0.9rem;
}

.trend-settings-panel .form-control:focus,
.trend-settings-panel .form-select:focus {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--input-text);
  box-shadow: 0 0 0 0.2rem rgba(132, 142, 156, 0.25);
}

.trend-settings-panel .card-title {
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

/* 차트 컨테이너 스타일 */
.chart-container {
  border-radius: 8px;
  padding: 8px;
  height: 800px;
}

/* 레이아웃 최적화 */
.main-layout {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.orderbook-section {
  flex: 0 0 40%; /* 전체 너비의 40% */
  margin-right: 20px;
}

.settings-section {
  flex: 1;
  min-width: 0;
}

.orderbook-container .table {
  background-color: transparent;
}

.orderbook-container .table td {
  padding: 4px 8px !important;
  height: 19px !important;
  line-height: 19px !important;
}

.volume-bar-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.orderbook-table td {
  position: relative;
  padding: 4px 8px !important;
  height: 19px !important;
  line-height: 19px !important;
  text-align: right !important;
  background: transparent !important;
}

.orderbook-table td span {
  position: relative;
  z-index: 2;
}

.orderbook-table tr {
  position: relative;
}

.ask-row td:first-child {
  color: var(--ask-color) !important;
}

.bid-row td:first-child {
  color: var(--bid-color) !important;
}

.ask-row:hover .volume-bar,
.bid-row:hover .volume-bar {
  opacity: 0.5;
}

/* 오버플로우 숨김 처리 */
.orderbook-asks,
.orderbook-bids {
  position: relative;
  overflow: hidden;
}

.current-price {
  font-size: 1.2rem;
}

.current-price .h5 {
  font-size: 1.5rem;
  font-weight: bold;
}

.current-price .text-success {
  color: #00e676 !important;
}

.current-price .text-danger {
  color: #ff6b6b !important;
}

.orderbook-container .table tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* 수량과 총액 색상 */
.orderbook-container .table td:nth-child(1),
.orderbook-container .table td:nth-child(2) {
  color: rgba(255, 255, 255, 0.85);
}

/* 설정 폼 최적화 */
.settings-form {
  max-height: calc(100vh - 400px);
  overflow-y: auto;
}

.settings-form::-webkit-scrollbar {
  width: 6px;
}

.settings-form::-webkit-scrollbar-track {
  background: #f8f9fa;
}

.settings-form::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* 반응형 조정 */
@media (max-width: 1600px) {
  .container {
    /* max-width: 1400px !important; */
  }
}

@media (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .orderbook-section,
  .settings-section {
    grid-column: 1;
  }

  .orderbook-container {
    height: 600px;
    min-height: auto;
  }
}

/* 자산 정보 스타일 */
.asset-value {
  font-size: 0.9rem;
  margin-bottom: 15px;
  line-height: 1.4;
}

.asset-value .d-block {
  display: block;
}

.asset-value .mt-1 {
  margin-top: 0.25rem;
}

.asset-card .mt-3 {
  border-top: 1px solid #e9ecef;
  padding-top: 15px;
  margin-top: 15px;
}

.asset-card .asset-title {
  margin-bottom: 10px;
}

.asset-card .progress {
  margin-bottom: 5px;
}

.asset-card small.text-muted {
  font-size: 0.8rem;
  line-height: 1.4;
}

.asset-card .d-block.mt-1 {
  margin-top: 0.25rem;
}

/* 프로그레스 바 스타일 */
.progress {
  background-color: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  background-color: #0d6efd;
  transition: width 0.3s ease;
}

.form-range {
  width: 100%;
  height: 1.5rem;
  padding: 0;
  background-color: transparent;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-range:focus {
  outline: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  background: #0d6efd;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -0.5rem;
}

.form-range::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  background: #0d6efd;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.form-range::-webkit-slider-runnable-track {
  width: 100%;
  height: 0.5rem;
  background: #e9ecef;
  border-radius: 1rem;
}

.form-range::-moz-range-track {
  width: 100%;
  height: 0.5rem;
  background: #e9ecef;
  border-radius: 1rem;
}

.form-range::-webkit-slider-thumb:hover {
  background: #0b5ed7;
}

.form-range::-moz-range-thumb:hover {
  background: #0b5ed7;
}

.orderbook-table {
  width: 100%;
  overflow-x: hidden;
}

.orderbook-table table {
  width: 100%;
  margin: 0;
  table-layout: fixed;
}

.orderbook-table th,
.orderbook-table td {
  padding: 4px 8px !important;
  font-family: Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right !important;
  background: transparent !important;
}

.orderbook-table tbody {
  font-size: 12px;
}

.orderbook-table thead {
  font-size: 11px;
  font-weight: 600;
  background-color: var(--bg-primary);
}

.orderbook-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--bg-primary) !important;
  border-bottom: 1px solid var(--border-color);
}

.ask-row,
.bid-row {
  position: relative;
  height: 19px;
  line-height: 19px;
}

.orderbook-table td {
  position: relative;
  z-index: 1;
  padding: 4px 8px !important;
  height: 19px !important;
  line-height: 19px !important;
  text-align: right !important;
  background: transparent !important;
}

.orderbook-table td span {
  position: relative;
  z-index: 2;
}

.orderbook-table th {
  padding: 4px 8px !important;
  height: 16px !important;
  line-height: 16px !important;
  text-align: right !important;
  background: transparent !important;
}

.ask-row td:first-child {
  color: var(--ask-color) !important;
}

.bid-row td:first-child {
  color: var(--bid-color) !important;
}

.ask-row:hover .volume-bar,
.bid-row:hover .volume-bar {
  opacity: 0.5;
}

.current-price {
  padding: 8px 0;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.current-price h5 {
  font-size: 1.2rem;
  margin: 0;
  line-height: 1;
}

.current-price .btn-group {
  margin-left: 8px;
}

.current-price .btn {
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.5;
}

.form-check {
  display: flex;
  margin: 0;
  padding: 0;
  align-items: center;
}

.form-check-input {
  float: none !important;
  margin: 0 !important;
  width: 16px;
  height: 16px;
  cursor: pointer;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
}

.form-check-label {
  font-size: 13px;
  margin-left: 6px;
  color: var(--text-primary);
  cursor: pointer;
  line-height: 16px;
  user-select: none;
}

/* 로딩 스피너 스타일 */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--bg-primary);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--border-color);
  border-top: 5px solid var(--progress-bar);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  margin-top: 20px;
  color: var(--text-primary);
  font-size: 1.2rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.usdt-settings .input-group {
  margin-bottom: 8px;
}

.usdt-settings .input-group:last-child {
  margin-bottom: 0;
}

.usdt-settings .form-control {
  background-color: var(--input-bg);
  color: var(--input-text);
  border-color: var(--input-border);
}

.usdt-settings .input-group-text {
  color: var(--input-group-text);
  border-color: var(--input-border);
}

.balance-value {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.2rem;
  font-weight: 600;
}

.balance-label {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  margin-bottom: 4px;
}

.orderbook-table {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bs-secondary) transparent;
}

.orderbook-table::-webkit-scrollbar {
  width: 6px;
}

.orderbook-table::-webkit-scrollbar-track {
  background: transparent;
}

.orderbook-table::-webkit-scrollbar-thumb {
  background-color: var(--bs-secondary);
  border-radius: 3px;
}

.usage-info {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}

.usage-card {
  flex: 1;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.usage-details {
  margin-top: 0.5rem;
}

.usage-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.usage-row .label {
  color: var(--text-muted);
}

.usage-row .value {
  font-weight: 500;
}

.usage-progress {
  margin-top: 1rem;
  position: relative;
}

.usage-percent {
  position: absolute;
  right: 0;
  top: -1.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.progress {
  background-color: var(--bg-secondary);
}

.progress-bar {
  transition: width 0.3s ease;
  background-color: var(--primary);
}

.progress-bar.bg-warning {
  background-color: var(--warning) !important;
}

.progress-bar.bg-danger {
  background-color: var(--danger) !important;
}

.asset-status-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.asset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.asset-symbol {
  font-weight: 600;
  color: var(--text-primary);
}

.asset-total {
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
  color: var(--text-primary);
}

.asset-details {
  font-size: 0.9rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.detail-label {
  color: var(--text-muted);
}

.detail-value {
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
}

.usage-bar {
  margin-top: 12px;
  position: relative;
}

.usage-percent {
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.countdown-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.timer-label {
  font-weight: 500;
}

.timer-value {
  font-family: 'Roboto Mono', monospace;
  font-weight: 600;
  color: var(--primary);
  min-width: 30px;
  text-align: right;
}

/* 호가창 테이블 스타일 */
.orderbook-table table {
  width: 100%;
  border-collapse: collapse;
}

.orderbook-table th,
.orderbook-table td {
  padding: 4px 8px;
  text-align: right;
  border-bottom: 1px solid var(--border-color);
}

.orderbook-table th {
  font-weight: 500;
  color: var(--text-secondary);
}

/* 호가창 행 호버 효과 */
.orderbook-table tr:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* 내 주문 행 호버 효과 */
.my-order-row:hover {
  background-color: rgba(0, 123, 255, 0.2) !important;
}

/* 내 주문 스타일 */
.ask-row.my-order,
.bid-row.my-order {
  background-color: rgba(0, 123, 255, 0.1) !important;
  color: #007bff;
}

.ask-row.my-order:hover,
.bid-row.my-order:hover {
  background-color: rgba(0, 123, 255, 0.2) !important;
}

.account-font {
  font-size: 0.7rem;
}

/* 호가창 좌우 레이아웃 스타일 */
.orderbook-split-view {
  width: 100%;
  height: 702px;
  overflow: hidden;
  background-color: var(--bg-primary);
  border-radius: 4px;
  position: relative;
}

.orderbook-split-view .orderbook-side {
  flex: 1;
  border-right: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.orderbook-split-view .orderbook-side:last-child {
  border-right: none;
}

/* 매수(왼쪽) 영역 스타일 */
.orderbook-bid-side .orderbook-header,
.orderbook-bid-side .orderbook-row {
  display: flex;
  flex-direction: row;
}

.orderbook-bid-side .price-cell {
  color: var(--bid-color, #00b373) !important;
  text-align: right;
  font-weight: 500;
  padding-right: 12px;
}

.orderbook-bid-side .qty-cell {
  text-align: left;
  padding-left: 12px;
}

/* 매도(오른쪽) 영역 스타일 */
.orderbook-ask-side .orderbook-header,
.orderbook-ask-side .orderbook-row {
  display: flex;
  flex-direction: row;
}

.orderbook-ask-side .price-cell {
  color: var(--ask-color, #ff5b5b) !important;
  text-align: left;
  font-weight: 500;
  padding-left: 12px;
}

.orderbook-ask-side .qty-cell {
  text-align: right;
  padding-right: 12px;
}

/* 좌우 영역 공통 스타일 */
.orderbook-split-view .orderbook-header {
  padding: 4px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  background-color: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.orderbook-split-view .orderbook-body.asks {
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden;
  scrollbar-width: thin;
  max-height: 630px;
  min-height: 200px;
}

/* 매수 영역 스크롤 강제 적용 */
.orderbook-split-view .orderbook-body.bids {
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden;
  scrollbar-width: thin;
  max-height: 630px;
  min-height: 200px;
}

.orderbook-split-view .orderbook-row {
  height: 19px;
  line-height: 19px;
  position: relative;
  font-size: 12px;
  font-family: Consolas, monospace;
  border-bottom: 1px solid rgba(87, 87, 87, 0.05);
}

.orderbook-split-view .orderbook-row:hover {
  background-color: var(--btn-hover, rgba(0, 0, 0, 0.05));
}

/* 현재가 영역 스타일 */
.orderbook-split-view .current-price-container {
  z-index: 10;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px 20px;
  text-align: center;
  min-width: 140px;
  transition: all 0.3s ease;
}

.orderbook-split-view .current-price-container h5 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  font-family: Consolas, monospace;
}

.orderbook-split-view .current-price-container .text-success {
  color: var(--bid-color, #00b373) !important;
}

.orderbook-split-view .current-price-container .text-danger {
  color: var(--ask-color, #ff5b5b) !important;
}

/* 볼륨 바 */
.orderbook-split-view .volume-bar {
  position: absolute;
  top: 0;
  height: 100%;
  z-index: 0;
}

.orderbook-bid-side .volume-bar {
  right: 0;
  background: linear-gradient(to left, rgba(0, 179, 115, 0.3), rgba(0, 179, 115, 0.1));
}

.orderbook-ask-side .volume-bar {
  left: 0;
  background: linear-gradient(to right, rgba(255, 91, 91, 0.3), rgba(255, 91, 91, 0.1));
}

/* 예상 주문 오버레이 */
.orderbook-split-view .expected-order-overlay {
  position: absolute;
  top: 0;
  height: 100%;
  z-index: 1;
}

.orderbook-bid-side .expected-order-overlay {
  right: 0;
  background: linear-gradient(to left, rgba(0, 200, 83, 0.3), rgba(0, 200, 83, 0.1));
}

.orderbook-ask-side .expected-order-overlay {
  left: 0;
  background: linear-gradient(to right, rgba(246, 70, 93, 0.3), rgba(246, 70, 93, 0.1));
}

/* 매수/매도 영역 배경 그라데이션 */
.orderbook-bid-side .orderbook-body {
  background: linear-gradient(to left, rgba(0, 179, 115, 0.05), transparent);
}

.orderbook-ask-side .orderbook-body {
  background: linear-gradient(to right, rgba(255, 91, 91, 0.05), transparent);
}

/* 영역 구분 강화 */
.orderbook-bid-side {
  border-right: 2px solid var(--border-color);
}

.orderbook-ask-side {
  border-left: 2px solid var(--border-color);
}

/* 내 주문 강조 표시 */
.orderbook-split-view .my-order {
  background-color: rgba(0, 123, 255, 0.1);
}

.orderbook-split-view .my-order:hover {
  background-color: rgba(0, 123, 255, 0.2);
}

/* 스크롤바 스타일 */
.orderbook-split-view .orderbook-body::-webkit-scrollbar {
  width: 6px;
}

.orderbook-split-view .orderbook-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.orderbook-split-view .orderbook-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* 레이아웃 선택 버튼 스타일 */
.layout-selector {
  display: flex;
  gap: 4px;
}

.btn-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 30px;
  padding: 0;
  margin: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-layout:hover {
  background-color: rgba(0, 123, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn-layout.active {
  background-color: rgba(0, 123, 255, 0.2);
  border-color: var(--progress-bar);
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.layout-icon {
  width: 28px;
  height: 22px;
  padding: 2px;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  border-radius: 3px;
}

/* 상하 레이아웃 아이콘 */
.layout-vertical {
  flex-direction: column;
  justify-content: space-between;
}

.layout-row {
  height: 8px;
  border-radius: 2px;
}

.layout-row-small {
  height: 3px;
  margin: 1px 0;
  border-radius: 1px;
}

.layout-divider {
  height: 2px;
  margin: 2px 0;
  background-color: var(--border-color);
}

/* 좌우 레이아웃 아이콘 */
.layout-horizontal {
  flex-direction: row;
  justify-content: space-between;
}

.layout-col {
  width: 11px;
  height: 100%;
  border-radius: 2px;
}

.layout-col-small {
  width: 4px;
  height: 100%;
  margin: 0 1px;
  border-radius: 1px;
}

.layout-divider-vertical {
  width: 2px;
  margin: 0 2px;
  background-color: var(--border-color);
}

/* 커스텀 레이아웃 1 (상하 여러개) */
.layout-custom1 {
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
}

/* 커스텀 레이아웃 2 (좌우 여러개) */
.layout-custom2 {
  flex-direction: row;
  justify-content: space-between;
  gap: 0;
}

/* 매수/매도 영역 색상 */
.layout-icon .ask {
  background-color: var(--ask-color);
}

.layout-icon .bid {
  background-color: var(--bid-color);
}

.orderbook-split-view .my-order:hover {
  background-color: rgba(0, 123, 255, 0.2);
}

/* 다단 상하 레이아웃 스타일 - 매수 목록만 표시 */
.orderbook-multi-view-vertical {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 600px;
  overflow: hidden;
  background-color: var(--bg-primary);
  border-radius: 4px;
}

.orderbook-multi-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.orderbook-subgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.orderbook-multi-view-vertical .orderbook-body {
  max-height: 550px; /* 매도 영역이 없으므로 더 높은 값으로 조정 */
  overflow-y: auto;
}

.orderbook-multi-view-vertical .orderbook-body.bids {
  display: flex;
  flex-direction: column;
}

.orderbook-multi-view-vertical .orderbook-row {
  display: flex;
  height: 24px;
  line-height: 24px;
  position: relative;
  background-color: var(--bg-primary);
  transition: all 0.2s ease;
}

/* 다단 좌우 레이아웃 스타일 - 매도 목록만 표시 */
.orderbook-multi-view-horizontal {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 600px;
  overflow: hidden;
  background-color: var(--bg-primary);
  border-radius: 4px;
}

.multi-horizontal-container {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

/* 전체 너비 사용 */
.orderbook-multi-side.full-width {
  flex: 1;
  width: 100%;
}

.orderbook-multi-side {
  border-right: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.orderbook-multi-side:last-child {
  border-right: none;
}

.orderbook-multi-view-horizontal .orderbook-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  max-height: 574px;
  overflow-y: auto;
}

.orderbook-multi-view-horizontal .orderbook-row {
  height: 24px;
  line-height: 24px;
  display: flex;
  position: relative;
}

/* 왼쪽으로 이동한 현재가 */
.current-price-container.multi-price.left {
  position: absolute;
  top: 50%;
  left: 10%; /* 중앙에서 왼쪽으로 이동 */
  transform: translate(-50%, -50%);
  z-index: 20;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px 16px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  min-width: 120px;
}

.orderbook-multi-view-vertical .current-price {
  background-color: var(--bg-secondary);
  padding: 12px 0;
  margin-bottom: 10px;
}

/* 볼륨 바 강화 - 매도만 표시할 때 */
.orderbook-ask-side.full-width .volume-bar {
  left: 0;
  background: linear-gradient(to right, rgba(255, 91, 91, 0.4), rgba(255, 91, 91, 0.1));
}

/* 매수만 표시할 때 볼륨 바 강화 */
.orderbook-multi-view-vertical .orderbook-row.bid-row::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: var(--volume-percent, 50%);
  height: 100%;
  background-color: rgba(14, 203, 129, 0.1);
  z-index: 0;
}

/* 스크롤바 개선 */
.orderbook-multi-view-vertical .orderbook-body::-webkit-scrollbar,
.orderbook-multi-view-horizontal .orderbook-body::-webkit-scrollbar {
  width: 6px;
}

.orderbook-multi-view-vertical .orderbook-body::-webkit-scrollbar-track,
.orderbook-multi-view-horizontal .orderbook-body::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

.orderbook-multi-view-vertical .orderbook-body::-webkit-scrollbar-thumb,
.orderbook-multi-view-horizontal .orderbook-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.orderbook-multi-view-horizontal .orderbook-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.orderbook-split-view .my-order:hover {
  background-color: rgba(0, 123, 255, 0.2);
}

/* 매수만 보기 스타일 */
.orderbook-bid-only-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 600px;
  overflow: hidden;
  background-color: var(--bg-primary);
  border-radius: 4px;
}

.orderbook-bid-only-view .orderbook-body {
  max-height: 550px;
  overflow-y: auto;
}

.orderbook-bid-only-view .current-price {
  background-color: var(--bg-secondary);
  padding: 8px 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-color);
}

/* 매도만 보기 스타일 */
.orderbook-ask-only-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 600px;
  overflow: hidden;
  background-color: var(--bg-primary);
  border-radius: 4px;
}

.orderbook-ask-only-view .orderbook-body {
  max-height: 550px;
  overflow-y: auto;
}

.orderbook-ask-only-view .current-price {
  background-color: var(--bg-secondary);
  padding: 8px 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-color);
}

/* 매수/매도만 보기 레이아웃 아이콘 */
.layout-icon.layout-bid-only {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-primary);
}

.layout-icon.layout-bid-only .layout-row {
  height: 16px;
  width: 100%;
  border-radius: 2px;
}

.layout-icon.layout-ask-only {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-primary);
}

.layout-icon.layout-ask-only .layout-row {
  height: 16px;
  width: 100%;
  border-radius: 2px;
}

/* 스크롤바 개선 */
.orderbook-bid-only-view .orderbook-body::-webkit-scrollbar,
.orderbook-ask-only-view .orderbook-body::-webkit-scrollbar {
  width: 6px;
}

.orderbook-bid-only-view .orderbook-body::-webkit-scrollbar-track,
.orderbook-ask-only-view .orderbook-body::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

.orderbook-bid-only-view .orderbook-body::-webkit-scrollbar-thumb,
.orderbook-ask-only-view .orderbook-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

/* 매수만 보기 볼륨 바 */
.orderbook-bid-only-view .orderbook-row.bid-row {
  position: relative;
  overflow: hidden;
}

.orderbook-bid-only-view .orderbook-row.bid-row::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  background-color: rgba(14, 203, 129, 0.15);
  z-index: 0;
  width: var(--volume-percent, 0);
}

/* 매도만 보기 볼륨 바 */
.orderbook-ask-only-view .orderbook-row.ask-row {
  position: relative;
  overflow: hidden;
}

.orderbook-ask-only-view .orderbook-row.ask-row::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  background-color: rgba(255, 91, 91, 0.15);
  z-index: 0;
  width: var(--volume-percent, 0);
}

/* 볼륨 바 위에 셀 내용 표시 */
.orderbook-bid-only-view .orderbook-cell,
.orderbook-ask-only-view .orderbook-cell {
  position: relative;
  z-index: 1;
}

/* 체결 목록 스타일 */
.trade-history-container {
  display: flex;
  flex-direction: column;
  height: 716px;
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.trade-history-header {
  display: flex;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  background-color: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.trade-history-header .trade-cell:first-child {
  text-align: left;
  padding-left: 8px;
}

.trade-history-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 722px;
  scrollbar-width: thin;
}

.trade-row {
  display: flex;
  height: 19px;
  line-height: 19px;
  position: relative;
  font-size: 12px;
  font-family: Consolas, monospace;
  border-bottom: 1px solid rgba(87, 87, 87, 0.05);
}

.trade-row:hover {
  background-color: var(--btn-hover, rgba(0, 0, 0, 0.05));
}

.trade-cell {
  flex: 1;
  text-align: right;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 1;
}

.trade-row .trade-cell:first-child {
  text-align: left;
  padding-left: 8px;
}

/* 매수/매도 스타일 */
.trade-row.buy .trade-cell:nth-child(2) {
  color: var(--bid-color);
  font-weight: 600;
}

.trade-row.sell .trade-cell:nth-child(2) {
  color: var(--ask-color);
  font-weight: 600;
}

/* 배경색 추가 */
.trade-row.buy {
  background-color: rgba(14, 203, 129, 0.05);
}

.trade-row.sell {
  background-color: rgba(246, 70, 93, 0.05);
}

.trade-row.buy:hover {
  background-color: rgba(14, 203, 129, 0.1);
}

.trade-row.sell:hover {
  background-color: rgba(246, 70, 93, 0.1);
}

/* 스크롤바 스타일 */
.trade-history-body::-webkit-scrollbar {
  width: 6px;
}

.trade-history-body::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

.trade-history-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

/* 체결 내역 없음 메시지 */
.no-trades {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 200px;
  color: var(--text-secondary);
  font-size: 12px;
}

/* 트레이딩 섹션 레이아웃 수정 */
.row.g-4 > .col-4 {
  width: 30%;
  flex: 0 0 30%;
  min-width: 330px;
  max-width: 30%;
}

.row.g-4 > .col-3 {
  width: 20%;
  flex: 0 0 20%;
  min-width: 220px;
  max-width: 20%;
}

.row.g-4 > .col-5 {
  width: 50%;
  flex: 0 0 50%;
  min-width: 550px;
  max-width: 50%;
}

/* 테마 토글 버튼 스타일 */
.theme-toggle-wrapper {
  position: relative;
  display: inline-block;
  padding: 2px 0;
  margin-right: 5px;
}

#theme-toggle {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
}

.theme-toggle-label {
  display: inline-block;
  cursor: pointer;
  margin: 0;
}

.toggle-track {
  position: relative;
  width: 50px;
  height: 24px;
  border-radius: 12px;
  background: var(--theme-toggle-track);
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px var(--theme-toggle-shadow);
  overflow: hidden;
}

#theme-toggle:checked + .theme-toggle-label .toggle-track {
  background: var(--theme-toggle-track);
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 2;
}

#theme-toggle:checked + .theme-toggle-label .toggle-thumb {
  transform: translateX(26px);
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255, 255, 255, 0.2);
}

.theme-toggle-label:hover .toggle-thumb {
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

.toggle-sun,
.toggle-moon {
  position: absolute;
  top: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.toggle-sun {
  left: 2px;
  opacity: 1;
  color: var(--theme-toggle-sun);
  transform-origin: center;
  transition: all 0.3s ease;
}

.toggle-moon {
  right: 2px;
  opacity: 0.3;
  color: var(--theme-toggle-moon);
  transform-origin: center;
  transition: all 0.3s ease;
}

#theme-toggle:checked + .theme-toggle-label .toggle-sun {
  opacity: 0.3;
  transform: rotate(-15deg);
}

#theme-toggle:checked + .theme-toggle-label .toggle-moon {
  opacity: 1;
  transform: rotate(15deg);
}

/* 애니메이션 효과 추가 */
@keyframes rotate-sun {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes glow-moon {
  0% {
    text-shadow: 0 0 0px rgba(255, 255, 255, 0.5);
  }
  50% {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
  }
  100% {
    text-shadow: 0 0 0px rgba(255, 255, 255, 0.5);
  }
}

/* 호버 효과 추가 */
.theme-toggle-label:hover .toggle-sun i {
  animation: rotate-sun 3s linear infinite;
}

.theme-toggle-label:hover .toggle-moon i {
  animation: glow-moon 2s ease-in-out infinite;
}

/* 반응형 디자인을 위한 미디어 쿼리 */
@media (max-width: 768px) {
  .toggle-track {
    width: 40px !important;
    height: 20px !important;
  }

  .toggle-thumb {
    width: 16px !important;
    height: 16px !important;
  }

  #theme-toggle:checked + .theme-toggle-label .toggle-thumb {
    transform: translateX(20px) !important;
  }
}

/* 테마 전환 시 요소들에 트랜지션 적용 */
.card,
.card-header,
.card-body,
.btn,
.form-control,
.form-select,
.input-group-text,
.table,
.table th,
.table td,
.modal-content,
.alert,
.orderbook-container,
.orderbook-asks,
.orderbook-bids,
.current-price,
.trade-history-container {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* 체결 목록 모달 스타일 */
.trades-modal {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
  z-index: 1050;
}

/* 모달 상단에 화살표 추가 */
.trades-modal:before {
  content: '';
  position: absolute;
  top: -5px;
  right: 25px; /* 화살표 위치 조정 */
  width: 10px;
  height: 10px;
  background-color: var(--bg-primary);
  transform: rotate(45deg);
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
}

/* 체결 목록 모달에서 사용하는 컨테이너 높이 조정 */
.trades-modal .trade-history-container {
  height: 350px;
}

.trades-modal .asset-modal-header h5 {
  font-size: 16px;
  margin: 0;
}

.asset-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
}

.asset-modal-body {
  padding: 0;
  overflow-y: auto;
}

.trade-history-container {
  height: 400px;
  border: none;
}

/* 오더북 모달 스타일 */
.orderbook-modal {
  position: absolute;
  top: 40px;
  transform: translateX(-636px);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-height: 85vh;
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
  z-index: 1050;
}

.orderbook-modal-backdrop,
.trades-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
  z-index: 1040;
}

.orderbook-modal-backdrop.show,
.trades-modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* 추가적인 숫자 표시 스타일 - 숫자가 딱딱 떨어지도록 */
.monospace-numbers {
  font-family: 'IBM Plex Mono', 'Roboto Mono', 'SFMono-Regular', Consolas, monospace;
  letter-spacing: -0.02em;
}

/* 타이틀과 헤더를 위한 폰트 */
h1,
h2,
h3,
h4,
h5,
h6,
.card-title,
.modal-title,
.section-title,
.nav-link,
.btn {
  font-family: 'Inter', 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
}

/* 숫자 렌더링 최적화 */
.number,
.price,
.amount,
.volume,
.percentage,
.total,
.balance {
  -webkit-font-feature-settings: 'tnum';
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}

/* 양수/음수 값 색상 */
.positive {
  color: var(--bid-color) !important;
}

.negative {
  color: var(--ask-color) !important;
}

/* 작은 텍스트 보조 스타일 */
.small-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

/* 체결 내역 표 스타일 */

:root {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --border-color: #dee2e6;
  --progress-bar: #0d6efd;
  --progress-bar-rgb: 13, 110, 253;
  --bid-color: #28a745;
  --bid-color-rgb: 40, 167, 69;
  --ask-color: #dc3545;
  --ask-color-rgb: 220, 53, 69;
}

body.dark {
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --text-primary: #e4e4e4;
  --text-secondary: #ababab;
  --border-color: #2d2d2d;
  --progress-bar: #4b7bf5;
  --progress-bar-rgb: 75, 123, 245;
  --bid-color: #28a745;
  --bid-color-rgb: 40, 167, 69;
  --ask-color: #dc3545;
  --ask-color-rgb: 220, 53, 69;
}

body {
  width: 1920px;
  margin: 0 auto;
  overflow-x: hidden;
  background-color: var(--bg-primary);
}

/* 상단 네비게이션 바 */
.top-navbar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.navbar-brand {
  display: flex;
  align-items: center;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
}

.navbar-brand i {
  margin-right: 8px;
  color: var(--progress-bar);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-item {
  position: relative;
}

.user-dropdown {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
}

.user-dropdown:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.user-dropdown .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--progress-bar);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

/* 모달 스타일로 변경 */
.user-menu-modal {
  position: fixed;
  top: 60px;
  right: 15px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  min-width: 220px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  z-index: 1100;
  display: none;
  overflow: hidden;
}

.user-menu-modal:before {
  content: '';
  position: absolute;
  top: -5px;
  right: 20px;
  width: 10px;
  height: 10px;
  background-color: var(--bg-secondary);
  transform: rotate(45deg);
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
}

.user-menu-modal.show {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  padding: 12px 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
}

.dropdown-item:hover {
  background-color: rgba(var(--progress-bar-rgb), 0.1);
}

.dropdown-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
  color: var(--text-secondary);
}

.dropdown-item:active {
  background-color: rgba(var(--progress-bar-rgb), 0.2);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0;
}

.back-to-menu {
  display: flex;
  align-items: center;
  color: var(--text-primary);
  text-decoration: none;
  margin-right: 16px;
}

.back-to-menu i {
  margin-right: 6px;
}

/* 차트 컨테이너 z-index 조정 */
.chart-container {
  position: relative;
  z-index: 1;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* 자산 카드 모달 스타일 */
.asset-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 600px;
  max-width: 90%;
  background-color: var(--bg-primary);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s, transform 0.3s ease;
  border: 1px solid var(--border-color);
}

.asset-modal.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
}

.asset-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.asset-modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.asset-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-secondary);
}

/* 오더북 및 체결 목록 모달 스타일 */
.orderbook-modal,
.trades-modal {
  background-color: var(--bg-primary);
  z-index: 1050;
  transition: opacity 0.3s ease, visibility 0.3s, transform 0.3s ease;
}

.orderbook-modal-backdrop,
.trades-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.orderbook-modal-backdrop.show,
.trades-modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal-buttons {
  display: flex;
  gap: 10px;
}

/* 실행/중지 버튼 스타일 */
.run-button {
  min-width: 70px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.run-button i {
  margin-right: 5px;
}

.run-button.running {
  background-color: #dc3545;
  border-color: #dc3545;
}

.run-button.stopped {
  background-color: #28a745;
  border-color: #28a745;
}

.timer-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 0.25rem;
}

.dark .timer-badge {
  background-color: rgba(255, 255, 255, 0.1);
}

/* 최근 체결 정보 티커 스타일 */
.recent-trades-ticker {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 4px 0;
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ticker-container {
  width: 100%;
  height: 24px;
  overflow: hidden;
  position: relative;
}

.ticker-wrapper {
  display: flex;
  align-items: center;
  animation: ticker-slide 30s linear infinite;
  white-space: nowrap;
}

@keyframes ticker-slide {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  margin-right: 20px;
  padding: 0 8px;
  height: 24px;
  border-radius: 4px;
  background-color: var(--bg-secondary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ticker-item.buy {
  border-left: 2px solid var(--bid-color);
}

.ticker-item.sell {
  border-left: 2px solid var(--ask-color);
}

.ticker-time {
  margin-right: 6px;
  color: var(--text-secondary);
  font-size: 11px;
}

.ticker-price {
  margin-right: 6px;
  font-weight: 500;
  font-size: 12px;
}

.ticker-item.buy .ticker-price {
  color: var(--bid-color);
}

.ticker-item.sell .ticker-price {
  color: var(--ask-color);
}

.ticker-amount {
  margin-right: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.ticker-item i {
  font-size: 10px;
}

.ticker-item.buy i {
  color: var(--bid-color);
}

.ticker-item.sell i {
  color: var(--ask-color);
}

/* 체결 정보가 새로 추가될 때 애니메이션 */
@keyframes new-trade-pulse {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  20% {
    opacity: 1;
    transform: translateY(0);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

.new-trade {
  animation: new-trade-pulse 1s ease-out;
}

/* 고정된 최신 체결 정보 스타일 */
.fixed-latest-trade {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.latest-trade-badge {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: 8px;
  background-color: var(--bg-secondary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  min-width: 150px;
  width: 100%;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  margin-bottom: 2px;
}

.latest-trade-badge.buy {
  border-left: 3px solid var(--bid-color);
}

.latest-trade-badge.sell {
  border-left: 3px solid var(--ask-color);
}

.latest-trade-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--bid-color);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.latest-trade-badge.buy::before {
  background-color: var(--bid-color);
}

.latest-trade-badge.sell::before {
  background-color: var(--ask-color);
}

.latest-trade-badge.new-trade::before {
  opacity: 1;
  animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.latest-trade-title {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 3px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.latest-trade-price {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
  position: relative;
  z-index: 1;
}

.latest-trade-amount {
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 2px;
  position: relative;
  z-index: 1;
}

.latest-trade-time {
  font-size: 10px;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

.latest-trade-badge i {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 12px;
  z-index: 1;
}

.latest-trade-badge.buy i {
  color: var(--bid-color);
}

.latest-trade-badge.sell i {
  color: var(--ask-color);
}

/* 반응형 디자인을 위한 미디어 쿼리 */
@media (max-width: 768px) {
  .toggle-track {
    width: 40px !important;
    height: 20px !important;
  }

  .toggle-thumb {
    width: 16px !important;
    height: 16px !important;
  }

  #theme-toggle:checked + .theme-toggle-label .toggle-thumb {
    transform: translateX(20px) !important;
  }
}

/* 체결 알림 컨테이너 스타일 */
.trade-notifications-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 80vh;
  overflow-y: auto;
  padding-right: 5px;
  position: relative;
  min-width: 180px;
}

/* 체결 카드 진입/퇴장 애니메이션 */
.trade-notification-enter-active {
  transition: all 0.6s cubic-bezier(0.25, 0.8, 0.5, 1);
}

.trade-notification-leave-active {
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.5, 1);
  position: absolute;
  width: 100%;
  right: 0;
}

.trade-notification-enter-from {
  opacity: 0;
  transform: translateY(-20px);
}

.trade-notification-leave-to {
  opacity: 0;
  transform: translateY(20px);
}

/* 카드가 서로 부드럽게 위치 이동할 수 있도록 함 */
.trade-notification-move {
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.5, 1);
}

/* 주문 개수 배지 스타일 */
.order-count-badge {
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
  margin-left: 10px;
}

.order-count-badge .badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4em 0.8em;
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  border-radius: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  background-color: #17a2b8;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.dark .order-count-badge .badge {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.order-count-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-left: 6px;
}

/* 주문 개수 변경 애니메이션 */
@keyframes count-change {
  0% {
    transform: scale(1);
    background-color: #17a2b8;
  }
  30% {
    transform: scale(1.15);
    background-color: #28a745;
  }
  70% {
    transform: scale(1.1);
    background-color: #28a745;
  }
  100% {
    transform: scale(1);
    background-color: #17a2b8;
  }
}

.count-changed {
  animation: count-change 0.8s ease;
}

/* 맥동 효과 추가 */
.badge.pulsing {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.7);
  }
  70% {
    box-shadow: 0 0 0 5px rgba(23, 162, 184, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(23, 162, 184, 0);
  }
}

.latest-trade-badge.buy.new-trade::after {
  background: rgba(var(--bid-color-rgb), 0.2);
}

.latest-trade-badge.sell.new-trade::after {
  background: rgba(var(--ask-color-rgb), 0.2);
}

.latest-trade-badge.buy .latest-trade-price {
  color: var(--bid-color);
}

.latest-trade-badge.sell .latest-trade-price {
  color: var(--ask-color);
}

/* 반짝이는 효과 대신 서서히 변하는 배경 효과 */
.latest-trade-badge.new-trade {
  animation: none;
  position: relative;
  overflow: hidden;
}

.latest-trade-badge.new-trade::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(var(--progress-bar-rgb), 0.2);
  z-index: 0;
  opacity: 0;
  animation: gentle-highlight 1.5s ease-in-out;
  animation-fill-mode: forwards;
}

@keyframes gentle-highlight {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 0.3;
  }
  70% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
  }
}

/* 지갑 요약 정보 스타일 */
.wallet-summary {
  background-color: var(--bg-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: 12px;
}

.wallet-label {
  color: var(--text-secondary);
  margin-right: 3px;
  font-size: 11px;
}

.wallet-value {
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 6px;
}

.wallet-divider {
  color: var(--border-color);
  margin: 0 6px 0 0;
  font-size: 10px;
}

.elym-holding,
.usdt-holding {
  color: #28a745;
}

.elym-circulating {
  color: #dc3545;
}

.badge-sm {
  font-size: 9px !important;
  padding: 2px 4px !important;
}

/* 사용량 진행 막대 스타일 */
.usage-bar {
  margin-top: 4px;
  width: 100%;
}

.usage-bar .progress {
  margin-bottom: 2px;
  background-color: rgba(0, 0, 0, 0.05);
}

.dark .usage-bar .progress {
  background-color: rgba(255, 255, 255, 0.1);
}

.wallet-details {
  font-size: 8px;
  color: var(--text-secondary);
}

.wallet-details small {
  font-size: 8px;
  margin-bottom: 0;
}

.input-group {
  width: 100px;
}

/* 모달 스타일 개선 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1200;
  display: none;
  backdrop-filter: blur(2px);
}

.modal.show {
  display: block;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  max-width: 800px;
  transform: translateY(-20px);
  transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
  transform: translateY(0);
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header .btn-close {
  padding: 0.5rem;
  margin: -0.5rem -0.5rem -0.5rem auto;
  background-color: transparent;
  border: 0;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
}

.modal-header .btn-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.dark .modal-header .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.dark .modal-header .btn-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
}

/* 다크 모드 대응 */
.dark .modal-content {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.dark .modal-header {
  border-bottom-color: var(--border-color);
}

/* API Key 입력 필드 스타일 */
.input-group .btn-outline-secondary {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.input-group .btn-outline-secondary:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.input-group .form-control {
  border-right: none;
}

.input-group .btn {
  border-left: none;
}

.dark .input-group .btn-outline-secondary {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.dark .input-group .btn-outline-secondary:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

/* 텔레그램 정보 스타일 */
.telegram-info {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.25rem;
  font-size: 0.9rem;
}

.telegram-info .fab {
  color: #0088cc;
}

.telegram-info .telegram-id {
  margin: 0 0.5rem;
  color: var(--text-primary);
}

.telegram-info .btn-link {
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.telegram-info .btn-link:hover {
  color: var(--text-primary);
}

.dark .telegram-info {
  background-color: rgba(255, 255, 255, 0.05);
}

.dark .telegram-info .telegram-id {
  color: var(--text-primary);
}

/* 알림 설정 스타일 */
.notification-settings {
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: 0.5rem;
}

.notification-settings .form-check-label {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.notification-settings .form-check-input:checked {
  background-color: #0088cc;
  border-color: #0088cc;
}

body.dark input[type='number'],
body.dark input[type='number']:focus {
  color: #eaecef !important;
  background-color: transparent !important;
  border: 0px !important;
}
body:not(.dark) input[type='number'],
body:not(.dark) input[type='number']:focus {
  color: #2c3e50 !important;
  background-color: transparent !important;
  border: 0px !important;
}

input[type='number'] {
  text-align: right !important;
}

/* 텔레그램 계정 관리 스타일 */
.telegram-accounts-list {
  max-height: 400px;
  overflow-y: auto;
}

.telegram-account-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background-color: var(--bg-secondary);
  transition: all 0.3s ease;
}

.telegram-account-item:hover {
  border-color: var(--progress-bar);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.telegram-account-item:last-child {
  margin-bottom: 0;
}

.account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.account-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.account-name {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 120px;
}

.account-name i {
  color: #0088cc;
}

.account-status {
  display: flex;
  align-items: center;
}

.account-actions {
  display: flex;
  gap: 0.25rem;
}

.account-actions .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.notification-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.notification-badges .badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
}

.account-edit-form {
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.account-edit-form .form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
}

.account-edit-form .form-control {
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  color: var(--input-text);
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  height: 28px;
}

.account-edit-form .form-check {
  margin-bottom: 0.25rem;
}

.account-edit-form .form-check-label {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.8rem;
}

.account-edit-form h6 {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.no-accounts {
  text-align: center;
  padding: 2rem;
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-secondary);
}

.no-accounts i {
  color: var(--text-secondary);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .account-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .account-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
  }

  .account-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .notification-badges {
    width: 100%;
  }
}

/* 강제 모달 표시 (Vue 수동 모달용) */
.modal.show {
  display: block !important;
  z-index: 2000 !important;
  background: rgba(0, 0, 0, 0.5);
}

/* 차트 카드 스타일 */
.chart-card {
  user-select: none;
  transition: all 0.3s ease;
  border: 2px solid var(--border-color);
  background: var(--bg-primary) !important;
  color: var(--text-primary);
  z-index: 1000 !important;
  position: absolute !important;
  top: 30% !important;
  left: calc(70% - 220px) !important; /* 차트 카드 너비(200px) + 패딩(20px)를 고려하여 오른쪽 끝에 위치 */
  transform: none !important;
  padding: 12px !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  backdrop-filter: blur(5px) !important;
}

.chart-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.chart-card.dragging {
  opacity: 0.8;
  transform: rotate(2deg);
  z-index: 1001;
}
.chart-card .form-control {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.chart-card .form-control:focus {
  background: var(--input-bg);
  border-color: var(--progress-bar);
  color: var(--text-primary);
  box-shadow: 0 0 0 0.2rem rgba(30, 77, 216, 0.25);
}

.chart-card .form-control-plaintext {
  color: var(--text-primary);
  background: transparent;
}

.chart-card .btn {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

.chart-card .btn-outline-primary {
  border-color: var(--progress-bar);
  color: var(--progress-bar);
}

.chart-card .btn-outline-primary:hover {
  background: var(--progress-bar);
  border-color: var(--progress-bar);
  color: white;
}

.chart-card .btn-outline-warning {
  border-color: #ffc107;
  color: #ffc107;
}

.chart-card .btn-outline-warning:hover {
  background: #ffc107;
  border-color: #ffc107;
  color: #212529;
}

.chart-card .btn-outline-secondary {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.chart-card .btn-outline-secondary:hover {
  background: var(--border-color);
  border-color: var(--border-color);
  color: var(--bg-primary);
}

/* 다크 테마에서의 차트 카드 스타일 */
body.dark .chart-card {
  background: rgba(11, 14, 17, 0.95);
  border-color: var(--border-color);
}

body.dark .chart-card .form-control {
  background: var(--input-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark .chart-card .form-control:focus {
  background: var(--input-bg);
  border-color: var(--progress-bar);
  color: var(--text-primary);
}

/* 차트 카드 드래그 영역 */
.chart-card-header {
  cursor: move;
  padding: 8px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  border-radius: 6px 6px 0 0;
}

.chart-card-content {
  padding: 8px;
}

.chart-card-footer {
  padding: 8px;
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 6px 6px;
}

/* 차트 카드 반응형 */
@media (max-width: 768px) {
  .chart-card {
    min-width: 180px;
    font-size: 12px;
  }

  .chart-card .btn {
    font-size: 9px;
    padding: 1px 4px;
  }
}

/* vertical(상하 분할)에서만 첫 번째 셀(가격)에 색상 */
.orderbook-vertical .bid-row .orderbook-cell:first-child {
  color: var(--bid-color) !important;
}

.orderbook-vertical .ask-row .orderbook-cell:first-child {
  color: var(--ask-color) !important;
}

/* horizontal(좌우 분할)에서는 매수 두 번째, 매도 첫 번째 셀(가격)에만 색상 */
.orderbook-horizontal .bid-row .orderbook-cell:nth-child(2) {
  color: var(--bid-color) !important;
}

.orderbook-horizontal .ask-row .orderbook-cell:nth-child(1) {
  color: var(--ask-color) !important;
}
