/* Auto-Trader (paper bots) — ported from the original site's inline styles,
   mapped onto the ace_v2 theme variables. Does NOT redefine .navbar / nav. */

/* ---- Page header ---- */
.at-header {
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(88, 224, 33, 0.08) 100%);
  padding: 1.5rem 1.75rem;
  border-radius: 15px;
  margin-bottom: 1.75rem;
  border: 1px solid var(--border-color);
}
.at-header h1, .at-header h3 { color: var(--text-light); margin-bottom: .4rem; }
.at-header .at-sub { color: var(--text-muted); margin-bottom: 0; }
.at-paper-badge {
  background: rgba(89, 101, 249, .18);
  color: var(--info);
  border: 1px solid var(--info);
  padding: .25rem .7rem;
  border-radius: 14px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ---- Bot selector cards ---- */
.bot-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
  border: 2px solid var(--border-color);
  cursor: pointer;
  height: 100%;
}
.bot-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(88, 224, 33, 0.2);
  border-color: var(--primary);
}
.bot-card.active-bot {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(88, 224, 33, 0.14) 100%);
  box-shadow: 0 8px 28px rgba(88, 224, 33, 0.28);
}
.bot-card.paused-bot { border-color: var(--warning); }
.bot-card .bot-name { font-weight: 700; font-size: 1.05rem; color: var(--text-light); }
.bot-card .bot-meta-row { display: flex; flex-wrap: wrap; gap: .35rem; margin: .55rem 0; }
.bot-card .bot-stats { display: flex; justify-content: space-between; align-items: flex-end; margin-top: .65rem; }
.bot-card .bot-value { font-size: 1.2rem; font-weight: 700; color: var(--text-light); }
.bot-card .bot-pos { color: var(--text-muted); font-size: .85rem; }
.bot-card .bot-tagline { font-size: .76rem; color: var(--text-muted); margin: -.15rem 0 .1rem; opacity: .92; }
.at-disclaimer {
  background: rgba(88,224,33,.06); border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary, #58e021); border-radius: 8px;
  padding: 10px 14px; margin: 0 0 14px; font-size: .82rem; color: var(--text-muted); line-height: 1.5;
}
.at-disclaimer strong { color: var(--text-light); }
.bot-backtest { border:1px solid var(--border-color); border-radius:10px; padding:12px 16px; margin-bottom:14px;
  background: rgba(0,0,0,.18); border-left:4px solid var(--text-muted); }
