/* GEX page — light theme */
.gex-page .page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 14px;
  flex-wrap: wrap;
}

.gex-page .page-header h2 {
  font-size: 1.35rem;
  font-weight: 750;
  margin: 0;
}

.gex-page .page-header h2 span { color: var(--accent); }

.gex-page .header-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.gex-page .header-controls select,
.gex-page .header-controls input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
}

.gex-page .header-controls select:focus,
.gex-page .header-controls input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.gex-page .btn-gex {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.gex-page .btn-gex:hover { background: #1d4ed8; }
.gex-page .btn-gex:disabled { opacity: 0.5; cursor: not-allowed; }

.gex-page .metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.gex-page .metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
}

.gex-page .metric-card .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}

.gex-page .metric-card .value { font-size: 1.3rem; font-weight: 700; }
.gex-page .metric-card .value.green { color: var(--green); }
.gex-page .metric-card .value.red { color: var(--red); }
.gex-page .metric-card .value.white { color: var(--text); }
.gex-page .metric-card .sub { font-size: 0.65rem; color: var(--muted); margin-top: 2px; }

.gex-page .info-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.85rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.gex-page .info-bar .price { font-weight: 700; font-size: 1.1rem; }

.gex-page .chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.gex-page .chart-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gex-page .chart-inner { position: relative; width: 100%; overflow: hidden; }

.gex-page .bar-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 88px;
  align-items: center;
  column-gap: 10px;
  margin-bottom: 5px;
  font-size: 0.72rem;
  position: relative;
  min-height: 26px;
}

.gex-page .bar-row .strike-label {
  text-align: right;
  font-weight: 650;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gex-page .bar-row .bars {
  min-width: 0;
  position: relative;
  height: 22px;
  overflow: hidden;
}

.gex-page .bar-row .bar-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.06), transparent 48%, rgba(226, 232, 240, 0.8) 50%, transparent 52%, rgba(5, 150, 105, 0.06));
  border-radius: 5px;
}

.gex-page .bar-call {
  position: absolute;
  left: 50%;
  height: 12px;
  border-radius: 0 5px 5px 0;
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.55), rgba(5, 150, 105, 0.85));
  max-width: 50%;
  min-width: 2px;
  top: 5px;
}

.gex-page .bar-put {
  position: absolute;
  right: 50%;
  height: 12px;
  border-radius: 5px 0 0 5px;
  background: linear-gradient(270deg, rgba(220, 38, 38, 0.55), rgba(220, 38, 38, 0.85));
  max-width: 50%;
  min-width: 2px;
  top: 5px;
}

.gex-page .bar-row .gex-value {
  text-align: right;
  font-weight: 650;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gex-page .bar-row .gex-value.positive { color: var(--green); }
.gex-page .bar-row .gex-value.negative { color: var(--red); }

.gex-page .wall-call { background: rgba(5, 150, 105, 0.08); }
.gex-page .wall-put { background: rgba(220, 38, 38, 0.08); }

.gex-page .center-line {
  position: absolute;
  left: calc(72px + 10px + (100% - 72px - 10px - 88px - 10px) / 2);
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(148, 163, 184, 0.5);
  z-index: 0;
  pointer-events: none;
}

.gex-page .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.gex-page .empty-state i { font-size: 2.5rem; margin-bottom: 12px; }

.gex-page .spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ws-spin 0.6s linear infinite;
}

.gex-page .loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.82);
  z-index: 10;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.gex-page .loading-overlay.active { display: flex; }
.gex-page .chart-wrap { position: relative; }

.gex-page .expiry-chip {
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.gex-page .expiry-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.gex-page .expiry-chip.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

@media (max-width: 768px) {
  .gex-page .metrics { grid-template-columns: repeat(2, 1fr); }
  .gex-page .header-controls { width: 100%; }
  .gex-page .header-controls input#symbolInput { width: 100% !important; }
  .gex-page .bar-row { grid-template-columns: 54px minmax(0, 1fr) 64px; column-gap: 6px; font-size: 0.64rem; }
  .gex-page .center-line { left: calc(54px + 6px + (100% - 54px - 6px - 64px - 6px) / 2); }
}

@media (max-width: 480px) {
  .gex-page .metrics { grid-template-columns: 1fr; }
}

.gex-page .symbol-badge {
  background: #fff !important;
  color: #1e293b !important;
  border: 1px solid #e2e8f0 !important;
  font-weight: 600 !important;
}

.gex-page .call-wall-badge {
  background: #fff !important;
  color: var(--green) !important;
  border: 1px solid var(--green) !important;
  font-weight: 600 !important;
}

.gex-page .put-wall-badge {
  background: #fff !important;
  color: var(--red) !important;
  border: 1px solid var(--red) !important;
  font-weight: 600 !important;
}

.gex-page .symbol-badge {
  background: #fff !important;
  color: #1e293b !important;
  border: 1px solid #e2e8f0 !important;
  font-weight: 600 !important;
}
