:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: #111827;
  --bg-card: #1f2937;
  --border-color: #374151;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --color-buy: #10b981;
  --color-sell: #ef4444;
  --color-notrade: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  padding: 16px;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 28px;
}

.header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-paper {
  background: #1e3a8a;
  color: #93c5fd;
  border: 1px solid #3b82f6;
}

.badge-ai {
  background: #312e81;
  color: #c7d2fe;
  border: 1px solid #6366f1;
}

.quota-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #064e3b;
  color: #a7f3d0;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #059669;
}

.quota-dot {
  width: 8px;
  height: 8px;
  background-color: #34d399;
  border-radius: 50%;
}

/* Notice Banner */
.notice-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 16px;
}

/* Main Layout */
.main-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}

@media (max-width: 850px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* Symbol Grid */
.symbol-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.symbol-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.symbol-item:hover {
  border-color: var(--accent-blue);
  background: #283548;
}

.symbol-item.active {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.15);
}

.sym-name {
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
}

.sym-spread {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Language Selector */
.language-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Credit info */
.credit-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.credit-row {
  display: flex;
  justify-content: space-between;
}

/* Buttons */
.btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #374151;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* Right Content Area */
.placeholder-card {
  text-align: center;
  padding: 48px 24px;
}

.placeholder-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.signal-header-card {
  border-left: 4px solid var(--accent-cyan);
}

.signal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.pair-title {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  margin-right: 8px;
}

.broker-symbol {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 8px;
}

.spread-tag {
  font-size: 0.8rem;
  color: var(--accent-cyan);
}

.signal-badge {
  font-size: 1.1rem;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-buy {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid #10b981;
}

.badge-sell {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid #ef4444;
}

.badge-notrade {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid #f59e0b;
}

/* Confluence Bar */
.confluence-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  transition: width 0.5s ease;
}

/* Timeframe Matrix */
.tf-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.tf-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
}

.tf-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.tf-name {
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
}

.tf-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tf-body {
  font-size: 0.82rem;
  color: #e5e7eb;
}

.notes-list, .rejections-list {
  padding-left: 20px;
  font-size: 0.85rem;
  color: #d1d5db;
}

.notes-list li, .rejections-list li {
  margin-bottom: 4px;
}

/* Levels Grid */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.level-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.level-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.level-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 700;
}

.level-sub {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 2px;
}

.sl-box {
  border-color: rgba(239, 68, 68, 0.4);
}

.sl-box .level-val {
  color: #f87171;
}

.tp-box .level-val {
  color: #34d399;
}

.invalidation-box {
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--accent-cyan);
}

/* AI Card */
.ai-card {
  border-top: 2px solid #818cf8;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ai-icon {
  font-size: 20px;
}

.ai-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e2e8f0;
  white-space: pre-wrap;
}

/* Modal Overlay & Card */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.input-field {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--accent-blue);
}
