:root {
  --bg-dark: #0a0b0d;
  --bg-card: #14151a;
  --accent: #00ff88;
  --accent-down: #ff3366;
  --text-main: #ffffff;
  --text-dim: #929292;
  --border: rgba(255, 255, 255, 0.1);
  --header-height: 120px;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header & Navigation */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.header-main h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(90deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tab-navigation {
  display: flex;
  gap: 8px;
  height: 50px;
  align-items: flex-end;
}

.tab-navigation button {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.tab-navigation button:hover {
  color: #fff;
}

.tab-navigation button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Layout Content */
.app-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.cockpit-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 8px;
}

.tab-content-full {
  min-width: 0;
  width: 100%;
}

/* Tab Commons */
.tab-header {
  margin-bottom: 32px;
}

.tab-header h2 {
  font-size: 1.75rem;
  margin: 0 0 8px 0;
}

.tab-header p {
  color: var(--text-dim);
  margin: 0;
}

/* Overview Tab */
.bot-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  background: var(--bg-card);
  padding: 16px 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 32px;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-item .label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.status-item .value {
  font-size: 1rem;
  font-weight: 700;
}

.status-online {
  color: var(--accent);
}

.mode-live {
  color: #e67e22;
}

.mode-paper {
  color: #3498db;
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Market Ticker Card */
.market-ticker-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 32px;
}

.ticker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.ticker-header h3 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.ticker-count {
  font-size: 0.8rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 100px;
}

.ticker-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.ticker-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 12px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.ticker-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.ticker-symbol {
  font-weight: 700;
  font-size: 0.85rem;
}

.ticker-values {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.ticker-price {
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.ticker-change {
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ticker-change.positive {
  color: var(--accent);
}

.ticker-change.negative {
  color: var(--accent-down);
}

.ticker-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  color: var(--text-dim);
  font-style: italic;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px dashed var(--border);
}

.opportunities-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.app-sidebar {
  position: sticky;
  top: calc(120px + 24px);
  height: calc(100vh - 120px - 48px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding-right: 4px;
  /* Space for scrollbar */
}

.app-sidebar::-webkit-scrollbar {
  width: 4px;
}

.app-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.opportunity-card-sidebar {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.opportunity-card-sidebar h3 {
  margin: 0 0 16px 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.opp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opp-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 0.85rem;
}

.opp-symbol {
  font-weight: 700;
}

.opp-value.ai {
  color: var(--accent);
}

.opp-empty {
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.8rem;
  padding: 10px;
}

.readiness-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.readiness-card .card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.readiness-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.metrics-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.metric {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.metric .value {
  color: #fff;
  font-weight: 600;
}

.metric .value.bullish {
  color: var(--accent);
}

.metric .value.bearish {
  color: var(--accent-down);
}

.readiness-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: bold;
}

/* Tables (Premium Pro Style) */
.table-container {
  background: linear-gradient(145deg, rgba(20, 21, 26, 0.8), rgba(10, 11, 13, 0.9));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  position: relative;
}

.table-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.1), transparent);
}

.pro-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.pro-table th {
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pro-table td {
  padding: 16px 24px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: all 0.2s ease;
}

.pro-table tr {
  transition: all 0.2s ease;
}

.pro-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
  transform: scale(1.002);
}

.pro-table tbody tr:hover td {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.pro-table tr:last-child td {
  border-bottom: none;
}

/* Monospace alignment for numbers in tables */
.pro-table .font-mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.bold {
  font-weight: 700;
  color: #fff;
}

.fade {
  color: var(--text-dim);
}

.italic {
  font-style: italic;
}

.text-center {
  text-align: center;
}

.empty {
  padding: 40px !important;
  color: var(--text-dim);
}

.side-buy {
  color: var(--accent);
  font-weight: bold;
}

.side-sell {
  color: var(--accent-down);
  font-weight: bold;
}

.up {
  color: var(--accent);
}

.down {
  color: var(--accent-down);
}

.status-tag {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
}

.status-tag.active {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
}

.status-tag.pulse {
  background: rgba(0, 255, 136, 0.2);
  color: var(--accent);
  animation: pulse-opac 2s infinite;
}

@keyframes pulse-opac {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

/* Settings Tab */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.settings-group {
  background: var(--bg-card);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.settings-group h3 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--accent);
}

.control-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: bold;
}

.dot {
  width: 12px;
  height: 12px;
  background: #555;
  border-radius: 50%;
}

.dot.active {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.badge {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.8rem;
}

.badge.live {
  background: #e67e22;
}

.badge.paper {
  background: #3498db;
}

.badge.alerts {
  background: #555;
}

.kill-switch {
  width: 100%;
  padding: 16px;
  background: #ff3366;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 800;
  cursor: not-allowed;
  opacity: 0.5;
}

.config-help {
  margin-top: 40px;
  padding: 24px;
  border-top: 1px solid var(--border);
}

.env-vars {
  background: #000;
  padding: 16px;
  border-radius: 8px;
  font-family: monospace;
}

.var {
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 1200px) {
  .app-content {
    grid-template-columns: 1fr;
  }
}

.signals-tab {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.symbols-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
  gap: 24px;
}

.empty-state {
  padding: 48px;
  text-align: center;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  font-style: italic;
}
