/* ============================================================
   CryptoNiteNews — style.css
   Companion to Tailwind (CDN). Holds only what utilities can't:
   keyframe animations, the scanline atmosphere, and a few
   reusable component classes used in markup + injected by JS.
   ============================================================ */

:root {
  --kry:      #2bff88;
  --electric: #3aa6ff;
  --loss:     #ff5066;
  --gain:     #1fd67a;
  --edge:     #242c40;
  --edgehi:   #36405c;
}

/* Tailwind @layer utilities overrides [hidden] in @layer base — restore correct behavior */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 160px; }

/* ---------- Scanline + vignette atmosphere ---------- */
.cnn-atmos {
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  background: repeating-linear-gradient(
    0deg, rgba(0,0,0,0.18) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay; opacity: 0.4;
}
.cnn-atmos::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, transparent 55%, rgba(0,0,0,0.65) 100%);
}

/* ---------- Logo crystal glow ---------- */
.cnn-crystal {
  filter: drop-shadow(0 0 6px rgba(43,255,136,0.55));
  animation: cnn-cry 3.4s ease-in-out infinite;
}
@keyframes cnn-cry {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(43,255,136,0.40)); }
  50%      { filter: drop-shadow(0 0 13px rgba(43,255,136,0.85)); }
}

/* ---------- LIVE dot blink ---------- */
.cnn-blink { animation: cnn-blink 1.4s steps(1) infinite; }
@keyframes cnn-blink { 50% { opacity: 0.2; } }

/* ---------- Market ticker scroll ---------- */
.cnn-ticker-track { animation: cnn-ticker 48s linear infinite; }
.cnn-ticker-track:hover { animation-play-state: paused; }
@keyframes cnn-ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.cnn-ticker-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 22px; white-space: nowrap;
  border-right: 1px solid var(--edge);
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem;
}

/* ---------- Pulsing ring dot ---------- */
.cnn-pulse {
  box-shadow: 0 0 0 0 rgba(43,255,136,0.55);
  animation: cnn-ring 1.9s infinite;
}
@keyframes cnn-ring {
  0%   { box-shadow: 0 0 0 0 rgba(43,255,136,0.55); }
  70%  { box-shadow: 0 0 0 11px rgba(43,255,136,0); }
  100% { box-shadow: 0 0 0 0 rgba(43,255,136,0); }
}

/* ---------- Mobile burger icon ---------- */
.cnn-burger { display: flex; flex-direction: column; gap: 4px; }
.cnn-burger span {
  width: 17px; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform 0.2s, opacity 0.2s;
}
[aria-expanded="true"] .cnn-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
[aria-expanded="true"] .cnn-burger span:nth-child(2) { opacity: 0; }
[aria-expanded="true"] .cnn-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Nav links ---------- */
.cnn-nav-link {
  font-family: 'Chakra Petch', sans-serif; font-weight: 500;
  font-size: 0.82rem; letter-spacing: 0.6px; text-transform: uppercase;
  color: #828ca3; padding: 8px 10px; border-radius: 4px;
  white-space: nowrap; transition: color 0.15s, background 0.15s;
}
.cnn-nav-link:hover { color: var(--kry); background: rgba(43,255,136,0.07); }

.cnn-mnav {
  font-family: 'Chakra Petch', sans-serif; font-weight: 500;
  font-size: 0.9rem; letter-spacing: 0.5px; text-transform: uppercase;
  color: #c4ccdd; padding: 12px 6px;
  border-bottom: 1px solid var(--edge);
}
.cnn-mnav:last-child { border-bottom: none; }
.cnn-mnav:hover { color: var(--kry); }