.bot-backtest.bt-validated { border-left-color:#58e021; background:rgba(88,224,33,.07); }
.bot-backtest.bt-building { border-left-color:#f4b400; background:rgba(244,180,0,.06); }
.bot-backtest-h { font-weight:700; font-size:.9rem; color:var(--text-light); margin-bottom:3px; }
.bot-backtest-b { color:var(--text-light); font-size:.95rem; }
.bot-backtest-note { color:var(--text-muted); font-size:.72rem; margin-top:5px; }

/* ---- Style / status / market badges ---- */
.style-badge, .market-badge, .bot-status-badge {
  display: inline-block;
  padding: .28rem .7rem;
  border-radius: 14px;
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.style-badge.conservative { background: rgba(88, 224, 33, .16); color: var(--success); border: 1px solid var(--success); }
.style-badge.moderate     { background: rgba(88, 224, 33, .16); color: var(--primary); border: 1px solid var(--primary); }
.style-badge.aggressive   { background: rgba(89, 101, 249, .18); color: var(--info);    border: 1px solid var(--info); }
.market-badge { background: rgba(255,255,255,.06); color: var(--text-muted); border: 1px solid var(--border-color); }

.bot-status-badge.active  { background: var(--success); color: #062b24; }
.bot-status-badge.paused  { background: var(--warning); color: #2a2200; }
.bot-status-badge.stopped { background: var(--danger);  color: #fff; }

/* ---- Performance metric cards ---- */
.performance-metric {
  text-align: center;
  padding: 1.25rem 1rem;
  background: var(--card-bg);
  border-radius: 14px;
  border: 1px solid var(--border-color);
  transition: all 0.25s ease;
  height: 100%;
}
.performance-metric:hover { border-color: var(--primary); transform: translateY(-2px); }
.performance-metric .value { font-size: 1.75rem; font-weight: 700; display: block; margin-bottom: .25rem; }
.performance-metric .value.positive { color: var(--success); }
.performance-metric .value.negative { color: var(--danger); }
.performance-metric .value.neutral  { color: var(--text-light); }
.performance-metric .label {
  font-size: .78rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
}

/* ---- Parameter chips strip ---- */
.param-strip { display: flex; flex-wrap: wrap; gap: .55rem; }
.param-chip {
  background: var(--darker-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: .35rem .9rem;
  font-size: .82rem;
  color: var(--text-muted);
}
.param-chip strong { color: var(--text-light); font-weight: 600; }

/* ---- Equity / pie chart containers ---- */
.chart-container {
  position: relative;
  height: 320px;
  padding: 1rem;
  background: var(--darker-bg);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}
.pie-chart-container { position: relative; height: 280px; }

/* ---- Position rows / cards ---- */
.at-table { width: 100%; margin-bottom: 0; color: var(--text-light); }
.at-table th {
  color: var(--text-dim);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border-color);
  padding: .65rem .8rem;
  font-weight: 600;
}
.at-table td { padding: .7rem .8rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.at-table tbody tr:last-child td { border-bottom: none; }
.at-table tbody tr.position-row { border-left: 4px solid var(--primary); transition: background .2s ease; }
.at-table tbody tr.position-row:hover { background: rgba(88, 224, 33, .05); }
.at-table tbody tr.position-row.winning { border-left-color: var(--success); }
.at-table tbody tr.position-row.losing  { border-left-color: var(--danger); }
.sym-cell { font-weight: 700; color: var(--primary); }

.pl-pos { color: var(--success); font-weight: 600; }
.pl-neg { color: var(--danger);  font-weight: 600; }

/* ---- Trade side badges ---- */
.trade-badge {
  padding: .28rem .8rem;
  border-radius: 14px;
  font-size: .76rem;
  font-weight: 700;
}
.trade-badge.buy  { background: rgba(88, 224, 33, 0.18); color: var(--success); border: 1px solid var(--success); }
.trade-badge.sell { background: rgba(255, 82, 82, 0.18);  color: var(--danger);  border: 1px solid var(--danger); }

/* ---- Settings sections ---- */
.settings-section {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}
.settings-section h5 { color: var(--primary); font-weight: 600; margin-bottom: 1rem; }

/* ---- Preset radio-cards ---- */
.preset-selector { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.preset-option {
  flex: 1;
  min-width: 140px;
  text-align: center;
  padding: 1.25rem 1rem;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.preset-option:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(88, 224, 33, 0.25);
}
.preset-option.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(88, 224, 33, 0.2) 100%);
}
.preset-option .icon { font-size: 2rem; margin-bottom: .4rem; }
.preset-option .name { font-weight: 600; color: var(--text-light); margin-bottom: .2rem; }
.preset-option .description { font-size: .82rem; color: var(--text-muted); }

/* ---- Buttons ---- */
.btn-bot-action, .btn-bot-primary, .btn-bot-success,
.btn-bot-warning, .btn-bot-danger, .btn-bot-info {
  padding: .55rem 1.35rem;
  border-radius: 24px;
  font-weight: 600;
  border: none;
  transition: all 0.25s ease;
  cursor: pointer;
}
.btn-bot-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%); color: #fff; }
.btn-bot-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(88, 224, 33, 0.4); color: #fff; }
.btn-bot-success { background: var(--success); color: #052b24; }
.btn-bot-success:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(88, 224, 33, 0.4); color: #052b24; }
.btn-bot-warning { background: var(--warning); color: #2a2200; }
.btn-bot-warning:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(255, 186, 0, 0.35); color: #2a2200; }
.btn-bot-danger { background: var(--danger); color: #fff; }
.btn-bot-danger:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(255, 82, 82, 0.4); color: #fff; }
.btn-bot-info { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; }
.btn-bot-info:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5); color: #fff; }
.btn-bot-action:disabled, .btn-bot-primary:disabled, .btn-bot-success:disabled,
.btn-bot-danger:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  background: var(--card-bg);
  border-radius: 15px;
  border: 2px dashed var(--border-color);
}
.empty-state i { font-size: 4rem; color: var(--text-dim); margin-bottom: 1.25rem; }
.empty-state h4 { color: var(--text-light); margin-bottom: .75rem; }
.empty-state p { color: var(--text-muted); }

/* ---- Tabs (pills) ---- */
.at-tabs .nav-link {
  color: var(--text-muted);
  font-weight: 600;
  border-radius: 22px;
}
.at-tabs .nav-link.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
  color: #fff;
}

/* ---- Analytics stat grid ---- */
.analytics-stat {
  text-align: center;
  padding: 1rem .5rem;
  background: var(--darker-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  height: 100%;
}
.analytics-stat .v { font-size: 1.4rem; font-weight: 700; color: var(--text-light); }
.analytics-stat .l { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---- Form controls (scoped, mirror original) ---- */
#at-settings .form-control, #at-settings .form-select,
.at-modal .form-control, .at-modal .form-select {
  background: var(--darker-bg);
  border: 1px solid var(--border-color);
  color: var(--text-light);
}
#at-settings .form-control:focus, #at-settings .form-select:focus,
.at-modal .form-control:focus, .at-modal .form-select:focus {
  background: var(--darker-bg);
  border-color: var(--primary);
  color: var(--text-light);
  box-shadow: 0 0 0 0.2rem rgba(88, 224, 33, 0.25);
}
#at-settings .form-label, .at-modal .form-label { color: var(--text-light); font-weight: 500; }

/* ---- Modal ---- */
.at-modal .modal-content { background: var(--card-bg); border: 1px solid var(--border-color); }
.at-modal .modal-header, .at-modal .modal-footer { border-color: var(--border-color); }
.at-modal .modal-title { color: var(--text-light); }
.at-modal .btn-close { filter: invert(1); }
