/* flow_chart.css - Options Time Machine & 3-Panel Options Flow Chart */

.flow-chart-container {
  background: #080e18;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 24px rgba(0, 229, 255, 0.05);
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.flow-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Scrubber Timeline Bar */
.time-machine-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.scrubber-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scrubber-slider-container {
  flex: 1;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.scrubber-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.scrubber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--aqua-main);
  box-shadow: 0 0 10px var(--aqua-main);
  cursor: pointer;
  transition: transform 0.1s;
}

.scrubber-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.time-badge {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--aqua-main);
  background: var(--aqua-bg);
  border: 1px solid var(--aqua-border);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: 1px;
}

/* 3-Panel Flow Layout */
.flow-3panel-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 8px;
  background: #05080e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 480px;
  min-width: 820px;
}

.panel-call, .panel-put, .panel-candlestick {
  display: flex;
  flex-direction: column;
  position: relative;
}

.panel-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.panel-call .panel-header { color: var(--green-main); }
.panel-put .panel-header { color: var(--red-main); }
.panel-candlestick {
  background: #ffffff !important;
  border-radius: 4px;
}

.panel-candlestick .panel-header { 
  color: #0f172a !important; 
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Volume Bar Profiles */
.strike-row {
  display: flex;
  align-items: center;
  height: 24px;
  font-size: 11px;
  font-family: var(--font-mono);
  position: relative;
  margin-bottom: 2px;
}

.strike-row.atm-strike {
  background: rgba(0, 229, 255, 0.12);
  border: 1px dashed var(--aqua-main);
  border-radius: 2px;
}

.vol-bar-left {
  height: 16px;
  background: linear-gradient(to left, var(--green-main), rgba(0, 230, 118, 0.2));
  border-radius: 2px 0 0 2px;
  margin-right: 4px;
  transition: width 0.2s;
}

.vol-bar-right {
  height: 16px;
  background: linear-gradient(to right, var(--red-main), rgba(255, 23, 68, 0.2));
  border-radius: 0 2px 2px 0;
  margin-left: 4px;
  transition: width 0.2s;
}

.strike-label {
  width: 55px;
  text-align: center;
  font-weight: 700;
  color: #ffffff;
}

.vol-val {
  font-size: 10px;
  color: var(--text-secondary);
}

/* Candlestick Canvas Container */
.candlestick-canvas-box {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: 480px;
  background: #ffffff !important;
  border-radius: 4px;
  overflow: hidden;
  user-select: none;
}

canvas#flowCandleCanvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #ffffff !important;
  border-radius: 4px;
}

/* TradingView Interactive Toolbar & Header Controls */
.tv-chart-topbar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #f8fafc;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 6px 8px;
  border-radius: 4px 4px 0 0;
  user-select: none;
}

.tv-toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.tv-tool-group {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 5px;
  padding: 2px;
  gap: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.tv-group-title {
  font-size: 9px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  padding: 0 4px;
  letter-spacing: 0.3px;
}

.tv-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1.2;
}

.dual-card-toolbar .tv-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.dual-card-toolbar .tv-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.tv-btn-tool.active {
  background: rgba(0, 229, 255, 0.22) !important;
  border-color: #00e5ff !important;
  color: #00e5ff !important;
  font-weight: 700 !important;
}

.tv-btn-danger {
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  background: rgba(239, 68, 68, 0.10) !important;
}

.tv-btn-danger:hover {
  color: #ffffff !important;
  background: rgba(239, 68, 68, 0.28) !important;
  border-color: #ef4444 !important;
}

.inst-seg-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}
.inst-seg-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.inst-seg-btn.active {
  background: rgba(0, 229, 255, 0.2) !important;
  border-color: #00e5ff !important;
  color: #00e5ff !important;
  font-weight: 700;
}

.inst-tbl-filter {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}
.inst-tbl-filter:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.inst-tbl-filter.active {
  background: rgba(56, 189, 248, 0.2) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  font-weight: 700;
}

