/*
 * OSINT Tools - Intelligence Community Style Elements
 * Ref: ICD 203 (Analytic Standards), STANAG 2022 (DTG Format)
 *
 * Uses CSS variables from academic.css for all theme colors.
 * Data-encoding colors (WEP, TLP, classification bands) are hardcoded
 * because they ARE the information — green means confirmed, red means critical.
 */

/* === TOOLTIPS === */
.ic-tip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--text-faint);
}
.ic-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 6px 10px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: normal;
  font-style: normal;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  max-width: 280px;
  white-space: normal;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--text) 25%, transparent);
}
.ic-tip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--text);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
}
.ic-tip:hover::after,
.ic-tip:hover::before,
.ic-tip:focus::after,
.ic-tip:focus::before {
  opacity: 1;
  visibility: visible;
}

/* Tooltip positioning variants */
.ic-tip.tip-right::after { left: auto; right: 0; transform: none; }
.ic-tip.tip-right::before { left: auto; right: 10px; transform: none; }
.ic-tip.tip-left::after { left: 0; transform: none; }
.ic-tip.tip-left::before { left: 10px; transform: none; }
.ic-tip.tip-below::after { bottom: auto; top: calc(100% + 6px); }
.ic-tip.tip-below::before {
  bottom: auto; top: calc(100% + 2px);
  border-top-color: transparent;
  border-bottom-color: var(--text);
}

abbr.ic-tip { text-decoration: none; }

