/* ===========================
   Security Header Checker (sh-)
   =========================== */

:root {
  --sh-primary: #7c3aed;
  --sh-primary-light: #ede9fe;
  --sh-primary-dark: #6d28d9;
  --sh-success: #16a34a;
  --sh-success-light: #dcfce7;
  --sh-warn: #f59e0b;
  --sh-warn-light: #fef3c7;
  --sh-error: #dc2626;
  --sh-error-light: #fee2e2;
  --sh-info: #0ea5e9;
  --sh-info-light: #e0f2fe;
  --sh-border: #e2e8f0;
  --sh-bg-card: #f8fafc;
  --sh-text: #1e293b;
  --sh-text-muted: #64748b;
  --sh-radius: 12px;
  --sh-radius-sm: 6px;
  --sh-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --sh-shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --sh-transition: .2s ease;
}

/* ── Anchor Nav ── */
.sh-anchor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.sh-anchor-link {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--sh-border);
  border-radius: 20px;
  font-size: .82rem;
  color: var(--sh-text);
  text-decoration: none;
  transition: var(--sh-transition);
}
.sh-anchor-link:hover {
  background: var(--sh-primary-light);
  border-color: var(--sh-primary);
  color: var(--sh-primary-dark);
}

/* ── Buttons ── */
.sh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--sh-radius-sm);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--sh-transition);
  text-decoration: none;
  line-height: 1.4;
}
.sh-btn--primary {
  background: var(--sh-primary);
  color: #fff;
}
.sh-btn--primary:hover { background: var(--sh-primary-dark); }
.sh-btn--ghost {
  background: transparent;
  color: var(--sh-text);
  border: 1px solid var(--sh-border);
}
.sh-btn--ghost:hover { background: var(--sh-primary-light); border-color: var(--sh-primary); }
.sh-btn--secondary {
  background: var(--sh-primary-light);
  color: var(--sh-primary-dark);
  border: 1px solid transparent;
}
.sh-btn--secondary:hover { background: #ddd6fe; }

/* ── Grade Circle ── */
.sh-grade-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}
.sh-grade {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  box-shadow: var(--sh-shadow-md);
}
.sh-grade--a { background: linear-gradient(135deg, #16a34a, #22c55e); }
.sh-grade--b { background: linear-gradient(135deg, #65a30d, #84cc16); }
.sh-grade--c { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.sh-grade--d { background: linear-gradient(135deg, #f97316, #fb923c); }
.sh-grade--f { background: linear-gradient(135deg, #dc2626, #ef4444); }
.sh-score-label {
  font-size: .92rem;
  color: var(--sh-text-muted);
  font-weight: 600;
}

/* ── Results Container ── */
.sh-results { margin-top: 20px; }

/* ── Actions ── */
.sh-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ── Header Cards Grid ── */
.sh-header-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.sh-header-grid > p, .sh-header-grid > br { display: none !important; }

/* ── Header Card ── */
.sh-header-card {
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius);
  background: var(--sh-bg-card);
  overflow: hidden;
  box-shadow: var(--sh-shadow);
}
.sh-header-card--pass { border-left: 4px solid var(--sh-success); }
.sh-header-card--fail { border-left: 4px solid var(--sh-error); }
.sh-header-card--warn { border-left: 4px solid var(--sh-warn); }

.sh-header-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid var(--sh-border);
  gap: 10px;
  flex-wrap: wrap;
}
.sh-header-card__name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--sh-text);
}
.sh-header-card__badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.sh-badge--pass { background: var(--sh-success-light); color: var(--sh-success); }
.sh-badge--fail { background: var(--sh-error-light); color: var(--sh-error); }
.sh-badge--warn { background: var(--sh-warn-light); color: #92400e; }

.sh-header-card__body { padding: 14px 18px; }
.sh-header-card__value {
  font-family: 'Courier New', Consolas, monospace;
  font-size: .80rem;
  background: #f1f5f9;
  padding: 8px 12px;
  border-radius: var(--sh-radius-sm);
  word-break: break-all;
  margin-bottom: 10px;
  border: 1px solid var(--sh-border);
  line-height: 1.5;
}
.sh-header-card__desc {
  font-size: .84rem;
  color: var(--sh-text-muted);
  line-height: 1.6;
  margin-bottom: 10px;
}
.sh-header-card__risk {
  font-size: .82rem;
  color: var(--sh-error);
  margin-bottom: 10px;
}

/* ── Config Block ── */
.sh-config-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
}
.sh-config-tab {
  padding: 6px 14px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  background: #e2e8f0;
  border: 1px solid var(--sh-border);
  border-bottom: none;
  border-radius: var(--sh-radius-sm) var(--sh-radius-sm) 0 0;
  color: var(--sh-text-muted);
  transition: var(--sh-transition);
}
.sh-config-tab.active { background: #1e293b; color: #e2e8f0; }
.sh-config-code {
  display: none;
  background: #1e293b;
  color: #e2e8f0;
  padding: 12px 16px;
  border-radius: 0 var(--sh-radius-sm) var(--sh-radius-sm) var(--sh-radius-sm);
  font-family: 'Courier New', Consolas, monospace;
  font-size: .78rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  margin-bottom: 10px;
}
.sh-config-code.active { display: block; }

/* ── Info Card (Server/Powered-By) ── */
.sh-info-section {
  margin-bottom: 24px;
}
.sh-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.sh-info-grid > p, .sh-info-grid > br { display: none !important; }
.sh-info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius-sm);
  background: #fff;
  font-size: .84rem;
}
.sh-info-item__icon { font-size: 1.3rem; }
.sh-info-item__label { color: var(--sh-text-muted); }
.sh-info-item__value { font-weight: 600; color: var(--sh-text); margin-left: auto; }

/* ── Card / Table (generic) ── */
.sh-card {
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius);
  background: var(--sh-bg-card);
  overflow: hidden;
  box-shadow: var(--sh-shadow);
  margin-bottom: 20px;
}
.sh-card__header {
  padding: 14px 18px;
  font-weight: 700;
  font-size: .95rem;
  border-bottom: 1px solid var(--sh-border);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sh-card__body { padding: 14px 18px; }

/* ── Related Tools ── */
.sh-related-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.sh-related-tools > p, .sh-related-tools > br { display: none !important; }

/* ── SEO Content ── */
.sh-security {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0 24px;
}
.sh-security > p, .sh-security > br { display: none !important; }
.sh-security-item {
  text-align: center;
  padding: 16px;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius);
  background: #fff;
  margin-top: 0 !important;
}
.sh-security-item * { margin-top: 0 !important; }
.sh-security-item span { font-size: 2rem; display: block; margin-bottom: 8px; }
.sh-security-item p { margin: 0 !important; font-size: .82rem; color: var(--sh-text-muted); line-height: 1.5; }

.sh-use-cases {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 16px 0;
}
.sh-use-cases > p, .sh-use-cases > br { display: none !important; }
.sh-use-case {
  display: flex;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius);
  background: #fff;
  margin-top: 0 !important;
}
.sh-use-case * { margin-top: 0 !important; }
.sh-use-case > br, .sh-use-case > p { display: none !important; }
.sh-use-case > div > br, .sh-use-case > div > p:empty { display: none !important; }
.sh-use-case-icon { font-size: 1.5rem; flex-shrink: 0; }
.sh-use-case h4 { margin: 0 0 4px !important; font-size: .88rem; }
.sh-use-case p { margin: 0 !important; font-size: .82rem; color: var(--sh-text-muted); line-height: 1.5; }

.sh-faq { margin: 0; padding: 0; }
.sh-faq dt { font-weight: 700; font-size: .92rem; margin: 16px 0 4px; padding-left: 0; }
.sh-faq dt::before { content: 'Q. '; color: var(--sh-primary); font-weight: 800; }
.sh-faq dd { margin: 0 0 12px; padding-left: 24px; font-size: .86rem; color: var(--sh-text-muted); line-height: 1.7; }

/* ── Toast ── */
.sh-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--sh-text);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  opacity: 0;
  transition: .3s ease;
  z-index: 9999;
  pointer-events: none;
}
.sh-toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .sh-security { grid-template-columns: 1fr; }
  .sh-use-cases { grid-template-columns: 1fr; }
  .sh-info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .sh-btn { width: 100%; justify-content: center; }
  .sh-actions { flex-direction: column; }
}
