/* ==============================================================================
   ATLAS V6 — TRADING INTELLIGENCE DASHBOARD DESIGN SYSTEM
   Modern Glassmorphic Cockpit Theme, Signal Badges, Confidence Ring Gauges,
   Factor Breakdown Bars, Bloomberg Telemetry Header.
   ============================================================================== */

:root {
  --intel-bg-dark: #0a0e17;
  --intel-card-bg: rgba(16, 23, 38, 0.75);
  --intel-card-border: rgba(255, 255, 255, 0.08);
  --intel-text-primary: #f8fafc;
  --intel-text-secondary: #94a3b8;
  --intel-accent-green: #10b981;
  --intel-accent-green-bg: rgba(16, 185, 129, 0.15);
  --intel-accent-red: #ef4444;
  --intel-accent-red-bg: rgba(239, 68, 68, 0.15);
  --intel-accent-amber: #f59e0b;
  --intel-accent-amber-bg: rgba(245, 158, 11, 0.15);
  --intel-accent-blue: #3b82f6;
  --intel-accent-blue-bg: rgba(59, 130, 246, 0.15);
  --intel-glow-green: 0 0 15px rgba(16, 185, 129, 0.4);
  --intel-glow-amber: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* Bloomberg Telemetry Header Bar */
.telemetry-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 15, 26, 0.95);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  padding: 8px 18px;
  font-family: 'Outfit', 'Inter', monospace, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.telemetry-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--intel-text-secondary);
}

.telemetry-item strong {
  color: var(--intel-text-primary);
  font-weight: 600;
}

.telemetry-badge-live {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--intel-accent-green);
  border-radius: 50%;
  box-shadow: var(--intel-glow-green);
  animation: pulse-live 1.8s infinite;
}

@keyframes pulse-live {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Watchlist Alert Ticker */
.watchlist-alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--intel-accent-blue-bg);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 20px;
  overflow: hidden;
}

.alert-ticker-tag {
  background: var(--intel-accent-blue);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.alert-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--intel-text-primary);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Cockpit Main Grid Layout */
/* One decision surface, not two competing panels.
 *
 * These were 1fr 1fr: the verdict and the AI advisor side by side at equal
 * width and equal height, each with its own symbol header and its own word for
 * what to do. Below 1024px they stacked 869px apart, so the two halves of one
 * answer were never on screen together at any width. A single column makes the
 * verdict the surface and the reasoning what sits beneath it. */
.cockpit-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 25px;
}

/* Progressive disclosure. Closed by default: the detail exists, it just does
 * not compete with the decision for the first screen. */
.decision-detail {
  border-top: 1px solid var(--border-glass, rgba(255,255,255,0.08));
}

.decision-detail > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.62rem 0.2rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.decision-detail > summary::-webkit-details-marker { display: none; }

.decision-detail > summary::before {
  content: '▸';
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}

.decision-detail[open] > summary::before { transform: rotate(90deg); }
.decision-detail > summary:hover { color: #e2e8f0; }

.decision-detail-body {
  padding: 0.2rem 0 0.8rem;
}

/* A disclosure inside a disclosure. Visually subordinate so "Teknik detay"
 * cannot read as a peer of the reason it sits under. */
.decision-detail--nested {
  border-top: 0;
  margin-top: 0.5rem;
}

.decision-detail--nested > summary {
  font-size: 0.78rem;
  padding: 0.3rem 0;
  color: #64748b;
}

.decision-detail--nested > .decision-detail-body {
  padding: 0.1rem 0 0.3rem 1.1rem;
}

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

/* Glassmorphism Card Container */
.intel-card {
  background: var(--intel-card-bg);
  border: 1px solid var(--intel-card-border);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.intel-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

.intel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}

.intel-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--intel-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Signal Badges */
.signal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.signal-badge-buy {
  background: var(--intel-accent-green-bg);
  color: var(--intel-accent-green);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: var(--intel-glow-green);
}

.signal-badge-hold {
  background: var(--intel-accent-amber-bg);
  color: var(--intel-accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: var(--intel-glow-amber);
}

.signal-badge-sell {
  background: var(--intel-accent-red-bg);
  color: var(--intel-accent-red);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Price Target Grid */
.price-target-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
  text-align: center;
}

.target-item-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 8px;
}

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

.target-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--intel-text-primary);
}

/* Position Sizing Table */
.position-sizing-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  margin-top: 14px;
}

.sizing-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 4px 0;
  color: var(--intel-text-secondary);
}

.sizing-row strong {
  color: var(--intel-text-primary);
}

/* Factor Breakdown Progress Bar */
.factor-item-row {
  margin-bottom: 12px;
}

.factor-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 4px;
  color: var(--intel-text-primary);
}

.factor-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.factor-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.bar-fill-green { background: var(--intel-accent-green); }
.bar-fill-amber { background: var(--intel-accent-amber); }
.bar-fill-red   { background: var(--intel-accent-red); }

/* Structured Explain AI Box */
.explain-ai-box {
  background: rgba(15, 23, 42, 0.7);
  border-left: 3px solid var(--intel-accent-blue);
  border-radius: 0 8px 8px 0;
  padding: 14px;
  margin-top: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--intel-text-secondary);
}

.explain-ai-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.82rem;
}

.explain-metric-pill {
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--intel-text-primary);
}

/* Opportunity Table */
.opportunity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 10px;
}

.opportunity-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--intel-text-secondary);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  user-select: none;
}

.opportunity-table th:hover {
  color: var(--intel-text-primary);
}

.opportunity-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--intel-text-primary);
}

.opportunity-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.btn-trade-trigger {
  background: var(--intel-accent-green);
  color: #fff;
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-trade-trigger:hover {
  background: #059669;
  transform: translateY(-1px);
}

/* ---------------------------------------------------------------------------
   Advisor header (Sprint 4.3.1)

   The advisor card is long enough that its subject scrolled out of view, so a
   reader partway down could not tell which stock the analysis belonged to.
   Pinning the header keeps the symbol on screen for the whole report.
--------------------------------------------------------------------------- */
.intel-card-header.advisor-header {
  position: sticky;
  top: 0;
  z-index: 5;
  gap: 0.75rem;
  flex-wrap: wrap;
  /* Opaque on purpose. --intel-card-bg is translucent, which is fine for a
     static card but would let the factor table scroll through a pinned header.
     This is the same colour at full alpha. */
  background: #101726;
  margin: -4px -4px 16px;
  padding: 12px 4px 10px;
}
