/* ============================================================
   WordFindLab — Shared Stylesheet
   Clean light theme, minimal, tool-focused
============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg:        #f4f6f9;
  --surface:   #ffffff;
  --border:    #e2e6ed;
  --ink:       #1a1d2e;
  --ink-2:     #4a5068;
  --muted:     #8891a8;
  --accent:    #2563eb;
  --accent-h:  #1d4ed8;
  --accent-2:  #059669;
  --warn:      #d97706;
  --danger:    #dc2626;
  --good:      #059669;
  --nav-bg:    #1a1d2e;
  --nav-ink:   #c8cde0;
  --nav-active:#ffffff;
  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- Nav ---------- */
.site-nav {
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }

.nav-logo {
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  white-space: nowrap;
  padding: 15px 16px 15px 0;
  margin-right: 8px;
  text-decoration: none;
  letter-spacing: -.3px;
  border-right: 1px solid rgba(255,255,255,.12);
}
.nav-logo:hover { color: #fff; text-decoration: none; }

.nav-links { display: flex; }
.nav-links a {
  color: var(--nav-ink);
  font-size: 13.5px;
  font-weight: 500;
  padding: 15px 13px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-links a.active { color: #fff; border-bottom-color: var(--accent); }

/* ---------- Page shell ---------- */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto;
  gap: 24px;
  align-items: start;
}
.page-main { min-width: 0; }
.page-sidebar { min-width: 0; }

/* ---------- Page header ---------- */
.page-header {
  margin-bottom: 16px;
}
.page-header h1 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--ink);
  letter-spacing: -.5px;
}
.page-header p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14.5px;
}

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card:last-child { margin-bottom: 0; }

/* ---------- Forms ---------- */
label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--ink);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
select option { background: var(--surface); }

.input-letters {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-align: center;
  padding: 14px 16px;
  background: #f8faff;
  border-color: #c7d2fe;
}
.input-letters:focus {
  background: var(--surface);
  border-color: var(--accent);
}

.row { display: flex; flex-wrap: wrap; gap: 10px; }
.col { flex: 1 1 140px; }

/* ---------- Advanced filters ---------- */
details.advanced {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 2px;
}
details.advanced summary {
  cursor: pointer;
  color: var(--accent);
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
  user-select: none;
}
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary::before { content: "▸ "; font-size: 10px; }
details.advanced[open] summary::before { content: "▾ "; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  transition: background .15s, transform .05s;
  letter-spacing: .01em;
}
.btn:hover  { background: var(--accent-h); }
.btn:active { transform: translateY(1px); }

.btn.ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--ink-2);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn.green {
  background: var(--accent-2);
}
.btn.green:hover { background: #047857; }

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  align-items: center;
}
.hint { font-size: 12.5px; color: var(--muted); }

/* ---------- Status ---------- */
.status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}
.status.good  { color: var(--good); }
.status.warn  { color: var(--warn); }
.status.error { color: var(--danger); }

/* ---------- Results header ---------- */
.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.results-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.meta { color: var(--muted); font-size: 13px; }

/* ---------- Word groups ---------- */
.group { margin-bottom: 20px; }
.group:last-child { margin-bottom: 0; }
.group h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.group h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.words { display: flex; flex-wrap: wrap; gap: 6px; }

.word {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--ink);
  transition: border-color .12s, background .12s, transform .1s;
  user-select: none;
}
.word:hover {
  border-color: var(--accent);
  background: #eff6ff;
  color: var(--accent);
  transform: translateY(-1px);
}
.word .pts {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0;
  background: var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}
.word .pts-high { background: #fef3c7; color: var(--warn); }

.empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Loader ---------- */
.loader {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: middle;
  margin-right: 5px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sidebar ---------- */
.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin-bottom: 16px;
}
.ad-slot-banner  { height: 90px; }
.ad-slot-rect    { height: 250px; }
.ad-slot-sidebar { height: 600px; }

/* ---------- Tool links widget ---------- */
.tools-widget .tools-widget-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 10px;
}
.tools-widget-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tools-widget-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.tools-widget-links a:hover { background: #eff6ff; color: var(--accent); text-decoration: none; }
.tools-widget-links a.active { background: #eff6ff; color: var(--accent); font-weight: 700; }
.tools-widget-links a .ico { font-size: 16px; width: 22px; text-align: center; }

/* ---------- SEO content ---------- */
.seo-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.75;
}
.seo-section h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}
.seo-section h2:not(:first-child) { margin-top: 20px; }
.seo-section p { margin: 0 0 10px; }
.seo-section ul { padding-left: 18px; margin: 0 0 10px; }
.seo-section li { margin-bottom: 4px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--nav-bg);
  color: #8891a8;
  font-size: 13px;
  padding: 32px 20px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 16px;
}
.footer-links a { color: #8891a8; }
.footer-links a:hover { color: #fff; }
.footer-copy { color: #555d7a; font-size: 12px; }

/* ---------- Wordle grid ---------- */
.clue-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.clue-row { display: flex; gap: 8px; align-items: flex-start; }
.clue-row-label {
  font-size: 11px; color: var(--muted); width: 52px;
  flex-shrink: 0; padding-top: 14px; text-align: right; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
}
.clue-cells { display: flex; gap: 8px; }
.clue-cell-wrap { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.clue-input {
  width: 50px; height: 50px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 22px; font-weight: 800;
  text-align: center; text-transform: uppercase;
  color: var(--ink); outline: none;
  transition: border-color .12s, background .12s;
}
.clue-input:focus { border-color: var(--accent); background: var(--surface); }
.clue-input.green  { border-color: #16a34a; background: #dcfce7; color: #15803d; }
.clue-input.yellow { border-color: #d97706; background: #fef3c7; color: #b45309; }
.clue-input.gray   { border-color: #9ca3af; background: #f3f4f6; color: #6b7280; }
.state-bar { display: flex; gap: 3px; }
.state-dot {
  width: 14px; height: 14px; border-radius: 3px; cursor: pointer;
  border: 1px solid var(--border); transition: transform .1s;
}
.state-dot:hover { transform: scale(1.2); }
.state-dot.green-dot  { background: #16a34a; border-color: #16a34a; }
.state-dot.yellow-dot { background: #d97706; border-color: #d97706; }
.state-dot.gray-dot   { background: #9ca3af; border-color: #9ca3af; }
.state-dot.active-dot { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .page-wrap {
    grid-template-columns: 1fr;
  }
  .page-sidebar {
    display: none; /* hide sidebar on mobile — show inline ad slots instead */
  }
}
@media (max-width: 600px) {
  .page-wrap { padding: 14px 14px 30px; gap: 14px; }
  .card { padding: 14px; }
  .input-letters { font-size: 20px; letter-spacing: .1em; }
  .page-header h1 { font-size: 22px; }
}
