/* PhishProtect Extension — Techniques Page (Dark Theme) */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0a0e1a;
  --bg-alt:   #111827;
  --surface:  rgba(255,255,255,0.04);
  --border:   rgba(255,255,255,0.08);
  --text:     #e2e8f0;
  --text-dim: #94a3b8;
  --cyan:     #06b6d4;
  --violet:   #8b5cf6;
  --amber:    #f59e0b;
  --radius:   10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--cyan); text-decoration: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.ext-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.ext-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ext-header-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}
.ext-header-title {
  font-size: 16px;
  font-weight: 600;
}
.ext-header-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-dim);
}
.ext-header-stats strong { color: var(--text); }

/* Main content */
.ext-body { padding: 24px; }

/* Controls */
.ext-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.ext-search {
  flex: 1;
  min-width: 200px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.ext-search::placeholder { color: var(--text-dim); }
.ext-search:focus { border-color: var(--cyan); }

.ext-view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.ext-view-btn {
  padding: 8px 16px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ext-view-btn:not(:last-child) { border-right: 1px solid var(--border); }
.ext-view-btn.active { background: rgba(6,182,212,0.15); color: var(--cyan); }

/* Panels */
.ext-panel { display: none; }
.ext-panel.active { display: block; }

/* Stats */
.ext-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.ext-stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  min-width: 120px;
}
.ext-stat-num { display: block; font-size: 1.5rem; font-weight: 600; }
.ext-stat-num.cov-yes { color: #4ade80; }
.ext-stat-num.cov-partial { color: #fbbf24; }
.ext-stat-num.cov-no { color: #94a3b8; }
.ext-stat-label { display: block; font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; }

/* Breadcrumb */
.ext-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 12px;
  flex-wrap: wrap;
}
.ext-bc-item {
  color: var(--text-dim);
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  padding: 0;
}
.ext-bc-item:hover { color: var(--cyan); }
.ext-bc-sep { color: var(--text-dim); opacity: 0.5; }

/* Grid cards */
.ext-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.ext-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.ext-card:hover { border-color: rgba(6,182,212,0.3); transform: translateY(-1px); }
.ext-card-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.ext-card-count { font-size: 11px; color: var(--text-dim); margin-bottom: 10px; }

/* Coverage bar */
.ext-cov-bar {
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(100,116,139,0.15);
}
.ext-cov-seg { height: 100%; }
.ext-cov-seg.cov-yes { background: #4ade80; }
.ext-cov-seg.cov-partial { background: #fbbf24; }
.ext-cov-seg.cov-no { background: rgba(100,116,139,0.3); }

/* Coverage pill */
.ext-cov-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ext-cov-pill.cov-yes { background: rgba(34,197,94,0.15); color: #4ade80; }
.ext-cov-pill.cov-partial { background: rgba(245,158,11,0.15); color: #fbbf24; }
.ext-cov-pill.cov-no { background: rgba(100,116,139,0.15); color: #94a3b8; }

/* Tree view */
.ext-tree { list-style: none; padding: 0; }
.ext-tree-node {
  border-left: 2px solid var(--border);
  margin-bottom: 2px;
}
.ext-tree-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 0 6px 6px 0;
  transition: background 0.15s;
  user-select: none;
}
.ext-tree-header:hover { background: rgba(255,255,255,0.03); }
.ext-tree-chevron {
  display: inline-block;
  width: 14px;
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.ext-tree-node.expanded > .ext-tree-header .ext-tree-chevron {
  transform: rotate(90deg);
}
.ext-tree-name { flex: 1; font-size: 13px; }
.ext-tree-children { display: none; padding-left: 18px; }
.ext-tree-node.expanded > .ext-tree-children { display: block; }
.ext-tree-leaf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 30px;
  cursor: pointer;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: var(--text-dim);
  transition: background 0.15s;
}
.ext-tree-leaf:hover { background: rgba(255,255,255,0.03); color: var(--text); }

/* Detail panel */
.ext-detail {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 440px;
  max-width: 90vw;
  background: var(--bg-alt);
  border-left: 1px solid var(--border);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.ext-detail.active { transform: translateX(0); }

.ext-detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}
.ext-detail-overlay.active { display: block; }

.ext-detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  z-index: 1;
}
.ext-detail-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.ext-detail-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px;
}
.ext-detail-scroll::-webkit-scrollbar { width: 4px; }
.ext-detail-scroll::-webkit-scrollbar-track { background: transparent; }
.ext-detail-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.ext-detail-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
  padding-right: 32px;
}

.ext-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.ext-detail-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.ext-detail-badge.mitre {
  background: rgba(139,92,246,0.12);
  color: #a78bfa;
  border-color: rgba(139,92,246,0.25);
}

.ext-detail-section { margin-bottom: 20px; }
.ext-detail-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}
.ext-detail-section p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}
.ext-detail-list { list-style: none; padding: 0; }
.ext-detail-list li {
  padding: 4px 0;
  font-size: 12px;
  color: var(--text-dim);
}
.ext-detail-list li::before {
  content: '\2713';
  color: var(--cyan);
  margin-right: 8px;
  font-weight: 600;
}

/* Detector cards with policy toggles */
.ext-det-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.ext-det-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.ext-det-name { font-size: 13px; font-weight: 600; }
.ext-det-sev {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
}
.ext-det-sev.sev-critical { background: rgba(239,68,68,0.15); color: #f87171; }
.ext-det-sev.sev-high { background: rgba(251,146,60,0.15); color: #fb923c; }
.ext-det-sev.sev-medium { background: rgba(245,158,11,0.15); color: #fbbf24; }
.ext-det-sev.sev-low { background: rgba(34,197,94,0.15); color: #4ade80; }
.ext-det-desc { font-size: 11px; color: var(--text-dim); line-height: 1.5; margin-bottom: 8px; }

/* Toggle switch */
.ext-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ext-toggle-label {
  font-size: 11px;
  color: var(--text-dim);
}
.ext-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  cursor: pointer;
}
.ext-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.ext-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(100,116,139,0.3);
  border-radius: 10px;
  transition: background 0.2s;
}
.ext-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.ext-toggle input:checked + .ext-toggle-slider {
  background: var(--cyan);
}
.ext-toggle input:checked + .ext-toggle-slider::before {
  transform: translateX(16px);
}

/* No results */
.ext-no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 13px;
}

@media (max-width: 768px) {
  .ext-header { flex-direction: column; gap: 8px; align-items: flex-start; }
  .ext-card-grid { grid-template-columns: 1fr; }
  .ext-detail { width: 100%; max-width: 100vw; }
  .ext-controls { flex-direction: column; }
  .ext-search { width: 100%; }
}
