/* src/index.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body,
#root {
  height: 100%;
  width: 100%;
}
body {
  margin: 0;
  padding: 0;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Roboto",
    "Oxygen",
    "Ubuntu",
    "Cantarell",
    "Fira Sans",
    "Droid Sans",
    "Helvetica Neue",
    sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333333;
  background-color: #fafafa;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
}
:root {
  --color-primary: #0066cc;
  --color-primary-light: #e8f0ff;
  --color-primary-dark: #004ca3;
  --color-neutral-dark: #1a1a1a;
  --color-neutral-light: #f5f5f5;
  --color-border: #d9d9d9;
  --color-border-light: #efefef;
  --color-bg-hover: #f0f0f0;
  --color-text-primary: #262626;
  --color-text-secondary: #666666;
  --grid-border: #e5e7eb;
  --grid-border-width: 1px;
  --grid-border-radius: 6px;
  --grid-bg: #ffffff;
  --grid-bg-alt: #f9fafb;
  --grid-header-bg: #f3f4f6;
  --grid-footer-bg: #f9fafb;
  --grid-text: #111827;
  --grid-text-secondary: #6b7280;
  --grid-text-muted: #9ca3af;
  --grid-header-text: #374151;
  --grid-primary: #3b82f6;
  --grid-selected: rgba(59, 130, 246, 0.08);
  --grid-hover: #f9fafb;
  --grid-active: #eff6ff;
  --grid-cell-padding: 10px 12px;
  --grid-header-padding: 10px 12px;
  --grid-font-size: 13px;
  --grid-font-size-sm: 12px;
  --grid-header-font-weight: 600;
  --grid-shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
  --grid-text-inverse: #ffffff;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}
.virtual-scroller-container {
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}
.virtual-scroller-container::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
}
.virtual-scroller-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 0;
}
.virtual-scroller-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 6px;
  border: 2px solid #f1f1f1;
}
.virtual-scroller-container::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* src/components/DataGrid/ContextMenu.css */
.context-menu {
  position: fixed;
  background: var(--context-menu-bg, #ffffff);
  border: 1px solid var(--context-menu-border, #d0d0d0);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  max-width: 320px;
  padding: 4px 0;
  z-index: 10000;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--context-menu-text, #333333);
  user-select: none;
  animation: contextMenuFadeIn 0.12s ease-out;
}
@keyframes contextMenuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.context-menu-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.1s ease;
  gap: 8px;
  position: relative;
}
.context-menu-item:hover:not(.disabled) {
  background-color: var(--context-menu-hover-bg, #f0f0f0);
}
.context-menu-item:active:not(.disabled) {
  background-color: var(--context-menu-active-bg, #e5e5e5);
}
.context-menu-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.context-menu-item.danger {
  color: var(--context-menu-danger, #dc3545);
}
.context-menu-item.danger:hover:not(.disabled) {
  background-color: var(--context-menu-danger-hover-bg, #fff0f0);
}
.context-menu-icon {
  font-size: 16px;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.context-menu-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.context-menu-shortcut {
  font-size: 12px;
  color: var(--context-menu-shortcut, #888888);
  margin-left: auto;
  padding-left: 16px;
}
.context-menu-arrow {
  margin-left: auto;
  font-size: 10px;
  color: var(--context-menu-arrow, #888888);
}
.context-menu-separator {
  height: 1px;
  background-color: var(--context-menu-separator, #e0e0e0);
  margin: 4px 0;
}
@media (prefers-color-scheme: dark) {
  .context-menu {
    --context-menu-bg: #2a2a2a;
    --context-menu-border: #404040;
    --context-menu-text: #e0e0e0;
    --context-menu-hover-bg: #3a3a3a;
    --context-menu-active-bg: #4a4a4a;
    --context-menu-separator: #404040;
    --context-menu-shortcut: #999999;
    --context-menu-arrow: #999999;
    --context-menu-danger: #ff6b6b;
    --context-menu-danger-hover-bg: #3a2a2a;
  }
}
.data-grid.theme-quartz .context-menu {
  --context-menu-bg: #ffffff;
  --context-menu-border: #c5c5c5;
  --context-menu-text: #000000;
  --context-menu-hover-bg: #e6f2ff;
  --context-menu-active-bg: #cce5ff;
}
.data-grid.theme-alpine .context-menu {
  --context-menu-bg: #f8f9fa;
  --context-menu-border: #dee2e6;
  --context-menu-text: #212529;
  --context-menu-hover-bg: #e9ecef;
  --context-menu-active-bg: #dee2e6;
}
.data-grid.theme-balham .context-menu {
  --context-menu-bg: #ffffff;
  --context-menu-border: #bdc3c7;
  --context-menu-text: #2c3e50;
  --context-menu-hover-bg: #ecf0f1;
  --context-menu-active-bg: #d5dbdb;
}
.data-grid.theme-material .context-menu {
  --context-menu-bg: #ffffff;
  --context-menu-border: #e0e0e0;
  --context-menu-text: #212121;
  --context-menu-hover-bg: #f5f5f5;
  --context-menu-active-bg: #eeeeee;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.context-menu-item:focus {
  outline: 2px solid var(--context-menu-focus, #0066cc);
  outline-offset: -2px;
}
.context-menu-item:focus:not(:focus-visible) {
  outline: none;
}

/* src/components/DataGrid/MarketDataGrid.css */
.market-data-grid {
  width: 100%;
  height: 100%;
  overflow: auto;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    sans-serif;
  font-size: 13px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
}
.market-grid-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f5f5f5;
  border-bottom: 2px solid #d0d0d0;
}
.market-grid-header-row {
  display: flex;
  min-width: 100%;
}
.market-grid-header-cell {
  padding: 10px 12px;
  font-weight: 600;
  color: #333;
  border-right: 1px solid #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}
.market-grid-header-cell:last-child {
  border-right: none;
}
.market-grid-body {
  min-width: 100%;
}
.market-grid-row {
  display: flex;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.1s ease;
  cursor: pointer;
}
.market-grid-row:hover {
  background-color: #f9f9f9;
}
.market-grid-row:active {
  background-color: #f0f0f0;
}
.market-grid-cell {
  padding: 8px 12px;
  border-right: 1px solid #f5f5f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  position: relative;
}
.market-grid-cell:last-child {
  border-right: none;
}
.numeric-cell {
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
  font-family:
    "Monaco",
    "Menlo",
    "Consolas",
    monospace;
}
@keyframes flashUp {
  0% {
    background-color: rgba(76, 175, 80, 0);
  }
  20% {
    background-color: rgba(76, 175, 80, 0.4);
  }
  100% {
    background-color: rgba(76, 175, 80, 0);
  }
}
@keyframes flashDown {
  0% {
    background-color: rgba(244, 67, 54, 0);
  }
  20% {
    background-color: rgba(244, 67, 54, 0.4);
  }
  100% {
    background-color: rgba(244, 67, 54, 0);
  }
}
.cell-flash-up {
  animation: flashUp 500ms ease-out;
}
.cell-flash-down {
  animation: flashDown 500ms ease-out;
}
.change-positive {
  color: #4caf50;
  font-weight: 600;
}
.change-negative {
  color: #f44336;
  font-weight: 600;
}
.market-grid-cell[data-field=bid] {
  color: #2196f3;
  font-weight: 500;
}
.market-grid-cell[data-field=ask] {
  color: #ff5722;
  font-weight: 500;
}
.market-grid-cell[data-field=price] {
  font-weight: 700;
  font-size: 14px;
}
.market-grid-cell[data-field=volume],
.market-grid-cell[data-field=size] {
  color: #666;
  font-size: 12px;
}
.market-grid-cell[data-field=symbol],
.market-grid-cell[data-field=id] {
  font-weight: 700;
  color: #1976d2;
  font-family:
    "Monaco",
    "Menlo",
    "Consolas",
    monospace;
}
.density-compact .market-grid-header-cell {
  padding: 6px 8px;
  font-size: 12px;
}
.density-compact .market-grid-cell {
  padding: 4px 8px;
  font-size: 12px;
}
.density-compact .market-grid-cell[data-field=price] {
  font-size: 13px;
}
.density-compact .market-grid-row {
  min-height: 28px;
}
.market-grid-cell[data-field=high] {
  color: #4caf50;
}
.market-grid-cell[data-field=low] {
  color: #f44336;
}
.market-data-grid.loading {
  opacity: 0.6;
  pointer-events: none;
}
.market-data-grid.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2196f3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
.market-data-grid.paused {
  border: 2px solid #ff9800;
}
.market-data-grid.paused::before {
  content: "PAUSED";
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 12px;
  background: #ff9800;
  color: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  z-index: 1000;
  letter-spacing: 1px;
}
.market-data-grid.throttled {
  border: 2px solid #f44336;
}
.market-data-grid.throttled::before {
  content: "THROTTLED";
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 12px;
  background: #f44336;
  color: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  z-index: 1000;
  letter-spacing: 1px;
}
.market-data-grid::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
.market-data-grid::-webkit-scrollbar-track {
  background: #f5f5f5;
}
.market-data-grid::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 6px;
}
.market-data-grid::-webkit-scrollbar-thumb:hover {
  background: #999;
}
.market-data-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}
.market-metrics-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #0f0;
  padding: 8px 12px;
  border-radius: 4px;
  font-family:
    "Monaco",
    "Menlo",
    "Consolas",
    monospace;
  font-size: 11px;
  z-index: 1000;
  pointer-events: none;
  line-height: 1.6;
}
.market-metrics-overlay .metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.market-metrics-overlay .metric-label {
  color: #888;
}
.market-metrics-overlay .metric-value {
  color: #0f0;
  font-weight: 700;
}
.market-metrics-overlay .metric-value.warning {
  color: #ff9800;
}
.market-metrics-overlay .metric-value.critical {
  color: #f44336;
}
.connection-status {
  position: absolute;
  top: 10px;
  right: 120px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  z-index: 1000;
  letter-spacing: 0.5px;
}
.connection-status.connected {
  background: #4caf50;
  color: white;
}
.connection-status.connecting {
  background: #ff9800;
  color: white;
}
.connection-status.disconnected {
  background: #f44336;
  color: white;
}
.connection-status.reconnecting {
  background: #ff9800;
  color: white;
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
@media (max-width: 768px) {
  .market-data-grid {
    font-size: 11px;
  }
  .market-grid-cell {
    padding: 6px 8px;
  }
  .market-grid-header-cell {
    padding: 8px 8px;
  }
}
