/* static/css/theme.css
   Final consolidated theme for Traders OI Dashboard
   - Organized sections
   - Clear comments
   - Improved contrast & header active state
   - DataTables friendly styles
*/

/* =========================
   Root palette & global vars
   ========================= */
:root{
  /* Primary palette */
  --bg-dark: #061427;        /* page background gradient top */
  --bg-dark-2: #071428;      /* page background gradient bottom */
  --panel: #0b1220;          /* card panel base */
  --panel-2: #071826;
  --muted: #99a2b2;          /* muted text */
  --text: #e6f7ff;           /* main text color */
  --accent: #00bcd4;         /* accent / primary button */
  --accent-2: #ff6b6b;       /* secondary accent */
  --glass: rgba(255,255,255,0.03);
  --shadow-1: rgba(2,6,23,0.6);
  --card-border: rgba(255,255,255,0.035);
  --radius-lg: 12px;
}

/* =========================
   Reset & base typography
   ========================= */
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-dark-2) 100%);
  color: var(--text);
}

/* Container */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
}

/* Headings */
h1, h2, h3 { color: var(--text); margin: 0; font-weight: 700; }
h1 { font-size: 28px; letter-spacing: -0.3px; }
.muted, .muted-text { color: var(--muted); }

/* =========================
   Header / Navigation
   ========================= */
.site-header {
  background: linear-gradient(180deg, rgba(2,8,18,0.95), rgba(3,10,18,0.95));
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner { display:flex; align-items:center; gap:20px; max-width:1180px; margin:0 auto; padding:0 20px; }
.brand { display:flex; align-items:center; gap:12px; }
.logo { height: 36px; }
.brand-title { font-weight:700; color: var(--text); }

/* Main nav */
.main-nav { margin-left:auto; display:flex; gap:16px; align-items:center; }
.main-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 600;
  transition: all .14s ease;
}
.main-nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.02);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.65);
}

/* Active tab - boxed & colorful */
.main-nav a.active,
.main-nav a[aria-current="page"] {
  color: #042129;
  background: linear-gradient(180deg, #00d1e0, #00b4c7);
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,188,212,0.12), inset 0 -1px 0 rgba(255,255,255,0.06);
}

/* =========================
   Buttons
   ========================= */
.btn { padding: 8px 14px; border-radius: 8px; border: 0; cursor: pointer; font-weight: 600; }
.btn-primary { background: var(--accent); color: #042129; }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.06); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,0.03); }
.btn.small { padding: 6px 10px; font-size: 13px; }

/* =========================
   Hero & Cards
   ========================= */
.hero { display:flex; gap:24px; align-items:center; margin-top:22px; }
.hero-left { flex: 1; }
.hero-right { width: 460px; display:flex; justify-content:center; }
.hero-img { width:100%; border-radius:10px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }

.card, .instruments-card {
  background: linear-gradient(180deg, rgba(8,14,20,0.90), rgba(6,10,16,0.85));
  padding: 14px;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px var(--shadow-1);
  border: 1px solid var(--card-border);
}

/* Card header text */
.card-head { font-weight:700; margin-bottom:12px; color: var(--text); }

/* =========================
   Login styles
   ========================= */
.login-wrapper {
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:70vh;
}
.login-card {
  width:360px;
  background: var(--panel);
  padding:20px;
  border-radius:12px;
  box-shadow:0 8px 25px rgba(0,0,0,0.55);
  border: 1px solid var(--card-border);
}
.form-input {
  width:100%;
  padding:10px;
  margin-bottom:10px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: var(--text);
}
.error-box {
  background: var(--accent-2);
  padding:8px;
  border-radius:6px;
  margin-bottom:10px;
  text-align:center;
  color: #061427;
}

/* =========================
   Instruments page top bar & controls
   ========================= */
.instruments-wrapper { max-width:1100px; margin: 28px auto; padding: 6px; }
.top-bar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; }
.title-block h1 { margin:0; font-size:20px; color: var(--text); }
.title-block .muted { color: var(--muted); margin-top:4px; }

/* Custom search box & clear */
.search-box { display:flex; gap:8px; align-items:center; }
#dtSearch {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  width: 360px;
  box-shadow: 0 6px 28px rgba(2,6,23,0.6);
}
#clearSearch {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 8px;
}
#clearSearch:hover { color: var(--text); border-color: rgba(255,255,255,0.08); }

/* =========================
   DataTable / Instrument table
   ========================= */

/* Wrapper padding tweak */
#instrumentTable_wrapper { padding: 6px 10px; }

/* Table base */
#instrumentTable {
  width:100% !important;
  border-collapse: collapse;
  color: var(--text);
  font-size: 14px;
}

/* Header: visible, strong, with subtle inset */
#instrumentTable thead th {
  background: linear-gradient(180deg, rgba(15,25,34,0.96), rgba(10,16,24,0.96));
  color: #eaf7ff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 12px 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
  vertical-align: middle;
  box-shadow: 0 4px 12px rgba(1,6,12,0.45) inset;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

/* Make DataTables sort icons visible */
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after {
  color: rgba(230,247,255,0.85) !important;
  opacity: 1 !important;
}

/* Body rows */
#instrumentTable tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background .12s ease, transform .06s ease;
  cursor: pointer;
}
#instrumentTable tbody tr:hover {
  background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  transform: translateY(-1px);
}

