@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&family=Space+Mono:wght@400;700&display=swap");

:root {
  --bg: #0a0f1c;
  --panel: #111827;
  --line: #233252;
  --primary: #00e5ff;
  --secondary: #00ffa6;
  --text: #e8f0ff;
  --muted: #9bb0d9;
  --glow: rgba(0, 255, 200, 0.15);
}

.security-shell {
  position: relative;
  overflow: hidden;
  padding-bottom: 4rem;
  background:
    radial-gradient(circle at 8% 0%, rgba(0, 229, 255, 0.18), transparent 30%),
    radial-gradient(circle at 92% 8%, rgba(0, 255, 166, 0.15), transparent 30%),
    linear-gradient(180deg, var(--bg), #0d1426 55%, #0a111f 100%);
}

.security-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 1px, transparent 2px, transparent 4px);
}

.hero-panel-cyber {
  padding: 3.2rem 0 1.2rem;
}

.hero-kicker {
  margin: 0;
  font-family: "Space Mono", Consolas, monospace;
  color: var(--secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-panel-cyber h1 {
  margin-top: 0.25rem;
  margin-bottom: 0.6rem;
  text-align: left;
  font-family: "Orbitron", "Segoe UI", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  color: #ddfbff;
  text-shadow: 0 0 16px rgba(0,229,255,0.45);
}

.hero-lead {
  max-width: 860px;
  color: #bfd3ff;
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.scan-progress-wrap {
  margin-top: 0.85rem;
  border: 1px solid rgba(0, 229, 255, 0.26);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: rgba(10, 18, 35, 0.8);
}

.scan-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.scan-progress-head strong {
  color: #d7f7ff;
  font-family: "Space Mono", Consolas, monospace;
}

.scan-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

#scanProgressFill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  box-shadow: 0 0 16px rgba(0, 255, 166, 0.45);
  transition: width 0.3s ease;
}

/* — Scan Report Area — */
.scan-report-area {
  margin-top: 0.75rem;
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  background: rgba(8, 13, 28, 0.94);
  animation: cvFadeInDown 0.3s ease;
}

.scan-report-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Space Mono", Consolas, monospace;
  font-size: 0.84rem;
  color: var(--primary);
  margin-bottom: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scan-report-close-btn {
  background: none;
  border: 1px solid rgba(0, 229, 255, 0.28);
  color: var(--muted);
  border-radius: 8px;
  padding: 0.18rem 0.5rem;
  font-size: 0.76rem;
  cursor: pointer;
  font-family: "Space Mono", Consolas, monospace;
  transition: color 0.2s, border-color 0.2s;
}
.scan-report-close-btn:hover { color: var(--primary); border-color: var(--primary); }

.scan-report-score {
  font-size: 0.87rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.scan-finding {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.scan-finding:last-child { border-bottom: none; }

.finding-icon { flex-shrink: 0; font-size: 0.95rem; line-height: 1.5; }

.finding-name {
  font-family: "Space Mono", Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text);
  flex-shrink: 0;
  min-width: 190px;
  line-height: 1.5;
}

.finding-detail { flex: 1; }

.finding-good-msg { font-size: 0.8rem; color: #7af5c0; }

.finding-fix-btn {
  background: none;
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f5b042;
  border-radius: 8px;
  padding: 0.12rem 0.42rem;
  font-size: 0.74rem;
  cursor: pointer;
  font-family: "Space Mono", Consolas, monospace;
  transition: border-color 0.2s, color 0.2s;
}
.finding-fix-btn:hover { border-color: #f5b042; color: #ffd080; }

.finding-fix-wrap { margin-top: 0.4rem; }

.finding-fix-text {
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-family: "Space Mono", Consolas, monospace;
  font-size: 0.73rem;
  color: #e8d5aa;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  line-height: 1.65;
}

/* — Clear history button — */
.clear-history-btn {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  border-radius: 8px;
  padding: 0.3rem 0;
  font-size: 0.76rem;
  cursor: pointer;
  font-family: "Space Mono", Consolas, monospace;
  transition: border-color 0.2s, color 0.2s;
}
.clear-history-btn:hover { border-color: rgba(0, 229, 255, 0.45); color: var(--primary); }

@keyframes cvFadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.live-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 0.9rem;
}

.live-card,
.tool-card,
.hub-cta-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 27, 47, 0.95), rgba(13, 20, 37, 0.98));
  box-shadow: 0 14px 34px rgba(0,0,0,0.35), inset 0 1px 0 rgba(0,229,255,0.1);
}

.live-card {
  padding: 1rem;
}

.live-card h3 {
  font-family: "Orbitron", "Segoe UI", sans-serif;
  margin-bottom: 0.5rem;
  color: #e1fbff;
  font-size: 1rem;
}

.recent-title {
  margin-top: 0.8rem;
  margin-bottom: 0.3rem;
  font-size: 0.84rem;
  color: #b8d8ff;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-list li {
  font-size: 0.8rem;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.3rem 0;
}

.kv-list,
.status-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.kv-list li,
.status-list li {
  margin: 0.35rem 0;
  color: var(--muted);
}

/* — Expandable status rows — */
.status-row {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.status-row:last-child { border-bottom: none; }

.status-row-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  background: transparent;
  border: none;
  appearance: none;
  -webkit-appearance: none;
  color: #d8e7ff;
  padding: 0.52rem 0;
  cursor: pointer;
  gap: 0.75rem;
  text-align: left;
  transition: color 0.18s;
}
.status-row-header:focus-visible {
  outline: 2px solid rgba(0, 229, 255, 0.55);
  outline-offset: 2px;
  border-radius: 8px;
}
.status-row-header:hover { color: var(--text); }
.status-row-header:hover .status-chevron { color: var(--primary); }

.status-row-left {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
  flex: 1;
}

.status-row-label {
  font-size: 0.9rem;
  color: #e8f2ff;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.status-row-sub {
  color: #aec3e8;
  font-size: 0.77rem;
  line-height: 1.38;
}
.status-row-sub.good { color: #8ff1c5; }
.status-row-sub.medium,
.status-row-sub.check { color: #9ec8ff; }
.status-row-sub.low,
.status-row-sub.risk { color: #ffd7a0; }

.status-row-right {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-shrink: 0;
}

.status-chevron {
  font-size: 0.7rem;
  color: var(--muted);
  transition: transform 0.22s ease, color 0.18s;
  line-height: 1;
}
.status-row-header[aria-expanded="true"] .status-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.status-detail {
  padding: 0.52rem 0 0.75rem 0.1rem;
  animation: cvFadeInDown 0.22s ease;
}

.status-detail-why {
  font-size: 0.84rem;
  color: #d5e4ff;
  margin-bottom: 0.52rem;
  line-height: 1.56;
}

.status-detail-fix {
  background: transparent;
  border: none;
  border-left: 3px solid rgba(0, 229, 255, 0.45);
  border-radius: 0;
  padding: 0.2rem 0 0.2rem 0.72rem;
  font-family: "Space Mono", Consolas, monospace;
  font-size: 0.8rem;
  color: #e5f1ff;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  line-height: 1.75;
}
.status-detail-fix.risk {
  border-left-color: rgba(245, 158, 11, 0.7);
  color: #ffe8be;
}
.status-detail-fix.good {
  border-left-color: rgba(0, 255, 166, 0.75);
  color: #d6ffe9;
}

.status-next-btn {
  margin-top: 0.45rem;
  background: transparent;
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #dff8ff;
  border-radius: 8px;
  padding: 0.32rem 0.58rem;
  font-size: 0.74rem;
  font-family: "Space Mono", Consolas, monospace;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.status-next-btn:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: rgba(0, 229, 255, 0.75);
  transform: translateY(-1px);
}

.status-tag {
  border-radius: 999px;
  min-width: 96px;
  text-align: center;
  padding: 0.24rem 0.58rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.26);
}

.status-tag.good {
  color: #d8ffee;
  border-color: rgba(0,255,166,0.5);
  background: rgba(0,255,166,0.22);
}

.status-tag.medium {
  color: #e9f6ff;
  border-color: rgba(0,229,255,0.5);
  background: rgba(0,229,255,0.22);
}

.status-tag.warning {
  color: #fff0c8;
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.26);
}

.radar-card canvas {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
}

.quick-tools,
.category-section,
.hub-cta {
  padding: 1rem 0;
}

.section-head h2 {
  font-family: "Orbitron", "Segoe UI", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: clamp(1.2rem, 2.6vw, 1.8rem);
  margin-bottom: 0.4rem;
}

.section-head p {
  color: var(--muted);
}

.quick-grid,
.tool-grid {
  display: grid;
  gap: 0.85rem;
}

.quick-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.7rem;
}

.quick-card {
  border: 1px solid rgba(0,229,255,0.35);
  background: linear-gradient(180deg, rgba(14, 24, 46, 0.95), rgba(9, 15, 32, 0.98));
  color: var(--text);
  border-radius: 16px;
  padding: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.quick-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 0 24px var(--glow);
}

.quick-card span {
  font-size: 1.2rem;
}

.quick-card h3 {
  margin: 0.3rem 0;
  font-size: 1rem;
}

.quick-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0 1rem;
}

