/* =====================================================================
   Institutional Bias (COT) page — styles.
   Matches the TradeViAI design tokens (dark bg, cyan #00F2FE / neon green
   #00FF87 / red #f43f5e / amber #f0b429, Orbitron + JetBrains Mono).
   All classes are prefixed with "cot-" to avoid touching other styles.
   ===================================================================== */

#page-cot .cot-wrap {
  padding: 2px 0 40px;
}

/* Unified panels: every COT info block uses the same neon card as the rest of
   the app (radial gradient + cyan-tinted border, 24px radius). */
#page-cot .card {
  background: radial-gradient(120% 120% at 50% 0%, rgba(15, 23, 39, 0.75) 0%, rgba(7, 11, 18, 0.95) 100%);
  border: 1px solid rgba(0, 242, 254, 0.16);
  border-radius: 12px;
  padding: 24px 28px;
}
#page-cot .card code { color: #00F2FE; }
#page-cot .card strong { color: #fff; }

/* Guarantee the page is visible when active, even if the shared page-reveal
   animation (.page.active { animation: pageIn ... both }) does not run in some
   environments (in-app WebViews, headless/GPU-less browsers) and would leave
   the content stuck at opacity:0. */
#page-cot.page.active {
  animation: none;
  opacity: 1;
}

.cot-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin: 6px 0 18px;
}

.cot-title {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #00F2FE 0%, #00FF87 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cot-sub {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}

.cot-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.cot-week {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cot-lbl {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #64748b;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

.cot-select {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13px;
  min-width: 150px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cot-select:hover { border-color: rgba(0, 242, 254, 0.5); color: #fff; }

.cot-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: #00F2FE;
  border-radius: 7px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cot-btn:hover { background: rgba(0, 242, 254, 0.2); }
.cot-btn svg { width: 16px; height: 16px; }
.cot-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.cot-btn-primary {
  background: linear-gradient(135deg, #00FF87 0%, #00c46b 100%);
  color: #04120a;
  border-color: transparent;
  font-weight: 700;
}

.cot-btn-primary:hover { filter: brightness(1.08); }

.cot-toast {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.cot-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.cot-card { margin-bottom: 20px; }
.cot-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.cot-card-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  font-family: 'Orbitron', sans-serif;
}
.cot-card-title p { margin: 0; font-size: 12px; color: #94a3b8; }

.cot-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.cot-signal-card {
  border-radius: 7px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0f172a;
}
.cot-signal-card .lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
}
.cot-signal-card .val { font-size: 20px; font-weight: 800; }
.cot-signal-card .det { font-size: 12px; color: #94a3b8; margin-top: 4px; }

.cot-table-wrap { overflow-x: auto; }
.cot-table { width: 100%; border-collapse: collapse; }
.cot-table th {
  text-align: left;
  color: #64748b;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}
.cot-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.cot-table tbody tr:hover { background: rgba(15, 23, 39, 0.6); }
.cot-table .c-contract {
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cot-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.cot-flip-row { background: rgba(240, 180, 41, 0.08); }
.cot-flip-row:hover { background: rgba(240, 180, 41, 0.12) !important; }
.cot-signal-cell { text-align: right; }

.cot-sig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.cot-sig {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 7px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.cot-sig .pair { font-weight: 800; font-size: 15px; }
.cot-sig .sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.cot-sig .gap { font-size: 20px; font-weight: 800; text-align: right; }
.cot-sig .gap small { display: block; font-size: 9px; font-weight: 600; color: #64748b; text-transform: uppercase; }

.cot-muted { color: #94a3b8; }
.cot-loading { padding: 48px; text-align: center; color: #94a3b8; }

@media (max-width: 720px) {
  .cot-title { font-size: 22px; }
  .cot-head { flex-direction: column; }
}

/* ---- Strategy Guide modal ---- */
.cot-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.cot-modal.open { display: flex; }
.cot-modal-box {
  width: 100%;
  max-width: 820px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(15, 23, 39, 0.96) 0%, rgba(7, 11, 18, 0.98) 100%);
  border: 1.5px solid rgba(0, 242, 254, 0.9);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 242, 254, 0.2);
}
.cot-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.cot-modal-head h3 { margin: 0; font-size: 17px; font-family: 'Orbitron', sans-serif; }
.cot-modal-head button {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.cot-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.6;
}
.cot-modal-body h4 {
  margin: 0 0 8px;
  color: #00F2FE;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cot-modal-body ul { margin: 6px 0 0; padding-left: 20px; }
.cot-modal-body li { margin-bottom: 4px; }
.cot-modal-body strong { color: #e2e8f0; }
.cot-modal-body code {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