/* Body cells */
#instrumentTable tbody td {
  padding: 12px 14px;
  /* color: #7ad1ff; */
}

/* Name link */
.instrument-link {
  /* color: #7ad1ff; */
  text-decoration: none;
  font-weight: 600;
}
.instrument-link:hover { color: #aaf2ff; text-decoration: underline; }

/* Selected row style */
#instrumentTable tbody tr.selected-row {
  background: linear-gradient(90deg, rgba(0,188,212,0.06), rgba(0,188,212,0.03));
}

/* Pagination buttons */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.75) !important;
  border: none;
  padding: 6px 10px;
  margin: 0 4px;
  border-radius: 6px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: linear-gradient(90deg, var(--accent), #2dd4ff);
  color: #042129 !important;
  font-weight: 700;
}

/* Info text */
.dataTables_info { color: rgba(255,255,255,0.6); }

/* Responsive small screen: hide some columns */
@media (max-width: 760px) {
  #dtSearch { width: 100%; }
  #instrumentTable thead th:nth-child(6), #instrumentTable thead th:nth-child(7),
  #instrumentTable tbody td:nth-child(6), #instrumentTable tbody td:nth-child(7) { display:none; }
}

/* =========================
   Misc: charts grid & footer
   ========================= */
.charts-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:20px; }
.card-head { font-weight:700; margin-bottom:12px; color:var(--text); }
.site-footer {
  margin-top:32px;
  padding:16px 0;
  border-top:1px solid rgba(255,255,255,0.03);
  color: var(--muted);
}
.footer-inner { display:flex; justify-content:space-between; align-items:center; }
.footer-links a { color: var(--muted); margin-left:12px; text-decoration:none; }

/* =========================
   Small helpers
   ========================= */
.lead { color: var(--muted); margin-bottom: 18px; }
.form-input:focus, #dtSearch:focus { outline: none; box-shadow: 0 8px 28px rgba(0,188,212,0.06); border-color: rgba(0,188,212,0.12); }

/* End of file */


/* ===========================
   Instrument Detail - visual fixes
   =========================== */

/* Page container adjustments */
.instrument-detail.container {
  max-width: 1180px;
  margin: 28px auto;
  padding: 18px;
  color: var(--text);
}

/* Top row layout — left main + right sidebar */
.detail-top {
  display: grid;
  grid-template-columns: 1fr 380px; /* left: flexible, right: sidebar */
  gap: 20px;
  align-items: start;
}

/* When narrow screens stack columns */
@media (max-width: 1000px) {
  .detail-top { grid-template-columns: 1fr; }
}

/* Left column (charts + summary) */
.left-column { width: 100%; }

/* Right column (fundamentals) */
.right-column { width: 100%; }

/* Card override for instrument detail */
.fund-card, .chart-card, .card {
  background: linear-gradient(180deg, rgba(12,18,26,0.96), rgba(8,12,18,0.9));
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 10px 30px rgba(2,6,23,0.55);
  color: var(--text);
}

/* Header/title styling */
.instrument-detail h2 {
  font-size: 22px;
  margin: 0 0 6px 0;
  color: var(--text);
  letter-spacing: -0.2px;
}
.small-muted { color: var(--muted); font-size: 13px; }

/* Candles chart card - make it larger and visible */
.chart-canvas.card {
  height: 360px;            /* ensure visible area */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* make canvas fill card area */
.chart-canvas canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  background: linear-gradient(180deg, rgba(3,10,16,0.6), rgba(6,10,16,0.45));
  border-radius: 8px;
  padding: 6px;
}

/* Technical summary card sizing */
.fund-card .tech-summary, .fund-card .meta-row {
  margin-top: 10px;
}

/* Indicators card */
.fund-card .small-muted { color: var(--muted); }

/* Make fundamentals panel sticky on larger screens for easier reading */
@media (min-width: 1001px) {
  .right-column .fund-card {
    position: sticky;
    top: 88px;  /* below header */
  }
}

/* Improve readability of list / bullets */
.fund-card ul {
  margin: 8px 0 0 18px;
  color: var(--muted);
}

/* RSI chart card height */
.card.chart-card canvas {
  width: 100% !important;
  height: 140px !important;
  background: linear-gradient(180deg, rgba(3,10,16,0.55), rgba(6,10,16,0.35));
  border-radius: 8px;
  padding: 6px;
}

/* Key/value rows (fundamentals) */
.meta-row { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:6px 0; border-bottom: 1px solid rgba(255,255,255,0.02); }
.meta-row .label { color: var(--muted); font-size: 13px; }
.meta-row .value { font-weight: 700; color: var(--text); }

/* Buttons (back/watch) */
.detail-top .btn-ghost {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--text);
}

/* small tech pills */
.tech-pill { padding:6px 10px; border-radius:999px; background: rgba(255,255,255,0.02); color: var(--muted); font-weight:700; }

/* whitespace below main charts */
.instrument-detail .charts-grid { margin-bottom: 18px; }

/* subtle lighten of card text so it's more readable */
.fund-card, .chart-card { color: rgba(230,247,255,0.94); }

/* reduce global overlay darkness for easier reading of content */
.site-header { box-shadow: none; }