.tab-btn {
  border: 1px solid rgba(0,229,255,0.35);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-family: "Space Mono", Consolas, monospace;
  font-size: 0.86rem;
  cursor: pointer;
}

.tab-btn.active {
  border-color: var(--secondary);
  background: rgba(0,255,166,0.12);
  box-shadow: 0 0 20px rgba(0,255,166,0.12);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-card {
  padding: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,255,166,0.55);
  box-shadow: 0 0 24px rgba(0,255,166,0.1);
}

.tool-card h3 {
  font-family: "Orbitron", "Segoe UI", sans-serif;
  font-size: 1rem;
  color: #dcf6ff;
  margin-bottom: 0.35rem;
}

.tool-card p {
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.field {
  margin-bottom: 0.6rem;
}

.field label {
  color: var(--muted);
  font-size: 0.92rem;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(126, 160, 220, 0.36);
  border-radius: 12px;
  background: rgba(8, 13, 27, 0.9);
  color: #ecf5ff;
  padding: 0.65rem 0.75rem;
  font-family: "Space Mono", Consolas, monospace;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.16);
}

.inline-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tool-output {
  margin-top: 0.65rem;
  border: 1px solid rgba(0,255,166,0.25);
  border-radius: 12px;
  background: rgba(6, 14, 21, 0.9);
  color: #bdf8cf;
  min-height: 58px;
  padding: 0.6rem 0.7rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Space Mono", Consolas, monospace;
  font-size: 0.88rem;
}

