/*
Theme Name: ToolsGod Master
Author: ToolsGod Admin
Description: Custom SPA theme for ToolsGod.com.
Version: 1.0.0
*/

/* ── MODERN DESIGN TOKENS ── */
:root {
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e4e4e7;
  --border-subtle: #f4f4f5;
  --ink-main: #09090b;
  --ink-muted: #71717a;
  --ink-faint: #a1a1aa;
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-subtle: #d1fae5;
  --accent-text: #065f46;
  --ring: rgba(16, 185, 129, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="dark"] {
  --bg: #09090b;
  --card: #18181b;
  --border: #27272a;
  --border-subtle: #1f1f22;
  --ink-main: #f4f4f5;
  --ink-muted: #a1a1aa;
  --ink-faint: #52525b;
  --accent-subtle: #064e3b;
  --accent-text: #34d399;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink-main); font-size: 15px; line-height: 1.6; transition: background 0.2s, color 0.2s; }
textarea, input, select, button { font-family: var(--font); }
button { cursor: pointer; border: none; background: none; }
a { text-decoration: none; color: inherit; }

/* ── NAV ── */
.nav { height: 64px; background: var(--card); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; position: sticky; top: 0; z-index: 50; }
.nav-logo { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-main); display: flex; align-items: center; gap: 8px; margin-right: 32px; }
.logo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nl { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--ink-muted); padding: 8px 12px; border-radius: var(--radius-md); transition: all 0.15s; }
.nl i { font-size: 14px; opacity: 0.8; }
.nl:hover { color: var(--ink-main); background: var(--border-subtle); }
.nav-r { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.search-pill { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 12px; width: 260px; cursor: text; transition: border-color 0.2s; }
.search-pill:hover { border-color: var(--ink-faint); }
.search-pill i { color: var(--ink-muted); font-size: 16px; }
.search-pill span { font-size: 14px; color: var(--ink-muted); flex: 1; }
.search-pill kbd { font-size: 11px; background: var(--card); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; color: var(--ink-muted); font-family: var(--mono); }
.icon-btn { width: 38px; height: 38px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--ink-muted); transition: all 0.15s; border: 1px solid transparent; }
.icon-btn:hover { background: var(--border-subtle); color: var(--ink-main); border-color: var(--border); }

/* ── MEGA MENU DROPDOWN ── */
.has-dropdown { position: relative; display: flex; align-items: center; }
.cur-drop { cursor: pointer; }
.has-dropdown::before { content: ""; position: absolute; top: 100%; left: 0; width: 100%; height: 16px; z-index: 99; }
.mega-menu { position: absolute; top: calc(100% + 12px); left: 0; width: 500px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); z-index: 100; }
.has-dropdown:hover .mega-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.mm-link { font-size: 14px; font-weight: 500; color: var(--ink-muted); padding: 10px 14px; border-radius: var(--radius-md); transition: all 0.15s; display: block; }
.mm-link:hover { background: var(--accent-subtle); color: var(--accent-text); }

/* ── TOOL SHELL & HEADER ── */
.tool-shell { max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px; }
.bc { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-muted); margin-bottom: 24px; }
.bc span.cur { color: var(--ink-main); }
.bc-fav { margin-left: auto; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-md); color: var(--ink-muted); transition: all 0.15s; }
.bc-fav:hover { background: var(--border-subtle); color: var(--ink-main); }
.tool-hd { margin-bottom: 32px; }
h1.tool-title { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink-main); margin-bottom: 8px; }
.tool-desc { font-size: 16px; color: var(--ink-muted); max-width: 700px; line-height: 1.6; }

/* ── IO PANELS (INPUT / OUTPUT) ── */
.io-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 768px) { .io-wrap { grid-template-columns: 1fr; } }
.io-pane { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); overflow: hidden; transition: border-color 0.2s, box-shadow 0.2s; }
.io-pane:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.io-head { display: flex; align-items: center; padding: 12px 16px; background: rgba(0,0,0,0.01); border-bottom: 1px solid var(--border); gap: 8px; justify-content: space-between; }
[data-theme="dark"] .io-head { background: rgba(255,255,255,0.02); }
.io-lbl { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); }
.io-head-btns { display: flex; gap: 4px; }

/* ── BUTTONS ── */
.ihb { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-md); font-size: 13px; font-weight: 500; color: var(--ink-muted); transition: all 0.15s; }
.ihb:hover { background: var(--border); color: var(--ink-main); }
.ihb i { font-size: 15px; }
.run-btn { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; background: var(--ink-main); color: var(--bg); transition: transform 0.1s, opacity 0.2s; }
.run-btn:hover { opacity: 0.9; }
.run-btn:active { transform: scale(0.97); }