.tv-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.tv-btn.active {
  background: #0284c7;
  color: #ffffff !important;
  border-color: #0284c7;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}

.tv-btn.active-sma {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

.tv-btn.active-ema {
  background: #ea580c !important;
  color: #ffffff !important;
  border-color: #ea580c !important;
}

.tv-btn.active-bb {
  background: #7c3aed !important;
  color: #ffffff !important;
  border-color: #7c3aed !important;
}

.tv-btn.active-st {
  background: #16a34a !important;
  color: #ffffff !important;
  border-color: #16a34a !important;
}

.tv-btn-danger:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* TradingView Live OHLCV Banner */
.tv-ohlcv-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: #475569;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  padding: 3px 8px;
  overflow-x: auto;
  white-space: nowrap;
}

.tv-ohlcv-val {
  font-weight: 700;
  color: #0f172a;
}

.tv-ohlcv-bull {
  color: #16a34a !important;
}

.tv-ohlcv-bear {
  color: #dc2626 !important;
}

/* Horizontal Timeline Viewport Scroller Track */
.tv-scroller-wrapper {
  background: #f1f5f9;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.tv-scroller-track {
  flex: 1;
  height: 8px;
  background: #cbd5e1;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
}

.tv-scroller-thumb {
  position: absolute;
  top: 0;
  height: 8px;
  background: #0284c7;
  border-radius: 4px;
  cursor: grab;
  transition: background 0.1s;
}

.tv-scroller-thumb:active {
  cursor: grabbing;
  background: #0369a1;
}

.tv-reset-badge {
  font-size: 10.5px;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 4px;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.15s;
}

.tv-reset-badge:hover {
  background: #0284c7;
  color: #fff;
}

/* ================= TV INDICATOR SETTINGS & GEAR BUTTONS ================= */
.tv-btn-gear {
  font-size: 10px;
  opacity: 0.65;
  margin-left: 2px;
  padding: 1px 3px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tv-btn-gear:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.12);
  transform: rotate(45deg);
}

.indicator-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.indicator-modal-card {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  width: 90%;
  max-width: 320px;
  padding: 16px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  animation: fadeInModal 0.18s ease-out;
}
@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.indicator-modal-title {
  font-size: 13.5px;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #38bdf8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}
.indicator-input-group {
  margin-bottom: 12px;
}
.indicator-input-label {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 4px;
  display: block;
  font-weight: 600;
}
.indicator-input-field {
  width: 100%;
  background: #030712;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  outline: none;
  box-sizing: border-box;
}
.indicator-input-field:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}
.indicator-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* ================= OPTIONS GREEKS OVERLAY & UNDERLAY BARS ================= */
.vol-bar-container {
  flex: 1;
  position: relative;
  height: 18px;
  min-width: 60px;
  display: flex;
  align-items: center;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.vol-underlay-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 2px;
  pointer-events: none;
  transition: width 0.25s ease, opacity 0.25s ease, background 0.25s ease;
  z-index: 1;
}

