/* ═══════════════════════════════════════════════════════════════
   HiTechBits — Security Watch page
   Builds on style.css (tokens) + pages.css (header, hero, footer)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --sev-critical: #ff4d4d;
  --sev-high:     #ff8a3d;
  --sev-medium:   #f5c518;
  --sev-low:      #4ade80;
  --kev:          #ff4d4d;
  --major:        #ff5ea8;
  --trending:     #fbbf24;
  --watch:        #34d399;
}

.sw-updated { margin-top: 1.1rem; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); letter-spacing: 0.04em; }
.sw-updated b { color: var(--green); font-weight: 500; }

.sw-main { max-width: 1240px; margin: 0 auto; padding: 2rem 2rem 4rem; position: relative; z-index: 1; }

/* ── stat tiles ── */
.sw-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 2rem; }
.sw-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; position: relative; overflow: hidden; }
.sw-stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--accent)); }
.sw-stat-num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.sw-stat-label { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-secondary); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 4px; }

/* ── watchlist match banner ── */
.sw-watch { background: linear-gradient(90deg, rgba(52,211,153,0.12), rgba(52,211,153,0.03)); border: 1px solid rgba(52,211,153,0.4); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 2rem; }
.sw-watch h3 { font-family: var(--font-display); font-size: 1rem; color: var(--watch); margin-bottom: 0.5rem; }
.sw-watch ul { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 0.86rem; }
.sw-watch a { color: var(--text-primary); text-decoration: none; } .sw-watch a:hover { text-decoration: underline; }

