/* SafeShieldX — Fresh Green theme (visual-only override).
   Loaded AFTER /styles.css. Changes colours, radius and hover states only.
   No layout, URLs, headings, text or scanner logic is touched here.
   Brand tokens: primary #059669, hover #047857, dark #065f46,
   text #0b2e1a, muted #55705f, page bg #f3fbf6, light #dcf5e5,
   card #ffffff, border #c9e8d4, danger #dc2626, footer bg #06251a. */

:root {
  --bg: #f3fbf6;
  --bg-2: #e6f6ec;
  --panel: #ffffff;
  --panel-2: #eafaf0;
  --border: #c9e8d4;
  --border-soft: #d8efe0;
  --text: #0b2e1a;
  --muted: #55705f;
  --muted-2: #7a9384;
  --primary: #059669;
  --primary-hover: #047857;
  --primary-dim: rgba(5, 150, 105, 0.08);
  --primary-dark: #065f46;
  --green: #059669;
  --green-dim: rgba(5, 150, 105, 0.09);
  --red: #dc2626;
  --radius: 16px;
  --radius-sm: 10px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
header, .site-header { background: var(--card); border-bottom: 1px solid var(--border); }
.hero { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); }
.hero-shield { filter: drop-shadow(0 6px 18px rgba(5, 150, 105, .18)); }
h1, h2, h3 { color: var(--text); letter-spacing: -.02em; }
h1 span, .accent { color: var(--primary); }
p, .muted { color: var(--muted); }
input, textarea, select { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); font-size: 16px; padding: 14px 16px; }
input:focus, textarea:focus { outline: 3px solid rgba(5, 150, 105, .3); border-color: var(--primary); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5, 150, 105, .14); }
.card, .feature { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.safe { color: var(--primary); }
.danger { color: var(--danger); }
.warn { color: var(--warn); }
.verdict-danger { background: var(--danger); color: #fff; }
.verdict-safe { background: var(--primary); color: #fff; }
footer { color: var(--muted); }

/* Buttons: keep the base .btn look (white secondary buttons stay white),
   but repaint every blue shadow / hover on primary buttons green. */
.btn { border-radius: var(--radius); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35); }

/* Green replacements for the hardcoded blue rules in styles.css. */
.alert-info { background: var(--primary-dim); border-color: rgba(5, 150, 105, .3); color: #065f46; }
.tip { background: var(--primary-dim); border: 1px solid rgba(5, 150, 105, .28); }
.vpn-promo { border-color: rgba(5, 150, 105, .3); background: linear-gradient(180deg, rgba(5, 150, 105, .05), transparent); }
.price-card.featured { border-color: var(--primary); box-shadow: 0 8px 30px rgba(5, 150, 105, 0.14); }
.blog-tag { background: var(--primary-dim); color: var(--primary-hover); border: 1px solid rgba(5, 150, 105, 0.2); }
.admin-field input:focus { outline: 2px solid #047857; outline-offset: 1px; border-color: #047857; }
#f-body:focus { outline: 2px solid #047857; outline-offset: 1px; border-color: #047857; }
.cta-band { background: linear-gradient(135deg, #dcf5e5, #f3fbf6); }

/* Inline SVG icons in the HTML carry blue presentation attributes
   (hero shield, card icons, stepper icons). Recolour them green by CSS
   only — the HTML attributes are untouched. Green check-marks (#16a34a)
   are already green and are left alone. */
svg [stroke="#2563eb"] { stroke: #059669; }
svg [fill="rgba(37,99,235,.12)"] { fill: rgba(5, 150, 105, .12); }
svg [fill="rgba(37,99,235,.15)"] { fill: rgba(5, 150, 105, .15); }

/* Keyboard focus (always on, also helps accessibility). */
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid rgba(5, 150, 105, .45); outline-offset: 3px; border-radius: 6px; }

/* ---- Header / menu: underline slide (real selectors: .site-nav, .nav-dropbtn) ---- */
.site-nav a:not(.btn):not(.cta), .nav-dropbtn {
  position: relative; text-decoration: none; color: var(--muted); font-weight: 500;
  padding: 8px 12px; display: inline-block; transition: color .2s;
}
.site-nav a:not(.btn):not(.cta)::after, .nav-dropbtn::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px;
  background: var(--primary); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.site-nav a:not(.btn):not(.cta):hover, .nav-dropbtn:hover { color: var(--primary-dark); background: transparent; }
.site-nav a.active, .nav-dropbtn.active { color: var(--primary-dark); }
.site-nav a.active::after, .nav-dropbtn.active::after { transform: scaleX(1); }
.site-nav a:not(.btn):not(.cta):focus-visible::after, .nav-dropbtn:focus-visible::after { transform: scaleX(1); }
/* The header primary button (e.g. Scan link in the nav) keeps white text
   on green, and must not get the pale hover that .site-nav a:hover paints. */
.site-nav a.btn-primary { color: #fff; }
.site-nav a.btn-primary:hover { color: #fff; background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35); }
.site-nav a.btn-primary::after { display: none; }

/* ---- Blog dropdown (real selectors: .nav-dropdown / .nav-dropmenu) ---- */
.nav-dropdown { position: relative; }
.nav-dropmenu { position: absolute; top: 100%; left: 0; min-width: 190px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: 0 10px 28px rgba(6, 95, 70, .14);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s, transform .18s, visibility .18s; }
.nav-dropdown:focus-within .nav-dropmenu { opacity: 1; visibility: visible; transform: none; }
.nav-dropmenu a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); transition: background .15s, color .15s, padding .15s; }
.nav-dropmenu a::after { display: none; }
.nav-dropmenu a:focus-visible { background: var(--bg-2); color: var(--primary-dark); padding-left: 16px; }

/* ---- Footer: dark green, cream links, arrow slides in ---- */
.site-footer {
  --footer-bg: #06251a;
  --footer-ink: #f3fbf6;
  --footer-muted: #a9d9c2;
  --footer-accent: #34d399;
  --footer-line: rgba(255, 255, 255, 0.12);
  background: #06251a; color: #a9d9c2; border-top: 1px solid #06251a;
}
.site-footer .brand { color: #fff; }
.site-footer .brand b { color: #34d399; }
.site-footer .footer-brand p { color: #a9d9c2; }
.site-footer .footer-group { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.site-footer .footer-group .footer-group-title { color: #6ee7b7; }
.site-footer .footer-group a { color: #f3fbf6; }
.site-footer .footer-group a:hover, .site-footer .footer-group a:active { color: #fff; background: rgba(255, 255, 255, 0.06); }
.site-footer .footer-group a:focus-visible { padding-left: 22px;
  background: no-repeat left 4px center/12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6h8M6 2l4 4-4 4' fill='none' stroke='%2334d399' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.site-footer .footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); color: #a9d9c2; }
.site-footer .footer-brand a { color: #f3fbf6; }

/* ---- Mouse-only hovers (not applied on touch screens, so no sticky hover on phones) ---- */
@media (hover: hover) {
  .site-nav a:not(.btn):not(.cta):hover::after, .nav-dropbtn:hover::after { transform: scaleX(1); }
  .nav-dropdown:hover .nav-dropmenu { opacity: 1; visibility: visible; transform: none; }
  .nav-dropmenu a:hover { background: var(--bg-2); color: var(--primary-dark); padding-left: 16px; }
  .site-footer .footer-group a:hover { color: #fff; padding-left: 22px;
    background: no-repeat left 4px center/12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6h8M6 2l4 4-4 4' fill='none' stroke='%2334d399' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  .btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(5, 150, 105, .35); }
  .btn:not(.btn-primary):hover { background: var(--bg-2); border-color: var(--border); box-shadow: var(--shadow); }
  .card:hover, .feature:hover { border-color: var(--primary); box-shadow: 0 10px 24px rgba(5, 150, 105, .14); transform: translateY(-3px); }
  main :is(p, li, td) a:not(.btn):not(.cta):hover, article a:not(.btn):not(.cta):hover, .content a:not(.btn):not(.cta):hover {
    color: var(--primary-dark); text-decoration-color: var(--primary); }
}
button, .btn, .cta, .card, .feature { transition: background .2s, transform .2s, box-shadow .2s, border-color .2s; }
button:active, .btn:active { transform: none; box-shadow: none; }

/* ---- Content links: fade underline (inside page text only, not menu/footer/buttons) ---- */
main :is(p, li, td) a:not(.btn):not(.cta), article a:not(.btn):not(.cta), .content a:not(.btn):not(.cta) {
  color: var(--primary); font-weight: 600; text-decoration: underline;
  text-decoration-color: rgba(5, 150, 105, .3); text-underline-offset: 4px; text-decoration-thickness: 2px;
  transition: color .2s, text-decoration-color .2s; }
main :is(p, li, td) a:not(.btn):not(.cta):focus-visible, article a:not(.btn):not(.cta):focus-visible, .content a:not(.btn):not(.cta):focus-visible {
  color: var(--primary-dark); text-decoration-color: var(--primary); }

/* ---- Scan button states: press + "Scanning..." spinner + "Scan complete" ---- */
.btn-scan { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-scan:active { transform: scale(.97); box-shadow: none; }
.btn-scan.loading { pointer-events: none; background: var(--primary-hover); }
.btn-scan.loading::before { content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: ssx-spin .7s linear infinite; }
.btn-scan.done { pointer-events: none; background: var(--primary-dark); }
.btn-scan.error { pointer-events: none; background: var(--danger); }
.btn-scan:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
@keyframes ssx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-scan.loading::before { animation-duration: 2s; } }

/* Respect users who turn off animations. */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Mobile menu fix (max-width 720px) ----
   The theme rules above broke the mobile Blog dropdown in three ways:
   1. `.site-nav a` set dropdown links to inline-block, so All posts /
      Security guides / VPN guides flowed side-by-side in one row.
   2. `.nav-dropmenu` was position:absolute with opacity/visibility, which
      overrode the mobile static layout — the dropdown floated over the
      page text (and over the API Docs link below it).
   3. The `.open` class alone did not show the dropdown (only
      :hover / :focus-within did), so tapping Blog on touch was unreliable.
   These rules restore the stacked, in-flow mobile dropdown. */
@media (max-width: 720px) {
  .site-nav .nav-dropmenu {
    position: static; display: none; opacity: 1; visibility: visible;
    transform: none; min-width: 0; width: 100%;
    box-shadow: none; border: none; padding: 0 0 0 16px;
    background: transparent;
  }
  .site-nav .nav-dropdown.open .nav-dropmenu {
    display: block; opacity: 1; visibility: visible; transform: none;
  }
  /* On touch, tapping Blog toggles .open — focus alone must NOT keep the
     dropdown open after the user taps Blog again to close it. */
  .site-nav .nav-dropdown:not(.open) .nav-dropmenu { display: none; }
  .site-nav .nav-dropdown .nav-dropmenu a {
    display: block; width: 100%; padding: 9px 12px;
    white-space: normal;
  }
  .site-nav .nav-dropdown .nav-dropmenu a::after { display: none; }
  .site-nav .nav-dropbtn { width: 100%; text-align: left; }
}
