/* Universal reset */
* {
  padding: 0;
  overflow: hidden; /* prevent stray scrollbars */
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

.app{
  flex: 1;
  height: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
}

.chart-tooltip {
  position: absolute;
  display: none;
  background: rgba(19, 23, 34, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
  border: 1px solid #2B2B43;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  max-width: 200px;
}

.crosshair-action-button {
  position: absolute;
  display: none;
  width: 20px;
  height: 20px;
  border: 1px solid #2B2B43;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  pointer-events: none;
  z-index: 1001;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

#chartContainer:hover .crosshair-action-button:hover {
  background: #dbeafe;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  transform: scale(1.08);
}

.crosshair-context-menu {
  position: absolute;
  display: none;
  min-width: 140px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  padding: 6px;
  z-index: 1002;
}

.crosshair-context-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
  color: #0f172a;
}

.crosshair-context-item:hover {
  background: #e2e8f0;
}

/* Header & nav */
header {
  background: linear-gradient(135deg, #aa0c88 0%, #033a13 100%);
  color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  flex: 0 0 auto; /* natural height */
}

nav {
  width: 100%;
  padding: 0 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav h1 {
  font-size: 24px;
}

nav a,
nav button {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background 0.3s;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  font-size: 14px;
}

nav a:hover,
nav button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.nav-right {
  display: flex;
  gap: 10px;
}

/* Main container */
#container {
  overflow: hidden; /* prevent stray scrollbars */
  height: 92%;
}

#chartArea {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

#floatingButtons {
  z-index: 20;
  /* position: relative; */
}

.market-depth-panel,
.websocket-debug-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.market-depth-header,
.websocket-debug-header {
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.market-depth-body {
  display: flex;
  gap: 8px;
  padding: 8px;
}

.market-depth-column {
  flex: 1;
  min-width: 0;
}

.market-depth-column-title {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.market-depth-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.market-depth-row,
.market-depth-empty {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 4px;
  background: #f8fafc;
}

.market-depth-price {
  color: #0f172a;
  font-weight: 700;
}

.market-depth-qty {
  color: #16a34a;
  font-weight: 600;
}

.websocket-debug-log {
  margin: 0;
  padding: 10px;
  max-height: 220px;
  overflow: auto;
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  color: #0f172a;
}

/* Sections inside container */
#status {
  margin-top: 20px;
  padding: 15px;
  border-radius: 5px;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.toolbar {
  flex: 0 0 40px; /* fixed height */
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
}

.chart-container {
  height: 96%;
}

.user-info {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
}

.user-info div {
  flex: 1;
}

.user-info h3 {
  margin-bottom: 10px;
  color: #333;
}

.user-info p {
  margin: 5px 0;
  color: #666;
}

/* Footer */
footer {
  background: #333;
  color: white;
  text-align: center;
  padding: 0px;
  flex: 0 0 auto; /* stays at bottom */
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
    color: #555;
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input {
    padding: 8px 10px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.order-type-section {
    margin-top: 15px;
    padding: 10px;
    background: #e9f7fe;
    border-radius: 4px;
}

.order-type-section h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2c5aa0;
}

.hidden {
    display: none;
}

.submit-btn {
    background: #28a745;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    font-weight: bold;
}

.submit-btn:hover {
    background: #218838;
}


#plusButton {
            position: absolute;
            display: none;
            width: 20px;
            height: 20px;
            background: #4CAF50;
            color: white;
            text-align: center;
            line-height: 20px;
            border-radius: 50%;
            cursor: pointer;
            font-weight: bold;
        }