/* @section:options - Options Page, Chain, Greeks */

/* Options Header */
.options-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.options-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.options-search input {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  width: 120px;
  background: #f8fafc;
  font-family: inherit;
}

.options-search input:focus {
  outline: none;
  border-color: #818cf8;
  background: #fff;
}

/* Options History Strip */
.options-history {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  -webkit-overflow-scrolling: touch;
}

.options-history:empty {
  display: none;
}

.btn-chain {
  background: #334155;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-chain:hover {
  background: #475569;
}

.btn-copy {
  background: #f1f5f9;
  color: #334155;
  font-size: 16px;
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: #e2e8f0;
}

.btn-copy.copied {
  background: #d1fae5;
  border-color: #10b981;
}

.options-spot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spot-price {
  font-size: 24px;
  font-weight: 800;
  color: #1e293b;
}

.spot-change {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}

.spot-change.positive { background: #d1fae5; color: #059669; }
.spot-change.negative { background: #fee2e2; color: #dc2626; }

/* Quick Stats Bar */
.opt-stats-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e2e8f0;
}

.opt-stat {
  background: #fff;
  padding: 8px 10px;
  text-align: center;
  position: relative;
}

.opt-stat-label {
  font-size: 9px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.opt-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
}

.opt-stat-value.high { color: #ef4444; }
.opt-stat-value.low { color: #10b981; }
.opt-stat-value.neutral { color: #f59e0b; }

.opt-stat-hint {
  font-size: 8px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #e2e8f0;
  padding: 1px;
}

/* Section Styling */
.opt-section {
  background: #fff;
  display: flex;
  flex-direction: column;
}

.opt-section-wide {
  grid-column: span 2;
}

.opt-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
  border-left: 3px solid #818cf8;
}

.opt-section-icon {
  font-size: 14px;
}

.opt-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
}

.opt-section-body {
  padding: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Subsection */
.opt-subsection {
  background: #f8fafc;
  border-radius: 4px;
  padding: 8px 10px;
}

.opt-subsection-title {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.opt-subsection-hint {
  font-size: 9px;
  color: #94a3b8;
  margin-bottom: 6px;
  font-style: italic;
}

/* Term Structure */
.term-structure {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.term-label {
  font-size: 10px;
  color: #64748b;
  width: 60px;
  flex-shrink: 0;
}

.term-fill {
  height: 16px;
  background: linear-gradient(90deg, #818cf8 0%, #a78bfa 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.term-value {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  min-width: 40px;
  text-align: right;
}

/* Skew Display */
.skew-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.skew-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #e2e8f0;
}

.skew-label {
  font-size: 10px;
  color: #64748b;
}

.skew-value {
  font-size: 11px;
  font-weight: 700;
}

.skew-diff {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #cbd5e1;
  font-size: 10px;
  font-weight: 600;
}

/* Expected Moves */
.exp-moves {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exp-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.exp-label {
  font-size: 10px;
  color: #64748b;
}

.exp-range {
  font-size: 11px;
  font-weight: 700;
  color: #06b6d4;
}

/* Flow Bars */
.flow-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flow-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flow-label {
  font-size: 10px;
  font-weight: 600;
  width: 40px;
  flex-shrink: 0;
}

.flow-bar-container {
  flex: 1;
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.flow-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s ease;
}

.flow-bar-fill.g { background: linear-gradient(90deg, #34d399 0%, #10b981 100%); }
.flow-bar-fill.r { background: linear-gradient(90deg, #f87171 0%, #ef4444 100%); }

.flow-value {
  font-size: 10px;
  font-weight: 700;
  min-width: 50px;
  text-align: right;
  color: #1e293b;
}

.flow-metrics {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
}

.fm {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fm span:first-child {
  font-size: 9px;
  color: #94a3b8;
}

.fm span:last-child {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

/* Sentiment Gauge */
.sentiment-gauge {
  padding: 4px 0;
}

.gauge-track {
  height: 20px;
  background: linear-gradient(90deg, #ef4444 0%, #fbbf24 50%, #10b981 100%);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.gauge-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: rgba(255,255,255,0.3);
}

.gauge-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 24px;
  background: #1e293b;
  border: 2px solid #fff;
  border-radius: 4px;
  transition: left 0.3s ease;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 9px;
  color: #64748b;
}

.gauge-value {
  text-align: center;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

/* Max Pain Grid */
.maxpain-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid #e2e8f0;
}

.mp-exp {
  font-size: 10px;
  color: #64748b;
  width: 70px;
  flex-shrink: 0;
}

.mp-strike {
  font-size: 14px;
  font-weight: 800;
  flex: 1;
}

.mp-dist {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
}

.mp-dist.up { color: #10b981; }
.mp-dist.down { color: #ef4444; }

/* OI Walls */
.oi-walls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.oi-wall-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.oi-wall-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 2px solid currentColor;
}

.oi-wall-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
}

/* GEX Display */
.gex-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gex-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 11px;
}

.gex-row span:first-child {
  color: #64748b;
}

.gex-row span:last-child {
  font-weight: 700;
}

.gex-trading-style {
  margin-top: 6px;
  padding: 6px 8px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #a5b4fc;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gex-trading-style:empty {
  display: none;
}

/* Options Chain */
.chain-controls {
  display: flex;
  gap: 6px;
  margin-left: auto;
  align-items: center;
}

.chain-filters {
  display: flex;
  gap: 6px;
}

.chain-controls select {
  padding: 6px 10px;
  font-size: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
}

.chain-toggle {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.chain-toggle:hover { background: #f1f5f9; }
.chain-toggle.active {
  background: #818cf8;
  color: #fff;
  border-color: #818cf8;
}

.chain-wrapper {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.chain-header {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.chain-side {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 8px 6px;
}

.chain-side.calls { background: rgba(16, 185, 129, 0.05); }
.chain-side.puts { background: rgba(239, 68, 68, 0.05); }

.chain-side span {
  text-align: center;
}

.chain-strike-header {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #1e293b;
  background: #f1f5f9;
}

.chain-body {
  max-height: 300px;
  overflow-y: auto;
}

.chain-row {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  border-bottom: 1px solid #f1f5f9;
  font-size: 10px;
  transition: background 0.15s;
}

.chain-row:hover { background: #fafafa; }

.chain-row.atm { background: #fef3c7; }
.chain-row.itm-call .chain-calls { background: rgba(16, 185, 129, 0.1); }
.chain-row.itm-put .chain-puts { background: rgba(239, 68, 68, 0.1); }

.chain-calls, .chain-puts {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 6px;
}

.chain-calls span, .chain-puts span {
  text-align: center;
  font-weight: 500;
}

.chain-strike {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  color: #1e293b;
  background: #f8fafc;
}

.chain-loading {
  padding: 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

.chain-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 6px;
  font-size: 10px;
  color: #64748b;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-dot.itm { background: #10b981; }
.legend-dot.atm { background: #f59e0b; }
.legend-dot.otm { background: #e2e8f0; }

/* Scanner Filters */
.scanner-filters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.filter-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-row label {
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.filter-row select {
  padding: 6px 10px;
  font-size: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
}

.btn-scan {
  grid-column: span 2;
  margin-top: 4px;
}

/* Scanner Results */
.scanner-results {
  max-height: 180px;
  overflow-y: auto;
}

.scan-empty {
  padding: 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 11px;
}

.scan-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px;
  transition: background 0.15s;
}

.scan-result:hover { background: #f8fafc; }

.scan-contract {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scan-ticker {
  font-weight: 700;
  color: #1e293b;
}

.scan-details {
  font-size: 10px;
  color: #64748b;
}

.scan-metrics {
  display: flex;
  gap: 12px;
  font-size: 10px;
}

.scan-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.scan-metric-label {
  color: #94a3b8;
  font-size: 8px;
}

.scan-metric-value {
  font-weight: 700;
  color: #1e293b;
}

/* AI Options Output */
.ai-options-output {
  min-height: 40px;
  font-size: 11px;
  line-height: 1.5;
  color: #475569;
}

.ai-loading {
  color: #94a3b8;
  font-style: italic;
}

.btn-ai-refresh {
  margin-top: 8px;
  width: 100%;
}
