/* InsightPulse — frontend styles
 * © Media Horizon — https://mediahorizonsl.com/
 * Theme vars are injected by the plugin via wp_add_inline_style.
 * Fallbacks set here so the styles work stand-alone too.
 * ---------------------------------------------------------------- */
:root {
    --ip-bg: #0b1410;
    --ip-card: #0d1a14;
    --ip-line: #1c3329;
    --ip-ink: #ffffff;
    --ip-muted: #ffffff;
    --ip-accent: #00ffb8;
}

.ip-card {
  background: var(--ip-card);
  border: 1px solid var(--ip-line);
  border-radius: 14px;
  padding: 18px 18px 14px;
  color: var(--ip-ink);
  position: relative;
}
.ip-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.ip-card-title { margin: 0; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ip-muted); font-weight: 600; }
.ip-chart-box { position: relative; height: 270px; }

/* ── Legend ─────────────────────────────────────────────── */
.ip-legend { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.ip-legend span { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ip-muted); letter-spacing: .03em; }
.ip-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.ip-legend i.ip-leg-line { width: 18px; height: 3px; border-radius: 2px; }   /* combo: line-series marker */

/* ── Speaker icon — mute / unmute ──────────────────────── */
.ip-speaker {
  background: none; border: none; padding: 0; cursor: pointer;
  flex: 0 0 26px;            /* never shrink/grow — keep a constant size across cards */
  width: 26px; height: 26px; min-width: 26px; min-height: 26px;
  box-sizing: border-box;
  color: var(--ip-muted);
  transition: opacity .2s, color .2s;
}
.ip-speaker svg { width: 26px; height: 26px; display: block; }

/* waves shown, slash hidden when unmuted (on) */
.ip-speaker.on          { color: var(--ip-accent); opacity: 1; }
.ip-speaker.on .slash   { display: none; }
.ip-speaker.on .w       { display: inline; }

/* waves hidden, slash shown when muted */
.ip-speaker.muted         { color: var(--ip-muted); opacity: .6; }
.ip-speaker.muted .w      { display: none; }
.ip-speaker.muted .slash  { display: inline; stroke: currentColor; stroke-width: 2.2; }

/* pulse animation while speaking */
.ip-speaker .w { transform-origin: left center; opacity: .55; }
.ip-speaker.live .w1 { animation: ip-pulse .8s infinite ease-in-out; }
.ip-speaker.live .w2 { animation: ip-pulse .8s infinite ease-in-out .18s; }
.ip-speaker.live .w3 { animation: ip-pulse .8s infinite ease-in-out .36s; }
@keyframes ip-pulse { 0%,100% { opacity: .25; transform: scaleY(.6); } 50% { opacity: 1; transform: scaleY(1.15); } }

/* ── Insight caption bubble ────────────────────────────── */
.ip-caption {
  position: absolute; top: 44px; left: 18px; max-width: 72%;
  background: rgba(10,20,16,.96); border: 1px solid var(--ip-line, #1c2b25);
  border-radius: 12px; padding: 11px 14px;
  display: flex; gap: 10px; align-items: flex-start;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .18s, transform .18s;
  pointer-events: none; z-index: 6;
  box-shadow: 0 16px 34px rgba(0,0,0,.45);
}
.ip-caption.show { opacity: 1; transform: none; }
.ip-caption::after {
  content: ''; position: absolute; bottom: -7px; left: 24px;
  width: 12px; height: 12px;
  background: rgba(10,20,16,.96);
  border-right: 1px solid var(--ip-line, #1c2b25);
  border-bottom: 1px solid var(--ip-line, #1c2b25);
  transform: rotate(45deg);
}
.ip-cap-text { font-size: 13px; line-height: 1.45; color: var(--ip-ink); }
.ip-cap-ico { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; color: var(--ip-accent); opacity: .45; transition: opacity .2s; }
.ip-cap-ico.live { opacity: 1; }
.ip-cap-ico svg { width: 100%; height: 100%; }
.ip-cap-ico .bar { fill: currentColor; transform-origin: center bottom; }
.ip-cap-ico.live .b1 { animation: ip-eq .7s infinite ease-in-out; }
.ip-cap-ico.live .b2 { animation: ip-eq .7s infinite ease-in-out .15s; }
.ip-cap-ico.live .b3 { animation: ip-eq .7s infinite ease-in-out .3s; }
@keyframes ip-eq { 0%,100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }

/* ── Shared value tooltip ──────────────────────────────── */
.ip-tt {
  position: fixed; pointer-events: none; z-index: 99999;
  background: rgba(8,16,13,.96); border: 1px solid var(--ip-line, #1c2b25);
  border-radius: 10px; padding: 11px 13px; min-width: 170px;
  box-shadow: 0 18px 40px rgba(0,0,0,.5); opacity: 0; transition: opacity .12s;
  font-family: 'Barlow','Segoe UI',system-ui,sans-serif; font-size: 13px; color: #e7efe9;
}
.ip-tt-head { color: #7e948b; font-size: 11px; letter-spacing: .08em; margin-bottom: 7px; text-transform: uppercase; }
.ip-tt-row { display: flex; justify-content: space-between; gap: 18px; margin: 3px 0; }
.ip-tt-row b { font-weight: 600; }

/* ── Data table (type: 'table') ────────────────────────── */
.ip-card-table { padding: 0; overflow: hidden; }                 /* full-bleed gradient header, clipped to card radius */
.ip-card-head-table { padding: 8px 12px 0; margin: 0; justify-content: flex-end; }
.ip-table-wrap { width: 100%; overflow-x: auto; }
.ip-table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.35; }
.ip-table thead th {
  color: #fff; font-weight: 700; text-align: right;
  padding: 14px 20px; white-space: nowrap;
}
.ip-table thead th.ip-th-corner { text-align: left; }
.ip-table tbody th, .ip-table tbody td {
  padding: 16px 20px; vertical-align: top;
  border-top: 1px solid var(--ip-line, #e8e8e8);
}
.ip-table tbody tr:first-child th, .ip-table tbody tr:first-child td { border-top: none; }
.ip-table tbody th.ip-row-label { text-align: left; font-weight: 400; color: var(--ip-ink, #444); }
.ip-table tbody td { text-align: right; color: var(--ip-muted, #666); font-variant-numeric: tabular-nums; }