/* Call (CE) bar fills from right (strike edge) to left */
.vol-underlay-left {
  right: 0;
  background: linear-gradient(270deg, #00e676, rgba(0, 230, 118, 0.25));
  opacity: 0.85;
}

/* Put (PE) bar fills from left (strike edge) to right */
.vol-underlay-right {
  left: 0;
  background: linear-gradient(90deg, #ff1744, rgba(255, 23, 68, 0.25));
  opacity: 0.85;
}

/* When Greeks are ON: Bar opacity is rich and vivid (0.72) so bar size and color remain clearly visible */
.flow-3panel-grid.greeks-active .vol-underlay-left {
  opacity: 0.72;
  background: linear-gradient(270deg, #00e676, rgba(0, 230, 118, 0.35));
  box-shadow: inset 0 0 4px rgba(0, 230, 118, 0.35);
}

.flow-3panel-grid.greeks-active .vol-underlay-right {
  opacity: 0.72;
  background: linear-gradient(90deg, #ff1744, rgba(255, 23, 68, 0.35));
  box-shadow: inset 0 0 4px rgba(255, 23, 68, 0.35);
}

/* Greeks Overlay text over the bar */
.greeks-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  pointer-events: none;
  box-sizing: border-box;
}

.flow-3panel-grid.greeks-hidden .greeks-overlay {
  display: none !important;
}

.greek-item {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: -0.2px;
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
  padding: 1px 3px;
}

.greek-item-delta-ce {
  color: #38bdf8; /* Vibrant Sky Blue */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 3px rgba(0, 0, 0, 0.9);
}

.greek-item-delta-pe {
  color: #f87171; /* Vibrant Coral / Red */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 3px rgba(0, 0, 0, 0.9);
}

.greek-item-gamma {
  color: #c084fc; /* Vibrant Light Purple */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 3px rgba(0, 0, 0, 0.9);
}

.greek-symbol {
  font-size: 9px;
  opacity: 0.85;
  margin-right: 2px;
}

/* Header Greek labels */
.greek-header-group {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  box-sizing: border-box;
}

.flow-3panel-grid.greeks-hidden .greek-header-group {
  visibility: hidden;
}

.greek-col {
  font-size: 10px;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
}

/* ================= ALERT CONFLUENCE & STRIKE SURGE HIGHLIGHT ================= */
.strike-surge-ce {
  background: rgba(0, 230, 118, 0.16) !important;
  border-left: 3px solid #00e676 !important;
  box-shadow: inset 0 0 10px rgba(0, 230, 118, 0.25);
}
.strike-surge-pe {
  background: rgba(255, 23, 68, 0.16) !important;
  border-right: 3px solid #ff1744 !important;
  box-shadow: inset 0 0 10px rgba(255, 23, 68, 0.25);
}
.strike-drop-ce {
  background: rgba(239, 68, 68, 0.12) !important;
  border-left: 2px dashed #ef4444 !important;
}
.strike-drop-pe {
  background: rgba(239, 68, 68, 0.12) !important;
  border-right: 2px dashed #ef4444 !important;
}
.strike-chg-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 3px;
  margin-left: 2px;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono, monospace);
}
.strike-chg-up {
  color: #00e676;
  background: rgba(0, 230, 118, 0.15);
}
.strike-chg-down {
  color: #ff1744;
  background: rgba(255, 23, 68, 0.15);
}

/* ================= JITTER-FREE RIGID 3-PANEL GRID ================= */
.flow-3panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.85fr) minmax(0, 1fr) !important;
  gap: 8px;
  background: #030508;
  padding: 8px;
  box-sizing: border-box;
}
.panel-call, .panel-candlestick, .panel-put {
  min-width: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
.tv-ohlcv-bar {
  min-width: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

/* ================= DUAL-CHART & THEME CUSTOMIZER STYLING ================= */
.theme-preset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.theme-preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.theme-preset-btn.active {
  background: rgba(0, 229, 255, 0.15) !important;
  border-color: var(--aqua-main, #00e5ff) !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

.tm-dual-tf-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tm-dual-tf-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.tm-dual-tf-btn.active {
  background: var(--aqua-main, #00e5ff) !important;
  color: #05080e !important;
  border-color: var(--aqua-main, #00e5ff) !important;
  font-weight: 800 !important;
}

#tmDualChartContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 14px;
}

@media (max-width: 900px) {
  #tmDualChartContainer {
    grid-template-columns: 1fr !important;
  }
}




/* Responsive Horizontal Scroll for Chart Toolbars (Dual Chart & 3-Panel) */
.dual-card-toolbar {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.45) transparent;
}
.dual-card-toolbar::-webkit-scrollbar {
  height: 4px;
}
.dual-card-toolbar::-webkit-scrollbar-track {
  background: transparent;
}
.dual-card-toolbar::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.45);
  border-radius: 4px;
}
.dual-card-toolbar > div {
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
}

.tv-chart-topbar {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tv-toolbar-row {
  overflow-x: auto !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.45) transparent;
  padding-bottom: 2px;
}
.tv-toolbar-row::-webkit-scrollbar {
  height: 4px;
}
.tv-toolbar-row::-webkit-scrollbar-track {
  background: transparent;
}
.tv-toolbar-row::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.45);
  border-radius: 4px;
}
.tv-tool-group {
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
}