/* ---------- Filter chips ---------- */
.cnn-chip {
  font-family: 'Chakra Petch', sans-serif; font-weight: 500;
  font-size: 0.76rem; letter-spacing: 0.6px; text-transform: uppercase;
  padding: 7px 14px; border-radius: 20px;
  border: 1px solid var(--edge); color: #828ca3;
  transition: all 0.15s;
}
.cnn-chip:hover { border-color: var(--edgehi); color: #e9edf6; }
.cnn-chip-on {
  background: var(--kry); color: #04210f; border-color: var(--kry);
  box-shadow: 0 0 14px rgba(43,255,136,0.4);
}

/* ---------- Hero background atmosphere ---------- */
.cnn-hero-bg {
  background:
    radial-gradient(ellipse 60% 80% at 15% 0%, rgba(43,255,136,0.09), transparent 60%),
    radial-gradient(ellipse 50% 70% at 90% 30%, rgba(58,166,255,0.08), transparent 60%),
    #05060b;
}

/* ---------- Image placeholder hatch ---------- */
.cnn-img-ph {
  background: repeating-linear-gradient(45deg, #11151f 0 14px, #141926 14px 28px);
}

/* ---------- Feed card (injected by JS) ---------- */
.cnn-feed-card {
  background: #10141f;
  border: 1px solid var(--edge); border-left: 3px solid var(--edge);
  border-radius: 8px; padding: 16px 18px;
  transition: border-color 0.15s, transform 0.15s;
  animation: cnn-fade 0.4s ease both;
}
.cnn-feed-card:hover {
  border-color: var(--edgehi); border-left-color: var(--kry);
  transform: translateX(2px);
}
@keyframes cnn-fade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Breaking-now row (injected by JS) ---------- */
.cnn-breaking-item { transition: background 0.15s; }
.cnn-breaking-item:hover { background: rgba(43,255,136,0.04); }

/* ---------- Sentiment badges ---------- */
.cnn-sent {
  font-family: 'JetBrains Mono', monospace; font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 3px;
}
.cnn-sent-bull { background: rgba(31,214,122,0.15); color: var(--gain); border: 1px solid rgba(31,214,122,0.4); }
.cnn-sent-bear { background: rgba(255,80,102,0.15); color: var(--loss); border: 1px solid rgba(255,80,102,0.4); }
.cnn-sent-neut { background: rgba(130,140,163,0.15); color: #828ca3; border: 1px solid rgba(130,140,163,0.35); }
.cnn-sent-scam { background: var(--loss); color: #fff; animation: cnn-scam 1.6s ease-in-out infinite; }
@keyframes cnn-scam { 50% { box-shadow: 0 0 12px rgba(255,80,102,0.85); } }

/* ---------- Toast visible state ---------- */
.cnn-toast-show { opacity: 1 !important; transform: translate(-50%, 0) !important; }

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .cnn-ticker-track, .cnn-bticker-track { animation: none; }
  .cnn-reveal { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   ADDED: Scam Radar, report modal, search, mobile polish
   ============================================================ */

/* ---- Hide scrollbar on horizontal chip rows (app-like) ---- */
.cnn-noscroll { -ms-overflow-style: none; scrollbar-width: none; }
.cnn-noscroll::-webkit-scrollbar { display: none; }

/* ---- Red pulsing ring dot ---- */
.cnn-pulse-red {
  box-shadow: 0 0 0 0 rgba(255,80,102,0.55);
  animation: cnn-ring-red 1.9s infinite;
}
@keyframes cnn-ring-red {
  0%   { box-shadow: 0 0 0 0 rgba(255,80,102,0.55); }
  70%  { box-shadow: 0 0 0 11px rgba(255,80,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,80,102,0); }
}

/* ---- Scam Radar cards (injected by JS) ---- */
.cnn-scam-card {
  background: #10141f;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--edge);
  border-radius: 10px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.15s, transform 0.15s;
  animation: cnn-fade 0.4s ease both;
}
.cnn-scam-card:hover { border-color: var(--edgehi); transform: translateY(-2px); }
.cnn-scam-card.sev-critical { border-left-color: var(--loss); }
.cnn-scam-card.sev-high     { border-left-color: #ff9d3c; }
.cnn-scam-card.sev-active   { border-left-color: var(--electric); }
.cnn-scam-card.sev-watch    { border-left-color: #ffd23f; }

/* ---- Severity badges ---- */
.cnn-sev {
  font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.7px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 3px; white-space: nowrap;
}
.cnn-sev-critical { background: var(--loss); color: #fff; animation: cnn-scam 1.6s ease-in-out infinite; }
.cnn-sev-high     { background: rgba(255,157,60,0.15);  color: #ff9d3c; border: 1px solid rgba(255,157,60,0.45); }
.cnn-sev-active   { background: rgba(58,166,255,0.15);  color: var(--electric); border: 1px solid rgba(58,166,255,0.45); }
.cnn-sev-watch    { background: rgba(255,210,63,0.13);  color: #ffd23f; border: 1px solid rgba(255,210,63,0.4); }

/* ---- Form inputs (report modal) ---- */
.cnn-input {
  background: #0a0e1a;
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: 11px 13px;
  font-size: 0.92rem;
  color: #e9edf6;
}
.cnn-input::placeholder { color: #59617a; }
.cnn-input:focus { outline: none; border-color: var(--kry); box-shadow: 0 0 0 2px rgba(43,255,136,0.12); }
select.cnn-input { appearance: none; cursor: pointer; }

/* ---- Report modal entrance ---- */
.cnn-modal-card { animation: cnn-sheet 0.28s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes cnn-sheet {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (min-width: 640px) {
  .cnn-modal-card { animation-name: cnn-pop; }
  @keyframes cnn-pop {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
  }
}

/* ---- Feed action buttons (base size; bumped on mobile below) ---- */
.cnn-act { width: 30px; height: 30px; }

/* ---- Mobile polish ---- */
@media (max-width: 640px) {
  .cnn-feed-card  { padding: 14px 14px; }
  .cnn-scam-card  { padding: 15px; }
  .cnn-ticker-item { padding: 9px 16px; }
  /* comfortable tap targets for feed action buttons */
  .cnn-act { width: 34px; height: 34px; }
}

/* prevent body scroll behind open modal */
body.cnn-modal-open { overflow: hidden; }

/* ============================================================
   ADDED: Markets sidebar, Market Mood gauge,
   Regulation Watch, Community Pulse
   ============================================================ */

/* ---- Sidebar cards ---- */
.cnn-side-card {
  background: #10141f;
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 15px 16px;
}
.cnn-side-title {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700; font-size: 0.86rem;
  letter-spacing: 0.8px; text-transform: uppercase;
  color: #e9edf6;
  padding-bottom: 9px; margin-bottom: 4px;
  border-bottom: 1px solid var(--edge);
  display: flex; align-items: center; gap: 6px;
}

/* ---- Coin rows (injected by JS) ---- */
.cnn-coin-list { display: flex; flex-direction: column; }
.cnn-coin-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--edge);
}
.cnn-coin-row:last-child { border-bottom: none; }
.cnn-coin-sym {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 0.8rem; color: #e9edf6;
}
.cnn-coin-rank {
  font-family: 'JetBrains Mono', monospace; font-size: 0.68rem;
  color: var(--faint, #59617a); min-width: 16px;
}
.cnn-coin-price {
  font-family: 'JetBrains Mono', monospace; font-size: 0.76rem;
  color: #828ca3; margin-left: auto;
}
.cnn-coin-chg {
  font-family: 'JetBrains Mono', monospace; font-size: 0.74rem;
  font-weight: 500; min-width: 62px; text-align: right;
}

/* ---- Market Mood gauge ---- */
.cnn-gauge-needle {
  transition: transform 0.9s cubic-bezier(0.34, 1.2, 0.64, 1);
  transform-origin: 100px 100px;
  transform-box: view-box;
}
.cnn-gauge-track { stroke: #1c2336; }

/* ---- Regulation Watch cards (injected by JS) ---- */
.cnn-reg-card {
  background: #10141f;
  border: 1px solid var(--edge);
  border-top: 3px solid var(--electric);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 9px;
  transition: border-color 0.15s, transform 0.15s;
  animation: cnn-fade 0.4s ease both;
}
.cnn-reg-card:hover { border-color: var(--edgehi); transform: translateY(-2px); }
.cnn-reg-tag {
  align-self: flex-start;
  font-family: 'JetBrains Mono', monospace; font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--electric);
  background: rgba(58,166,255,0.12);
  border: 1px solid rgba(58,166,255,0.4);
  padding: 3px 8px; border-radius: 3px;
}

/* ---- Community Pulse cards (injected by JS) ---- */
.cnn-pulse-card {
  background: #10141f;
  border: 1px solid var(--edge);
  border-left: 3px solid #9d6bff;
  border-radius: 10px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 9px;
  transition: border-color 0.15s, transform 0.15s;
  animation: cnn-fade 0.4s ease both;
}
.cnn-pulse-card:hover { border-color: var(--edgehi); transform: translateY(-2px); }
.cnn-sub-tag {
  align-self: flex-start;
  font-family: 'JetBrains Mono', monospace; font-size: 0.66rem; font-weight: 700;
  color: #b89dff;
}

/* ============================================================
   ADDED: Legal pages (privacy.html / terms.html)
   ============================================================ */
.cnn-legal h2 {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700; font-size: 1.05rem;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: #e9edf6;
  margin: 30px 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--edge);
}
.cnn-legal h2:first-child { margin-top: 0; }
.cnn-legal p {
  color: #828ca3; line-height: 1.7; font-size: 0.93rem;
  margin: 10px 0;
}
.cnn-legal ul { margin: 10px 0; padding: 0; list-style: none; }
.cnn-legal li {
  color: #828ca3; line-height: 1.65; font-size: 0.93rem;
  margin: 7px 0; padding-left: 20px; position: relative;
}
.cnn-legal li::before {
  content: '\25B8'; color: var(--kry);
  position: absolute; left: 3px; top: 0;
}
.cnn-legal strong { color: #e9edf6; font-weight: 600; }
.cnn-legal a { color: var(--electric); }
.cnn-legal a:hover { text-decoration: underline; }

/* ============================================================
   ADDED: breaking-news ticker, scroll-reveal, back-to-top,
   loading / error states, article page
   ============================================================ */

/* ---- Breaking-news headline ticker ---- */
.cnn-bticker-track { animation: cnn-ticker 78s linear infinite; will-change: transform; }
.cnn-bticker-track:hover { animation-play-state: paused; }
.cnn-bticker-item {
  display: inline-flex; align-items: center; white-space: nowrap;
  flex-shrink: 0;
  padding: 7px 0; font-size: 0.8rem; color: #c4ccdd; text-decoration: none;
}
.cnn-bticker-item:hover { color: var(--kry); }
.cnn-bticker-cat {
  font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--electric); margin-right: 8px;
}
.cnn-bticker-sep { color: var(--kry); padding: 0 20px; font-size: 0.55rem; flex-shrink: 0; }

/* ---- Scroll-reveal (sections fade up on entry) ---- */
.cnn-reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.cnn-reveal.cnn-in { opacity: 1; transform: none; }

/* ---- Back-to-top button ---- */
.cnn-totop {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--edgehi);
  background: #10141f; color: var(--kry);
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.2s;
}
.cnn-totop.cnn-show { opacity: 1; pointer-events: auto; transform: none; }
.cnn-totop:hover { box-shadow: 0 0 16px rgba(43,255,136,0.35); border-color: var(--kry); }

/* ---- Loading shimmer (sidebar rows etc.) ---- */
.cnn-skel {
  background: linear-gradient(90deg, #161c2b 25%, #1c2336 50%, #161c2b 75%);
  background-size: 200% 100%;
  animation: cnn-shimmer 1.4s linear infinite;
  border-radius: 4px;
}
@keyframes cnn-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ---- Inline error / empty card ---- */
.cnn-error {
  border: 1px solid var(--edge);
  border-left: 3px solid var(--loss);
  background: #10141f;
  border-radius: 10px;
  padding: 18px 20px;
  font-size: 0.88rem; color: #828ca3;
}
.cnn-error strong { color: #e9edf6; }

/* ---- Article page ---- */
html { scroll-padding-top: 186px; }
.cnn-article-body p {
  color: #c4ccdd; line-height: 1.8; font-size: 1.02rem; margin: 16px 0;
}
.cnn-article-body p.cnn-standfirst {
  color: #e9edf6; font-size: 1.18rem; line-height: 1.6; font-weight: 500;
}

/* ============================================================
   ADDED: Top breaking ticker, inline scam cards, radar FAB
   ============================================================ */

/* ---- Top breaking ticker (sticky above header) ---- */
#topBreakingBar { background: #06080f; }
.cnn-top-bticker-track {
  animation: cnn-ticker 55s linear infinite;
  will-change: transform;
}
.cnn-top-bticker-track:hover { animation-play-state: paused; }
.cnn-top-bticker-item {
  display: inline-flex; align-items: center;
  padding: 0 22px; font-size: 0.79rem; font-weight: 500;
  color: #d6dae6; text-decoration: none;
  white-space: nowrap; flex-shrink: 0;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: color 0.15s;
}
.cnn-top-bticker-item:hover { color: #fff; }
.cnn-top-bticker-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.57rem; font-weight: 700;
  letter-spacing: 0.7px; text-transform: uppercase;
  color: #ff9d3c; margin-right: 10px; flex-shrink: 0;
}
.cnn-top-bticker-sep {
  color: rgba(255,80,102,0.45); padding: 0 18px;
  font-size: 0.48rem; flex-shrink: 0;
}

/* ---- Inline scam alert cards in The Wire ---- */
.cnn-feed-scam-inline {
  background: rgba(255,80,102,0.04);
  border: 1px solid rgba(255,80,102,0.22);
  border-left: 3px solid var(--loss);
  border-radius: 8px; padding: 14px 18px;
  animation: cnn-fade 0.4s ease both;
  transition: border-color 0.15s, background 0.15s;
}
.cnn-feed-scam-inline:hover {
  border-color: rgba(255,80,102,0.45);
  background: rgba(255,80,102,0.07);
}
.cnn-inline-scam-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--loss);
  background: rgba(255,80,102,0.12);
  border: 1px solid rgba(255,80,102,0.35);
  padding: 3px 8px; border-radius: 3px;
  animation: cnn-scam 1.6s ease-in-out infinite;
}

/* ---- Floating Scam Radar FAB ---- */
.cnn-radar-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 1000;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(255,80,102,0.35);
  background: #10141f; color: var(--loss);
  display: grid; place-items: center;
  cursor: pointer; overflow: hidden;
  transition: box-shadow 0.25s, border-color 0.2s, transform 0.2s;
}
.cnn-radar-fab:hover {
  box-shadow: 0 0 22px rgba(255,80,102,0.45);
  border-color: var(--loss); transform: scale(1.07);
}
.cnn-radar-fab:focus-visible { outline: 2px solid var(--loss); outline-offset: 3px; }
.cnn-radar-fab:active { transform: scale(0.95); }
.cnn-radar-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(
    from 0deg, transparent 0deg 320deg, rgba(255,80,102,0.2) 320deg 360deg
  );
  animation: cnn-radar-spin 2.8s linear infinite;
}
@keyframes cnn-radar-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.cnn-radar-icon { position: relative; z-index: 1; width: 22px; height: 22px; }
.cnn-radar-badge {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  min-width: 15px; height: 15px;
  background: var(--loss); color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.51rem; font-weight: 700; border-radius: 8px;
  display: grid; place-items: center; padding: 0 3px;
}
.cnn-radar-label {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0a0e1a; border: 1px solid rgba(255,80,102,0.3);
  color: var(--loss); padding: 3px 8px; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.56rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity 0.15s, transform 0.15s;
}
.cnn-radar-fab:hover .cnn-radar-label { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Back-to-top sits above the radar FAB, both above atmos overlay */
.cnn-totop { bottom: 80px; z-index: 1001; }