textarea.io-ta { flex: 1; border: none; resize: none; outline: none; padding: 20px; font-size: 15px; line-height: 1.7; color: var(--ink-main); background: transparent; min-height: 280px; font-family: var(--font); }
textarea.io-ta::placeholder { color: var(--ink-faint); }
.io-out-body { flex: 1; padding: 20px; font-size: 15px; color: var(--ink-main); line-height: 1.7; min-height: 280px; position: relative; }
.result-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--accent-text); background: var(--accent-subtle); border-radius: 6px; padding: 4px 10px; margin-bottom: 12px; }
.io-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(0,0,0,0.01); border-top: 1px solid var(--border); }
[data-theme="dark"] .io-foot { background: rgba(255,255,255,0.02); }
.io-stat { font-size: 12px; color: var(--ink-muted); }
.out-actions { padding: 16px; border-top: 1px solid var(--border); background: rgba(0,0,0,0.01); }
[data-theme="dark"] .out-actions { background: rgba(255,255,255,0.02); }
.oa-copy { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); transition: all 0.2s; }
.oa-copy:hover { background: var(--accent-hover); }
.oa-copy:active { transform: scale(0.98); }

/* Prevent WordPress from breaking the tool grid */
.io-wrap > p, .io-wrap > br { display: none !important; }

/* ── TOOLBAR STRIP ── */
.toolbar-strip { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.tb-btn { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; color: var(--ink-muted); border: 1px solid var(--border); background: var(--card); transition: all 0.2s; box-shadow: var(--shadow-sm); }
.tb-btn:hover { border-color: var(--ink-faint); color: var(--ink-main); }
.tb-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }

/* ── OPTIONS PANEL ── */
.opts-panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.opts-body { padding: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px 32px; }
.opt-row { display: flex; align-items: center; justify-content: space-between; }
.opt-lbl { font-size: 14px; font-weight: 500; color: var(--ink-main); }
.opt-sub { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.tog { width: 40px; height: 22px; border-radius: 12px; background: var(--border); position: relative; cursor: pointer; transition: background 0.2s; border: none; padding: 0; display: block; }
.tog.on { background: var(--accent); }
.tog-k { width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); position: absolute; top: 2px; left: 2px; transition: left 0.2s; pointer-events: none; display: block; }
.tog.on .tog-k { left: 20px; }
.opt-sel { font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px 12px; background: var(--bg); color: var(--ink-main); outline: none; cursor: pointer; }

/* ── SEO SECTION ── */
.seo-divider { display: flex; align-items: center; gap: 16px; margin: 48px 0; opacity: 0.7; }
.seo-div-line { flex: 1; height: 1px; background: var(--border); }
.seo-div-lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: var(--ink-muted); }
.seo-h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink-main); margin-bottom: 12px; margin-top: 32px; }
.seo-body { font-size: 16px; color: var(--ink-muted); line-height: 1.7; margin-bottom: 24px; }

/* ── FAQ ACCORDIONS ── */
.faq-container { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.faq-q { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px 20px; font-size: 15px; font-weight: 600; color: var(--ink-main); text-align: left; background: transparent; transition: background 0.15s; }
.faq-q:hover { background: var(--border-subtle); }
.faq-q i { font-size: 16px; color: var(--ink-muted); transition: transform 0.2s; }
.faq-q.open i { transform: rotate(180deg); color: var(--accent); }
.faq-a { padding: 0 20px 16px; font-size: 15px; color: var(--ink-muted); line-height: 1.7; display: none; }
.faq-a.show { display: block; }

/* ── RELATED TOOLS GRID ── */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 16px; }
.rel-card { display: flex; align-items: center; gap: 16px; padding: 24px 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; box-shadow: var(--shadow-sm); transition: all 0.2s; }
.rel-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.rel-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--accent-subtle); color: var(--accent-text); flex-shrink: 0; }
.rel-meta { display: flex; flex-direction: column; gap: 4px; }
.rel-name { font-size: 15px; font-weight: 600; color: var(--ink-main); transition: color 0.15s; }
.rel-card:hover .rel-name { color: var(--accent); }
.rel-desc { font-size: 13px; color: var(--ink-muted); line-height: 1.5; }

/* ── FOOTER ── */
.footer { background: var(--card); border-top: 1px solid var(--border); padding: 64px 24px 32px; margin-top: 32px; }
.ft-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 64px; }
@media (max-width: 768px) { .ft-grid { grid-template-columns: 1fr 1fr; gap: 40px; } }
@media (max-width: 480px) { .ft-grid { grid-template-columns: 1fr; } }
.ft-brand { margin-bottom: 16px; }
.ft-desc { font-size: 14px; color: var(--ink-muted); line-height: 1.6; margin-bottom: 24px; max-width: 280px; }
.ft-socials { display: flex; gap: 12px; }
.ft-social { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--border-subtle); display: flex; align-items: center; justify-content: center; color: var(--ink-muted); transition: all 0.2s; }
.ft-social:hover { background: var(--accent); color: #fff; }
.ft-col-title { font-size: 14px; font-weight: 600; color: var(--ink-main); margin-bottom: 20px; }
.ft-links { display: flex; flex-direction: column; gap: 12px; }
.ft-link { font-size: 14px; color: var(--ink-muted); transition: color 0.15s; }
.ft-link:hover { color: var(--accent); }
.ft-bottom { max-width: 1200px; margin: 0 auto; padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-muted); flex-wrap: wrap; gap: 16px; }
.ft-status { display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ── SEARCH MODAL OVERLAY ── */
.search-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 100; align-items: flex-start; justify-content: center; padding-top: 12vh; opacity: 0; transition: opacity 0.2s; }
.search-modal.active { display: flex; opacity: 1; }
.search-modal-content { background: var(--card); width: 100%; max-width: 550px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); border: 1px solid var(--border); overflow: hidden; transform: translateY(-20px); transition: transform 0.2s; }
.search-modal.active .search-modal-content { transform: translateY(0); }
.search-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px; }
.search-head i { font-size: 20px; color: var(--ink-muted); }
.search-head input { flex: 1; border: none; outline: none; background: transparent; font-size: 16px; color: var(--ink-main); font-family: var(--font); }
.search-head kbd { font-size: 11px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; color: var(--ink-muted); font-family: var(--mono); cursor: pointer; }

