/* Common styles for Earnings NLP Analysis */

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f1419;
  color: #e6e6e6;
  margin: 0;
  padding: 40px 20px;
  line-height: 1.5;
}

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

.container-wide {
  max-width: 1100px;
}

h1 {
  font-size: 28px;
  margin: 0 0 4px;
}

h2 {
  font-size: 18px;
  margin: 0 0 12px;
  color: #4a90e2;
}

h3 {
  font-size: 15px;
  margin: 16px 0 8px;
  color: #e6e6e6;
}

.subtitle {
  color: #8b9aab;
  margin-bottom: 32px;
  font-size: 14px;
}

.card {
  background: #1a2129;
  border: 1px solid #2a3540;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.back {
  display: inline-block;
  margin-bottom: 16px;
  color: #4a90e2;
  text-decoration: none;
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.back:hover {
  text-decoration: underline;
}

/* Links */
a { color: #4a90e2; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  padding: 8px 0;
  color: #8b9aab;
  font-weight: normal;
  border-bottom: 1px solid #2a3540;
}

th.right {
  text-align: right;
}

/* Buttons */
button {
  padding: 10px 20px;
  background: #4a90e2;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  min-width: 110px;
  height: 42px;
}

button:hover:not(:disabled) {
  background: #5a9eef;
}

button:disabled {
  background: #2a3540;
  color: #8b9aab;
  cursor: not-allowed;
}

/* Signal pills */
.signal {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  margin-left: 8px;
  white-space: nowrap;
}

.signal-positive {
  background: #1a3a1a;
  color: #4ade80;
}

.signal-neutral {
  background: #2a2a1a;
  color: #fbbf24;
}

.signal-negative {
  background: #3a1a1a;
  color: #f87171;
}

/* Theme blocks */
.theme {
  background: #0f1419;
  border-left: 3px solid #4a90e2;
  padding: 10px 14px;
  margin: 8px 0;
  border-radius: 0 4px 4px 0;
}

.theme-disappeared {
  border-left-color: #8b5cf6;
  opacity: 0.85;
}

.theme-count {
  color: #8b9aab;
  font-size: 13px;
  margin-left: 8px;
}

/* Investor-category badge on callouts and top-topics entries
   (2026-09-13) — replaces the raw salience number in HTML. */
.category-badge {
  display: inline-block;
  color: #7fb3d5;
  background: #16222e;
  border: 1px solid #2a3a4a;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 7px;
  margin-right: 8px;
  vertical-align: middle;
}
/* End-positioned badge: the category badge is now shown at the END
 of each callout (user feedback 2026-09-16 — easier to scan when the
 label is consistent-positioned). Margin swaps from right to left. */
.category-badge-end {
  margin-right: 0;
  margin-left: 8px;
}

.theme-context {
  color: #a0aab5;
  font-size: 13px;
  font-style: italic;
  margin-top: 6px;
  margin-left: 4px;
  line-height: 1.4;
}

/* Callouts */
.callout {
  background: #1a2530;
  border: 1px solid #2a3a4a;
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: 6px;
}

.callout-tone-positive {
  background: #142a1a;
  border-color: #3a6a3a;
  color: #4ade80;
}

.callout-tone-negative {
  background: #2a1515;
  border-color: #6a3a3a;
  color: #f87171;
}

.callout-tone-neutral {
  background: #2a2515;
  border-color: #6a5a3a;
  color: #fbbf24;
}

.callout-headline {
  margin-bottom: 0;
}

.callout-example {
  margin-top: 6px;
  padding-left: 12px;
  border-left: 2px solid #2a3a4a;
  color: #8b9aab;
  font-size: 13px;
  font-style: italic;
}

/* Example blocks */
.example {
  color: #8b9aab;
  font-size: 13px;
  margin-top: 6px;
  font-style: italic;
  padding-left: 12px;
  border-left: 2px solid #2a3540;
}

/* Metric discontinuation blocks */
.metric {
  background: #2a1a1a;
  border: 1px solid #4a2a2a;
  padding: 12px 14px;
  margin: 8px 0;
  border-radius: 6px;
  color: #ffb86c;
}

/* Source banners */
.source-banner {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: #1a2230;
  border: 1px solid #2a3a4a;
  border-left: 4px solid #4a90e2;
}

.source-banner.report-only {
  background: linear-gradient(135deg, #1a2230 0%, #1a2530 100%);
}

.source-banner.fundamentals-only {
  background: linear-gradient(135deg, #1a2230 0%, #231a30 100%);
  border-left-color: #a78bfa;
}

.banner-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 2px;
}

.banner-content {
  flex: 1;
}

.banner-title {
  font-size: 16px;
  font-weight: 600;
  color: #e6e6e6;
  margin-bottom: 6px;
}

.banner-body {
  font-size: 14px;
  color: #b0c0d0;
  line-height: 1.5;
  margin-bottom: 8px;
}

.banner-body strong {
  color: #e6e6e6;
}

.banner-source {
  font-size: 12px;
  color: #8b9aab;
  font-family: ui-monospace, "SF Mono", monospace;
}

.metrics-source {
  font-size: 11px;
  color: #6b7a8a;
  font-family: ui-monospace, "SF Mono", monospace;
  margin: -4px 0 10px 0;
  letter-spacing: 0.02em;
}

/* Gap warnings */
.gap-warning {
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.gap-warning.alert {
  background: #2a1a1a;
  border: 1px solid #4a2a2a;
  color: #ffb86c;
}

.gap-warning.info {
  background: #1a222a;
  border: 1px solid #2a3a4a;
  color: #94a3b8;
  font-size: 13px;
}

/* Forms */
.form {
  background: #1a2129;
  border: 1px solid #2a3540;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.combobox {
  position: relative;
  flex: 1;
}

.combobox input {
  width: 100%;
  padding: 10px 14px;
  background: #0f1419;
  border: 1px solid #2a3540;
  border-radius: 6px;
  color: #e6e6e6;
  font-size: 15px;
}

.combobox input:focus {
  outline: none;
  border-color: #4a90e2;
}

.combobox input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a2129;
  border: 1px solid #2a3540;
  border-radius: 6px;
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.suggestions.open {
  display: block;
}

.suggestion {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #2a3540;
}

.suggestion:last-child {
  border-bottom: none;
}

.suggestion:hover,
.suggestion.focused {
  background: #2a3540;
}

.suggestion .ticker {
  color: #4a90e2;
  font-weight: 600;
  margin-right: 10px;
  font-family: ui-monospace, "SF Mono", monospace;
}

.suggestion .name {
  color: #e6e6e6;
}

.suggestion .exchange {
  color: #8b9aab;
  font-size: 12px;
  margin-left: 8px;
}

.suggestion-empty {
  padding: 14px;
  color: #8b9aab;
  font-style: italic;
}

.selected-tag {
  display: inline-block;
  background: #1a3a1a;
  color: #4ade80;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-left: 8px;
  font-family: ui-monospace, "SF Mono", monospace;
}

.hint {
  color: #8b9aab;
  font-size: 13px;
  margin-top: 12px;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #8b9aab;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

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

/* Company table on home page */
.company-table-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #2a3540;
}

.table-toolbar {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.table-toolbar h3 {
  margin: 0;
  color: #8b9aab;
  font-size: 14px;
  font-weight: 500;
}

.table-toolbar .spacer {
  flex: 1;
}

.table-toolbar label {
  font-size: 13px;
  color: #8b9aab;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-toolbar select,
.table-toolbar input[type="text"] {
  background: #0f1419;
  border: 1px solid #2a3540;
  color: #e6e6e6;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
}

.table-toolbar select:focus,
.table-toolbar input[type="text"]:focus {
  outline: none;
  border-color: #4a90e2;
}

.table-toolbar input[type="text"] {
  min-width: 180px;
}

.company-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: fixed;
}

.company-table colgroup col.col-ticker { width: 80px; }
.company-table colgroup col.col-name { width: auto; }
.company-table colgroup col.col-exchange { width: 150px; }
/* Numeric columns (Sentiment, Revenue, Op income, Net income, EPS,
Top things) widened so the column headers fit in full — user feedback
2026-09-16: "Op incom...", "Net inco..." were truncated. 130px holds
"Net income" / "Top things" comfortably at the standard font size. */
.company-table colgroup col.col-num { width: 130px; }
.company-table colgroup col.col-index { width: 160px; }
.index-cell { font-size: 0.9em; color: #c0d0e0; }
/* Name column wraps so full company names are visible — user
feedback 2026-09-16: long names like "British American Tobacco"
were truncated to "British American Toba..." in the table. */
.company-table colgroup col.col-name { width: 220px; }
.company-table td.col-name-cell { white-space: normal; }
h1 .company-name { color: #c0d0e0; font-weight: 400; font-size: 0.8em; }

.company-table th,
.company-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #1a2129;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-table th {
  color: #8b9aab;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
  background: #0f1419;
  user-select: none;
  border-bottom: 1px solid #2a3540;
}

.company-table th.sortable {
  cursor: pointer;
}

.company-table th.sortable:hover {
  color: #b0c0d0;
  background: #131a22;
}

.company-table th .sort-indicator {
  display: inline-block;
  margin-left: 4px;
  color: #4a90e2;
  font-size: 10px;
  width: 8px;
}

.company-table th .sort-indicator.inactive {
  color: #4a5260;
}

.company-table tbody tr {
  cursor: pointer;
}

.company-table tbody tr:hover {
  background: #1a2129;
}

.company-table tbody tr.row-no-data {
  opacity: 0.55;
}

.company-table tbody tr.row-no-data:hover {
  opacity: 0.85;
}

.company-table .ticker-cell {
  color: #4a90e2;
  font-weight: 600;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 13px;
}

.company-table .ticker-cell a {
  color: inherit;
  text-decoration: none;
}

.company-table .sentiment-pos { color: #4ade80; }
.company-table .sentiment-neg { color: #f87171; }
.company-table .sentiment-zero { color: #8b9aab; }
.company-table .empty { color: #4a5260; }
.company-table .numbers {
  text-align: right;
  font-family: ui-monospace, "SF Mono", monospace;
  color: #b0c0d0;
}

.company-table .numbers.empty {
  color: #4a5260;
}

.company-table .exchange-cell {
  color: #8b9aab;
  font-size: 12px;
}

/* "✓" badge next to the ticker of a company whose analysis is
   pre-cached (in data/cache.db / Supabase). Green to match the
   "has data" semantics. */
.cache-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
  color: #1a3a2a;
  background: #4ade80;
  border-radius: 3px;
  vertical-align: middle;
  cursor: help;
}

.company-table-container {
  max-height: 640px;
  overflow-y: auto;
  border: 1px solid #1a2129;
  border-radius: 6px;
  background: #0f1419;
}

.pagination-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 13px;
  color: #8b9aab;
}

.pagination-bar button {
  padding: 4px 10px;
  background: #1a2129;
  color: #e6e6e6;
  border: 1px solid #2a3540;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  height: auto;
  min-width: auto;
}

.pagination-bar button:hover:not(:disabled) {
  background: #2a3540;
}

.pagination-bar button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-bar .page-jump {
  background: #0f1419;
  border: 1px solid #2a3540;
  color: #e6e6e6;
  padding: 4px 8px;
  border-radius: 4px;
  width: 50px;
  font-size: 13px;
  text-align: center;
}

.pagination-bar .page-jump:focus {
  outline: none;
  border-color: #4a90e2;
}

.table-status {
  color: #6b7a8a;
  font-size: 12px;
  margin-bottom: 8px;
}

/* Sentiment page toolbar */
.toolbar {
  margin-bottom: 20px;
  font-size: 14px;
}

.toolbar a {
  color: #4a90e2;
  text-decoration: none;
  margin-right: 16px;
}

/* Error page */
.error-card h1 {
  color: #f87171;
  margin-top: 0;
}

code {
  background: #0f1419;
  padding: 2px 6px;
  border-radius: 3px;
  color: #fbbf24;
}

/* Utility */
.text-muted {
  color: #8b9aab;
}

.text-small {
  font-size: 13px;
}

.meta-line {
  color: #6b7a8a;
  font-size: 12px;
  margin-top: -10px;
  margin-bottom: 16px;
}

/* Quarter-gap warning banners */
.gap-warning {
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.gap-warning-info {
  background: #1a222a;
  border: 1px solid #2a3a4a;
  color: #94a3b8;
  font-size: 13px;
  padding: 10px 14px;
}

.gap-warning-warning {
  background: #2a1a1a;
  border: 1px solid #4a2a2a;
  color: #ffb86c;
}
