/* Backtest Tab Styling */

.backtest-period-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: var(--text-primary, #fff);
  cursor: pointer;
  font-size: 0.9rem !important;
  transition: all 200ms ease;
}

.backtest-period-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.backtest-period-btn.active {
  background: rgba(0, 200, 0, 0.3);
  border-color: rgba(0, 200, 0, 0.5);
  color: #4ade80;
  font-weight: 600;
}

#backtest-custom-dates {
  display: none;
}

#backtest-run-btn {
  transition: all 200ms ease;
  min-height: 44px;
}

#backtest-run-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 200, 0, 0.3);
}

#backtest-run-btn:active {
  transform: translateY(0);
}

#backtest-run-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#backtest-compare-btn {
  transition: all 200ms ease;
  min-height: 44px;
}

#backtest-compare-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

#backtest-compare-btn:active {
  transform: translateY(0);
}

#backtest-compare-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#backtest-loading {
  text-align: center;
  padding: 40px 20px;
}

#backtest-loading > div:first-child {
  animation: spin 1s linear infinite;
  font-size: 32px;
  margin-bottom: 16px;
}

#backtest-results {
  padding: 8px;
  background: rgba(0, 200, 0, 0.1);
  border: 1px solid rgba(0, 200, 0, 0.3);
  border-radius: 6px;
  margin-top: 16px;
}

#backtest-results-content {
  max-height: 700px!important;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary, #fff);
}

#backtest-results-content pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0;
}

/* Backtest input styling */
#backtest-tab input[type="number"],
#backtest-tab input[type="date"],
#backtest-tab select {
  width: 100%;
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: var(--text-primary, #fff);
  font-size: 13px;
  transition: all 200ms ease;
}

#backtest-tab input[type="number"]:focus,
#backtest-tab input[type="date"]:focus,
#backtest-tab select:focus {
  outline: none;
  border-color: rgba(0, 200, 0, 0.5);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 8px rgba(0, 200, 0, 0.2);
}

#backtest-tab input[type="number"]::placeholder,
#backtest-tab input[type="date"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Configuration section */
#backtest-tab h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

#backtest-tab label {
  display: block;
  font-size: 0.9rem !important;
  color: var(--text-secondary, #999);
  margin-bottom: 4px;
  margin-top: 0;
}

/* Spinner animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Pulse animation for progress indicator */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

/* Comparison table styling */
#backtest-comparison-container {
  display: none;
  margin-bottom: 20px;
  padding: 12px;
  background: rgba(255, 165, 0, 0.05);
  border: 1px solid rgba(255, 165, 0, 0.3);
  border-radius: 6px;
  overflow-x: auto;
}

#backtest-comparison-container h4 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #FF9800;
}

#backtest-comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

#backtest-comparison-table thead tr {
  background: rgba(255, 255, 255, 0.1);
}

#backtest-comparison-table th {
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px;
  text-align: left;
  color: #999;
}

#backtest-comparison-table th:first-child {
  text-align: left;
}

#backtest-comparison-table td {
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px;
  color: white;
}

#backtest-comparison-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

#backtest-comparison-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.05);
}

#backtest-comparison-table tbody tr {
  transition: background 200ms ease;
}

#backtest-comparison-table tbody tr:hover {
  background: rgba(255, 165, 0, 0.1);
}