/* ── sections ── */
.sw-section { margin-bottom: 3rem; }
.sw-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sw-head h2, .sw-panel h2 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
.sw-hint { font-size: 0.84rem; color: var(--text-secondary); max-width: 480px; line-height: 1.55; }
.sw-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sw-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.sw-chip { font-family: var(--font-ui); font-size: 0.76rem; font-weight: 500; color: var(--text-secondary); background: transparent; border: 1px solid var(--border); border-radius: 20px; padding: 0.3rem 0.8rem; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.sw-chip:hover { color: var(--text-primary); border-color: var(--border-hi); }
.sw-chip.active { color: #fff; background: rgba(79,158,255,0.15); border-color: var(--accent); }
.sw-search { font-family: var(--font-ui); font-size: 0.82rem; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.45rem 0.8rem; width: 250px; }
.sw-search:focus { outline: none; border-color: var(--accent); }

/* ── trending topics ── */
.sw-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.sw-topic { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.7rem; }
.sw-topic.heat-major { border-color: rgba(255,94,168,0.55); box-shadow: 0 0 0 1px rgba(255,94,168,0.15), 0 6px 24px rgba(255,94,168,0.08); }
.sw-topic.watched { border-color: var(--watch); }
.sw-topic-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sw-topic-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.sw-heat { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-secondary); }
.sw-heatbar { height: 5px; border-radius: 3px; background: var(--bg-surface); overflow: hidden; }
.sw-heatbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--trending), var(--major)); border-radius: 3px; }
.sw-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.sw-dot { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-secondary); border: 1px solid var(--border); border-left: 3px solid var(--oc); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.sw-headlines { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sw-headlines li { font-size: 0.84rem; line-height: 1.4; }
.sw-headlines a { color: var(--text-primary); text-decoration: none; } .sw-headlines a:hover { color: var(--accent); }
.sw-headlines small { display: block; font-family: var(--font-mono); font-size: 0.64rem; color: var(--text-dim); margin-top: 1px; }

/* ── badges ── */
.sw-badge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; border-radius: 4px; padding: 2px 7px; white-space: nowrap; }
.b-major { color: #fff; background: rgba(255,94,168,0.22); border: 1px solid rgba(255,94,168,0.6); }
.b-hot { color: #fff; background: rgba(251,191,36,0.15); border: 1px solid rgba(251,191,36,0.5); }
.b-warm { color: var(--text-secondary); border: 1px solid var(--border-hi); }
.b-trending { color: var(--trending); border: 1px solid rgba(251,191,36,0.5); }
.b-kev { color: #fff; background: rgba(255,77,77,0.2); border: 1px solid rgba(255,77,77,0.65); }
.b-ransom { color: #ffb4b4; border: 1px dashed rgba(255,77,77,0.6); }
.b-watch { color: #04140c; background: var(--watch); }
.b-new { color: var(--accent); border: 1px solid rgba(79,158,255,0.5); }
.sev { font-family: var(--font-display); font-weight: 800; font-size: 0.82rem; border-radius: 6px; padding: 3px 8px; min-width: 44px; text-align: center; color: #0b0d12; }
.sev-critical { background: var(--sev-critical); } .sev-high { background: var(--sev-high); } .sev-medium { background: var(--sev-medium); }
.sev-low { background: var(--sev-low); } .sev-none { background: var(--bg-surface); color: var(--text-dim); border: 1px solid var(--border); font-size: 0.66rem; }
.cve-chip { font-family: var(--font-mono); font-size: 0.66rem; color: var(--accent); background: rgba(79,158,255,0.08); border: 1px solid rgba(79,158,255,0.3); border-radius: 4px; padding: 1px 6px; text-decoration: none; white-space: nowrap; }
.cve-chip.kev { color: #ffb4b4; background: rgba(255,77,77,0.1); border-color: rgba(255,77,77,0.45); }
.cve-chip:hover { border-color: var(--accent); }
.sw-chips { display: flex; gap: 5px; flex-wrap: wrap; }

/* ── CVE list ── */
.sw-cves { display: flex; flex-direction: column; gap: 8px; }
.sw-cve { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.sw-cve.watched { border-color: var(--watch); }
.sw-cve summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 34px 58px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 0.8rem 1rem; }
.sw-cve summary::-webkit-details-marker { display: none; }
.sw-cve summary:hover { background: var(--bg-card-hover); }
.sw-rank { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); text-align: right; }
.sw-cve-main { min-width: 0; }
.sw-cve-id { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); }
.sw-cve-title { font-size: 0.92rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.sw-cve-badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.sw-cve-meta { display: flex; gap: 14px; font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-secondary); margin-top: 3px; flex-wrap: wrap; }
.sw-cve-body { padding: 0.2rem 1rem 1rem calc(34px + 58px + 2rem + 28px); font-size: 0.86rem; color: var(--text-secondary); line-height: 1.6; display: flex; flex-direction: column; gap: 0.6rem; }
.sw-cve-body b { color: var(--text-primary); font-weight: 600; }
.sw-cve-body a { color: var(--accent); text-decoration: none; } .sw-cve-body a:hover { text-decoration: underline; }
.sw-cve-body ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.sw-epss { display: inline-flex; align-items: center; gap: 6px; }
.sw-epss i { display: inline-block; width: 46px; height: 4px; background: var(--bg-surface); border-radius: 2px; overflow: hidden; }
.sw-epss i span { display: block; height: 100%; background: var(--sev-high); }

/* ── news wire ── */
.sw-news { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-card); }
.sw-item { display: grid; grid-template-columns: 70px 128px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); }
.sw-item:last-child { border-bottom: 0; }
.sw-item:hover { background: var(--bg-card-hover); }
.sw-item.watched { box-shadow: inset 3px 0 0 var(--watch); }
.sw-time { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-dim); }
.sw-src { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--oc); padding-left: 6px; }
.sw-item-title a { color: var(--text-primary); text-decoration: none; font-size: 0.9rem; line-height: 1.45; } .sw-item-title a:hover { color: var(--accent); }
.sw-item-title .sw-chips { margin-top: 4px; }
mark.sw-hl { background: rgba(52,211,153,0.25); color: inherit; border-radius: 2px; padding: 0 1px; }
.sw-more { display: block; margin: 12px auto 0; font-family: var(--font-ui); font-size: 0.8rem; color: var(--text-secondary); background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 1.4rem; cursor: pointer; }
.sw-more:hover { color: var(--text-primary); border-color: var(--accent); }
.sw-empty { padding: 1.4rem; color: var(--text-dim); font-size: 0.86rem; text-align: center; }

/* ── watchlist + methodology ── */
.sw-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sw-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 0.8rem; }
.sw-watch-form { display: flex; gap: 8px; }
.sw-watch-form input { flex: 1; font-family: var(--font-ui); font-size: 0.84rem; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.8rem; min-width: 0; }
.sw-watch-form input:focus { outline: none; border-color: var(--watch); }
.sw-watch-form button { font-family: var(--font-ui); font-size: 0.82rem; font-weight: 600; color: #04140c; background: var(--watch); border: 0; border-radius: 8px; padding: 0 1.1rem; cursor: pointer; }
.sw-watch-list { display: flex; gap: 6px; flex-wrap: wrap; }
.sw-watch-tag { font-family: var(--font-mono); font-size: 0.72rem; color: var(--watch); border: 1px solid rgba(52,211,153,0.45); border-radius: 20px; padding: 3px 4px 3px 10px; display: inline-flex; align-items: center; gap: 6px; }
.sw-watch-tag button { background: none; border: 0; color: var(--text-dim); cursor: pointer; font-size: 0.85rem; line-height: 1; padding: 0 4px; }
.sw-watch-tag button:hover { color: var(--red); }
.sw-method { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.84rem; color: var(--text-secondary); line-height: 1.55; }
.sw-method b { color: var(--text-primary); } .sw-method em { color: var(--trending); font-style: normal; }
.sw-method a { color: var(--accent); text-decoration: none; } .sw-method a:hover { text-decoration: underline; }
.sw-sources { display: flex; gap: 6px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-dim); }
.sw-sources span { border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; }
.sw-sources span.err { color: var(--red); border-color: rgba(248,113,113,0.4); }

.sw-skel { height: 90px; border-radius: 12px; background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-card-hover) 50%, var(--bg-card) 100%); background-size: 200% 100%; animation: sw-shimmer 1.4s infinite; }
@keyframes sw-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── responsive ── */
@media (max-width: 900px) {
  .sw-stats { grid-template-columns: repeat(2, 1fr); }
  .sw-two { grid-template-columns: 1fr; }
  .sw-cve-body { padding-left: 1rem; }
}
@media (max-width: 640px) {
  .sw-main { padding: 1.4rem 1rem 3rem; }
  .sw-topics { grid-template-columns: 1fr; }
  .sw-search { width: 100%; }
  .sw-controls { width: 100%; }
  .sw-cve summary { grid-template-columns: 50px minmax(0, 1fr); gap: 10px; }
  .sw-rank { display: none; }
  .sw-cve-badges { grid-column: 1 / -1; justify-content: flex-start; }
  .sw-item { grid-template-columns: 1fr; gap: 2px; }
  .sw-item .sw-time { order: 2; }
  .sw-stat-num { font-size: 1.5rem; }
}