/* ── LIVE SEARCH RESULTS BOX ── */
.search-results-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 8px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
  display: none;
}
.search-res-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}
.search-res-item:last-child {
  border-bottom: none;
}
.search-res-item:hover {
  background: var(--border-subtle);
}
.search-res-item i {
  font-size: 18px;
  color: var(--ink-muted);
  transition: color 0.15s;
}
.search-res-item:hover i {
  color: var(--accent);
}
.sr-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-main);
}
.sr-cat {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.sr-empty {
  padding: 16px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
}

/* ── MODERN HOMEPAGE ENRICHMENTS ── */
.hero-wrapper {
  position: relative;
  z-index: 1;
}

/* Ambient Background Glow */
.ambient-glow {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(46, 160, 67, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Interactive Glass Demo (Theme Friendly) */
.glass-demo {
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  text-align: left;
  margin: 40px auto 0;
  max-width: 800px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-demo:hover {
  border-color: var(--border-subtle);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

.demo-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.demo-io {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink-main);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: monospace;
  font-size: 14px;
  resize: none;
}

.demo-io:focus {
  outline: none;
  border-color: var(--accent);
}

/* Bento Box Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.bento-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-subtle);
}

.bento-large {
  grid-column: span 2;
  background: linear-gradient(145deg, var(--card) 0%, rgba(46, 160, 67, 0.03) 100%);
}

@media (max-width: 900px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-large { grid-column: span 1; }
}
/* ── CARD FAVORITE BUTTON ── */
.card-fav-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--ink-muted);
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

/* Show on card hover */
.rel-card:hover .card-fav-btn {
  opacity: 1;
  transform: translateY(0);
}

/* Hovering the heart itself */
.card-fav-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

/* Active (Favorited) State */
.card-fav-btn.is-fav {
  opacity: 1;
  transform: translateY(0);
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-subtle);
}

/* ── REFINED STICKY NAV ── */
.sticky-nav {
  position: sticky;
  top: 0;
  background: var(--bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  margin-bottom: 40px; 
  z-index: 100;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.sticky-nav::-webkit-scrollbar { display: none; } 

.nav-scroll { 
  display: flex; 
  gap: 12px; 
  align-items: center; 
}

.nav-item { 
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  background: var(--card); 
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-item:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-subtle);
}

/* ── BULLETPROOF INVISIBLE DROP ZONE ── */
textarea#mockInput.dragover-active {
  border: 2px dashed var(--accent) !important; 
  background-color: var(--ring) !important;
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 20px var(--ring) !important;
  color: var(--accent) !important;
  transition: all 0.2s ease-in-out;
}

textarea#mockInput {
  transition: all 0.2s ease-in-out;
}

/* ── MOBILE RESPONSIVENESS ── */
.mobile-menu-btn {
  display: none; /* Hidden on desktop */
}

@media (max-width: 768px) {
  .nav {
    padding: 0 16px;
  }
  
  /* Show the hamburger icon */
  .mobile-menu-btn {
    display: flex;
    margin-left: 4px;
  }
  
  /* Convert the horizontal nav into a mobile dropdown overlay */
  .nav-links {
    position: fixed;
    top: 64px; /* Starts exactly below the header */
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 24px 16px;
    gap: 12px;
    z-index: 40;
    display: none; /* Hidden until clicked */
    overflow-y: auto;
  }
  
  .nav-links.active {
    display: flex;
    animation: slideDown 0.2s ease-out forwards;
  }
  
  /* Make the links big and tappable for fingers */
  .nl {
    padding: 16px;
    font-size: 16px;
    border-radius: var(--radius-lg);
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
  }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* FORCE MOBILE MENU TO WORK */
.mobile-menu-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex !important;
  }
  
  #mobileNav.active {
    display: flex !important;
    position: fixed !important;
    top: 64px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: var(--card) !important;
    flex-direction: column !important;
    padding: 20px !important;
    z-index: 9999 !important;
  }
}