/* === CLASSIFICATION BANNERS === */
/* These colors are data-encoding (green=OSINT, purple=CUI) — not themed */
.classification-banner {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  padding: 4px 0;
  color: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.2);
}
.classification-banner.unclassified,
.classification-banner.osint { background: #228b22; }
.classification-banner.fouo { background: #4a7c59; }
.classification-banner.cui { background: #5c4a7c; }
.classification-banner.bottom { border-bottom: none; border-top: 1px solid rgba(0,0,0,0.2); }

/* === SOURCE RELIABILITY BADGES === */
/* Colors are data-encoding (Admiralty Code) — not themed */
.source-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 1px 4px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  letter-spacing: 1px;
  vertical-align: middle;
  display: inline-block;
}
.source-badge.a1 { border-color: #228b22; color: #228b22; }
.source-badge.a2 { border-color: #2e8b57; color: #2e8b57; }
.source-badge.b1, .source-badge.b2 { border-color: #4a90d9; color: #4a90d9; }
.source-badge.b3 { border-color: #6a9fd9; color: #6a9fd9; }
.source-badge.c2, .source-badge.c3 { border-color: #d9a14a; color: #d9a14a; }
.source-badge.d4 { border-color: #d97a4a; color: #d97a4a; }
.source-badge.e5 { border-color: #d94a4a; color: #d94a4a; }
.source-badge.f6 { border-color: var(--text-faint); color: var(--text-faint); }

/* === SESSION FOOTER === */
.session-footer {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 8px 20px;
  background: var(--bg-muted);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.session-footer .session-id { color: var(--text-muted); }
.session-footer .dtg { font-weight: 500; color: var(--text-muted); }
.session-footer .handling { color: var(--text-faint); font-size: 8px; }

/* === ZULU TIME === */
.zulu-time {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 1px;
}

/* === COLLECTION STATUS === */
.collection-status {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
}
/* Status colors are data-encoding — not themed */
.collection-status .active { color: #228b22; }
.collection-status .paused { color: #d9a14a; }
.collection-status .error { color: #d94a4a; }

/* === REPORT HEADER === */
.report-header {
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  padding: 12px 15px;
  margin-bottom: 20px;
  background: var(--bg-muted);
}
.report-header .report-title {
  font-size: 12px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  margin: 0 0 8px 0;
}
.report-header .report-meta {
  font-size: 9px; color: var(--text-muted);
  letter-spacing: 1px; display: flex; flex-wrap: wrap; gap: 15px;
}

/* === CONFIDENCE LEVELS === */
/* Colors are data-encoding — not themed */
.confidence {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 1px;
  text-transform: uppercase; padding: 2px 6px;
}
.confidence.high { background: #e8f5e9; color: #2e7d32; }
.confidence.moderate { background: #fff8e1; color: #f57f17; }
.confidence.low { background: #ffebee; color: #c62828; }

/* === HANDLING CAVEATS === */
.handling-caveat {
  font-family: var(--font-mono);
  font-size: 8px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-faint);
  padding: 4px 0;
}

/* === MGRS GRID REFERENCES === */
.mgrs { font-family: var(--font-mono); letter-spacing: 0.5px; }
.mgrs rt { font-size: 0.6em; color: var(--text-faint); letter-spacing: 0; font-weight: normal; }

/* === RUBY ANNOTATIONS === */
ruby.unit, ruby.zulu, ruby.coord { font-family: var(--font-mono); }
ruby.unit rt, ruby.zulu rt, ruby.coord rt {
  font-size: 0.55em; color: var(--text-faint);
  font-weight: normal; letter-spacing: 0.05em; text-transform: uppercase;
}
ruby.under { ruby-position: under; }
ruby.under rt { color: var(--text-muted); }
ruby.zulu rt { color: #228b22; } /* Data-encoding green */
ruby.coord rt { font-size: 0.5em; letter-spacing: 0.1em; }

/* === IC FOOTNOTES === */
.fn-ref {
  font-family: var(--font-sans);
  font-size: 0.7em; vertical-align: super; line-height: 0;
}
.fn-ref a { color: var(--link); text-decoration: none; padding: 0 1px; }
.footnotes {
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 11px; font-family: var(--font-sans);
}
.footnotes h4 {
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 12px 0; font-weight: 600;
}
.footnotes ol { margin: 0; padding-left: 20px; }
.footnotes li { margin: 6px 0; line-height: 1.5; color: var(--text-muted); }
.footnotes li a { color: var(--text-faint); text-decoration: none; margin-right: 6px; }
.fn-source { color: var(--text-faint); font-size: 0.9em; font-style: italic; }

/* === CITATIONS === */
.ic-cite { font-style: normal; }
.cite-rating { font-family: var(--font-mono); font-size: 0.85em; color: var(--text-muted); }

/* === WEP BADGES === */
/* Colors are data-encoding (probability bands) — not themed */
.wep {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.5px;
  text-transform: uppercase; padding: 2px 6px;
  border: 1px solid; display: inline-block;
}
.wep-ac, .wep-hl { border-color: #228b22; color: #228b22; background: color-mix(in srgb, #228b22 10%, var(--bg)); }
.wep-l, .wep-p { border-color: #4a90d9; color: #4a90d9; background: color-mix(in srgb, #4a90d9 10%, var(--bg)); }
.wep-ec { border-color: #d9a14a; color: #d9a14a; background: color-mix(in srgb, #d9a14a 10%, var(--bg)); }
.wep-ul { border-color: #d97a4a; color: #d97a4a; background: color-mix(in srgb, #d97a4a 10%, var(--bg)); }
.wep-hu, .wep-r, .wep-nc { border-color: #d94a4a; color: #d94a4a; background: color-mix(in srgb, #d94a4a 10%, var(--bg)); }
.wep-inline { font-style: italic; font-weight: 500; }

/* === TLP BADGES === */
/* Colors ARE the protocol — never themed */
.tlp {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600; letter-spacing: 1px;
  padding: 2px 8px; color: #fff; display: inline-block;
}
.tlp-red { background: #ff2b2b; }
.tlp-amber, .tlp-amber-strict { background: #ffc000; color: #000; }
.tlp-green { background: #33ff00; color: #000; }
.tlp-clear, .tlp-white { background: var(--bg); color: var(--text); border: 1px solid var(--border); }

.tlp-banner {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 1.5px;
  text-align: center; padding: 6px 12px;
  margin: -20px -20px 20px -20px;
}

/* === INT DISCIPLINE BADGES === */
/* Colors are data-encoding (discipline identity) — not themed */
.int-badge {
  font-family: var(--font-mono);
  font-size: 8px; font-weight: 600; letter-spacing: 0.5px;
  padding: 2px 5px; border: 1px solid;
  display: inline-block; vertical-align: middle;
}

/* === SALUTE REPORT === */
.salute-report {
  font-family: var(--font-mono);
  font-size: 11px; border-collapse: collapse;
  margin: 12px 0; width: 100%; max-width: 500px;
}
.salute-report th,
.salute-report td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.salute-label {
  width: 100px; font-size: 9px; letter-spacing: 0.5px;
  color: var(--text-muted); background: var(--bg-muted); font-weight: 600;
}
.salute-value { color: var(--text); }
