/**
 * ============================================================================
 * GammaVision Backtest Engine Styles (Apple-Minimalist Dark Design)
 * File: public/modules_dev/backtest_engine/backtest_engine.css
 * ============================================================================
 */

/* ── Container dentro il popup Options DTE ── */
.desk-dte-backtest-box {
  margin-top: 4px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.desk-dte-backtest-box.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
}

.desk-dte-backtest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.desk-dte-backtest-title {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f5f5f7;
}

.desk-dte-backtest-desc {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.5);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

/* ── Interruttore Switch Minimalista Apple ── */
.desk-dte-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
}

.desk-dte-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.desk-dte-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.25s;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.desk-dte-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: #f5f5f7;
  transition: 0.25s;
  border-radius: 50%;
}

.desk-dte-switch input:checked + .desk-dte-slider {
  background-color: #30d158;
  border-color: #30d158;
}

.desk-dte-switch input:checked + .desk-dte-slider:before {
  transform: translateX(16px);
  background-color: #000;
}

/* ── Selettore Settimane Storiche nel popup ── */
.desk-dte-backtest-weeks-row {
  margin-top: 8px;
  display: none;
}

.desk-dte-backtest-box.active .desk-dte-backtest-weeks-row {
  display: block;
}

.desk-dte-backtest-week-select {
  width: 100%;
  background: #1c1c1e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #f5f5f7;
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
}

.desk-dte-backtest-week-select:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

/* ── Banner Flottante Point-in-Time sul Grafico ── */
.gv-backtest-banner {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(22, 22, 24, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 6px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  color: #f5f5f7;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.gv-backtest-banner.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
}

.gv-backtest-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000;
  background: #30d158;
  padding: 2px 6px;
  border-radius: 4px;
}

.gv-backtest-label {
  font-size: 12px;
  font-weight: 500;
  color: #f5f5f7;
  letter-spacing: -0.01em;
}

.gv-backtest-exit-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gv-backtest-exit-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* ── Capsule Floating Scrubber dei Profili Point-in-Time ── */
/* Posizionata in basso, perfettamente centrata sulla zona dei profili e alla stessa altezza del timeline scrubber */
.gv-profile-scrubber-capsule {
  position: fixed;
  bottom: 32px;
  right: 232px;
  transform: translate(50%, 0);
  top: auto;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-style: solid;
  border-width: 2.2px 1.5px 1.5px 2.2px;
  border-color: rgba(125, 125, 135, 0.85) rgba(40, 40, 45, 0.85) rgba(40, 40, 45, 0.85) rgba(125, 125, 135, 0.85);
  border-radius: 30px;
  padding: 6px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 1px 1px 0 rgba(255, 255, 255, 0.05);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.gv-profile-scrubber-capsule.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 10px);
}

.gv-profile-controls-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.gv-profile-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 3px 6px;
  font-size: 11px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gv-profile-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

/* ── Tasto RPLY (Sincronizzazione Profili con il Chart - Pulito Senza Pallina) ── */
.gv-profile-rply-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 4px 11px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gv-profile-rply-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.75);
}

.gv-profile-rply-btn.active {
  background: rgba(48, 209, 88, 0.16);
  border-color: rgba(48, 209, 88, 0.45);
  color: #30d158;
  box-shadow: 0 0 10px rgba(48, 209, 88, 0.25);
}

.gv-profile-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
}

.gv-profile-scrubber-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gv-profile-day-badge {
  font-family: var(--font-mono, "SF Mono", monospace);
  font-size: 11.5px;
  font-weight: 700;
  color: #30d158;
  letter-spacing: 0.05em;
  min-width: 68px;
  text-align: right;
  white-space: nowrap;
}

.gv-profile-slider {
  width: 140px !important;
  cursor: pointer;
}

/* ── Gestione Timeline Controls del Chart in Modalità Backtest ── */
body.gv-backtest-active .timeline-controls-wrapper {
  opacity: 1 !important;
  transform: translate(-50%, 0) !important;
}

/* Nasconde 'LIVE' e il menu a tendina 'DATA' durante la simulazione Point-in-Time */
body.gv-backtest-active .timeline-capsule .day-selector,
body.gv-backtest-active .timeline-capsule .day-selector + .control-divider {
  display: none !important;
}

body.gv-backtest-active #custom-date-picker-menu {
  display: none !important;
}



/* ── Nascondi Orizzonte Passato in Simulazione Backtest ── */
#desk-dte-popup.backtest-mode-on #desk-dte-past-section {
  display: none !important;
}

/* ── Selettore Durata (1W vs 2W) nel popup ── */
.desk-dte-backtest-durations {
  display: none;
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 8px;
}

.desk-dte-backtest-box.active .desk-dte-backtest-durations {
  display: flex;
}

.backtest-dur-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  padding: 5px 0;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.backtest-dur-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.backtest-dur-pill.active {
  background: rgba(48, 209, 88, 0.15);
  border-color: #30d158;
  color: #30d158;
}