.tool-drawer {
  position: fixed;
  inset: 0;
  z-index: 1300;
  pointer-events: none;
}

.tool-drawer.open {
  pointer-events: auto;
}

.tool-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 14, 0.62);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tool-drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  width: min(420px, 100%);
  height: 100%;
  background: linear-gradient(180deg, rgba(11, 19, 40, 0.98), rgba(8, 13, 30, 0.99));
  border-left: 1px solid rgba(0, 229, 255, 0.28);
  box-shadow: -24px 0 44px rgba(0, 0, 0, 0.42);
  transform: translateX(100%);
  transition: transform 0.26s ease;
  padding: 1.2rem;
}

.tool-drawer.open .tool-drawer-panel {
  transform: translateX(0);
}

.tool-drawer.open .tool-drawer-backdrop {
  opacity: 1;
}

.tool-drawer-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.03);
  color: #def5ff;
  font-size: 1.15rem;
  cursor: pointer;
}

.tool-drawer-kicker {
  margin-top: 0.4rem;
  color: var(--secondary);
  font-family: "Space Mono", Consolas, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.tool-drawer-panel h3 {
  font-family: "Orbitron", "Segoe UI", sans-serif;
  margin-bottom: 0.4rem;
}

.tool-drawer-desc {
  color: var(--muted);
}

.tool-drawer-note {
  margin-top: 0.85rem;
  margin-bottom: 0.85rem;
  border-left: 3px solid var(--secondary);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: rgba(0,255,166,0.08);
  color: #c7efdd;
  font-size: 0.87rem;
}

.tool-card.flash {
  animation: flashCard 1s ease;
}

@keyframes flashCard {
  0% { box-shadow: 0 0 0 rgba(0,229,255,0); }
  50% { box-shadow: 0 0 28px rgba(0,229,255,0.38); }
  100% { box-shadow: 0 0 0 rgba(0,229,255,0); }
}

.hub-cta-card {
  padding: 1.2rem;
  text-align: center;
}

.hub-cta-card h2 {
  font-family: "Orbitron", "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
}

.hub-cta-card p {
  color: var(--muted);
}

@media (max-width: 1080px) {
  .live-grid,
  .quick-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }
}
