@import "tailwindcss";

/* QuantConnect-inspired dark theme */
@theme {
  /* Background colors */
  --color-bg-primary: #0d1117;
  --color-bg-secondary: #161b22;
  --color-bg-tertiary: #21262d;
  --color-bg-card: #1c2128;
  --color-bg-hover: #30363d;

  /* Text colors */
  --color-text-primary: #e6edf3;
  --color-text-secondary: #8b949e;
  --color-text-muted: #6e7681;

  /* Accent colors */
  --color-accent-blue: #58a6ff;
  --color-accent-purple: #a371f7;
  --color-accent-cyan: #39d4e8;

  /* Status colors */
  --color-profit: #3fb950;
  --color-loss: #f85149;
  --color-warning: #d29922;

  /* Border colors */
  --color-border: #30363d;
  --color-border-muted: #21262d;

  /* Chart colors for comparison */
  --color-chart-1: #58a6ff;
  --color-chart-2: #a371f7;
  --color-chart-3: #39d4e8;
  --color-chart-4: #f0883e;
  --color-chart-5: #db61a2;
}

/* Base styles */
body {
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-bg-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-border);
}

/* Input styling */
input[type="number"],
input[type="text"],
select {
  background-color: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

/* Button base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--color-accent-blue);
  color: #000;
}

.btn-primary:hover {
  background-color: #79b8ff;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--color-bg-tertiary);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

.btn-secondary:hover {
  background-color: var(--color-bg-hover);
}

/* Card styling */
.card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border-muted);
  border-radius: 8px;
  padding: 1rem;
}

/* Profit/Loss coloring */
.profit {
  color: var(--color-profit);
}

.loss {
  color: var(--color-loss);
}

/* Metric value styling */
.metric-value {
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Table styling */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
}

td {
  padding: 0.75rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-border-muted);
  font-variant-numeric: tabular-nums;
}

tr:hover td {
  background-color: var(--color-bg-hover);
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
