/* ── WasteWhere Module Styles ─────────────────────────────────────────────
   Restored to WasteWhere's own original visual identity. Source of truth:
   the ported React/Tailwind build this module was completed from
   (WasteWhere_Full_Project_All_Folders/wastewhere-full-project/client/src,
   see client/src/index.css), whose top comment names the design contract
   in words: "tactile New Civic Design — porcelain paper, forest cartography,
   lime for verified action." That is: a warm porcelain-paper background,
   deep forest-green ink for text and dark panels, a high-contrast lime-green
   accent reserved for verified/primary actions, cream-white card surfaces,
   and a civic-cartography vocabulary of hard offset shadows, flush-edged
   buttons and dashed "route line" details. Headings/buttons use Manrope;
   body copy uses Source Sans 3.

   An earlier build pass ("2026-08-27 identity unification") deliberately
   stripped all of this out and made the module fall back to bimbly.eu's
   generic site-wide purple (--brand:#7657ff / --brand2:#9a7dff). That is
   reverted here — WasteWhere gets its own palette back.

   How it's scoped: the palette lives in its own --ww-* custom properties
   (below) so nothing here ever redefines bimbly's shared --brand/--text/
   --muted/etc. at :root — that would leak into the shared site-wide
   header/nav/footer. Instead, the shared token *names* are re-pointed to
   WasteWhere's palette only inside <main> (the shared _shared/header.php
   opens <main> right before this module's own account bar renders, and
   _shared/footer.php closes it right after this module's own pre-footer —
   so on every waste-where page, <main> contains only this module's own
   content; the shared header, nav and footer all render outside it). That
   single scoped block is what makes shared bimbly.css classes reused here
   (.eyebrow, .section, .hero-section, breadcrumbs, etc.) automatically pick
   up WasteWhere's colors instead of bimbly purple, without touching those
   files.

   Class names for this module's own components keep their existing ww-
   prefix to avoid colliding with other modules.
   ─────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@700;800&family=Source+Sans+3:wght@400;600;700;800&display=swap');

:root {
  --ww-ink: #173d34;
  --ww-ink-deep: #0f2d26;
  --ww-muted: #5a6d65;
  --ww-paper: #f4f1e8;
  --ww-card: #fffdf7;
  --ww-surface2: #e7ebdd;
  --ww-surface-soft: #f5f8f2;
  --ww-line: #d5d5c8;
  --ww-lime: #c8f244;
  --ww-lime-dark: #b6e538;
  --ww-lime-soft: #e4f2b4;
  --ww-destructive: #b44836;
  --ww-font-display: "Manrope", Arial, sans-serif;
  --ww-font-sans: "Source Sans 3", Arial, sans-serif;
  --ww-radius: 3px;
  --ww-shadow: 4px 4px 0 rgba(23, 61, 52, .1);
}

/* Re-point the shared bimbly tokens to WasteWhere's own palette, scoped to
   <main> only — the shared site-header/nav/footer live outside <main> on
   every waste-where page and are completely unaffected by this. */
main {
  --brand: var(--ww-ink);
  --brand2: var(--ww-ink-deep);
  --text: var(--ww-ink);
  --muted: var(--ww-muted);
  --surface: var(--ww-card);
  --surface2: var(--ww-surface2);
  --surface-soft: var(--ww-surface-soft);
  --line: var(--ww-line);
  --bg: var(--ww-paper);
  --radius: var(--ww-radius);
  --shadow: var(--ww-shadow);
  background: var(--ww-paper);
  font-family: var(--ww-font-sans);
  color: var(--ww-ink);
}
main h1, main h2, main h3, main h4 { font-family: var(--ww-font-display); font-weight: 800; letter-spacing: -.03em; }
main :focus-visible { outline: 3px solid var(--ww-lime); outline-offset: 3px; }

/* ── Hero (index.php) ─────────────────────────────────────────────────────── */
.ww-hero-section { padding: clamp(36px, 6vw, 64px) 0 clamp(28px, 5vw, 48px); }
.ww-hero-section .hero-content { max-width: 640px; }
.ww-hero-section h1 {
  margin: 14px 0 0; font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1;
  letter-spacing: -.04em; color: var(--ww-ink);
}
.ww-hero-section .hero-copy { margin: 16px 0 0; color: var(--ww-muted); font-size: 1.08rem; line-height: 1.55; }

/* ── Account bar ──────────────────────────────────────────────────────────── */

/* ── Cards / lists ────────────────────────────────────────────────────────── */
.ww-card {
  background: var(--surface, var(--ww-card)); border: 1px solid var(--line, var(--ww-line));
  border-radius: var(--ww-radius); padding: 20px 22px; margin-bottom: 18px;
  box-shadow: 2px 2px 0 rgba(23, 61, 52, .06);
}
.ww-card-title {
  font-family: var(--ww-font-display); font-weight: 800; font-size: 1.05rem;
  margin-bottom: 10px; color: var(--ww-ink);
}

.ww-result-row {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 0;
  border-bottom: 1px solid var(--line, var(--ww-line));
}
.ww-result-row:last-child { border-bottom: none; }
.ww-result-row-body { flex: 1; min-width: 0; }
.ww-result-row-title { font-family: var(--ww-font-display); font-weight: 700; font-size: 1.02rem; color: var(--text, var(--ww-ink)); margin: 0 0 4px; letter-spacing: -.01em; }
.ww-result-row-meta { font-size: .82rem; color: var(--muted, var(--ww-muted)); margin-top: 6px; line-height: 1.6; }
.ww-result-row-meta strong { color: var(--text, var(--ww-ink)); font-weight: 700; }

.ww-badge {
  display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border-radius: 50%; font-size: .82rem; color: var(--ww-ink); background: var(--ww-lime);
  border: 1px solid var(--ww-ink); flex: none;
}
.ww-badge-status {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem;
  font-weight: 800; letter-spacing: .01em; background: var(--surface2, var(--ww-surface2)); color: var(--text, var(--ww-ink));
}
.ww-badge-status.is-draft     { background: #e3ded1; color: #4c4d47; }
.ww-badge-status.is-review    { background: #f3e6c8; color: #74551c; }
.ww-badge-status.is-published { background: var(--ww-lime); color: var(--ww-ink); }
.ww-badge-status.is-archived  { background: #ece9df; color: #8b9690; }

/* ── Search form ──────────────────────────────────────────────────────────── */
.ww-search-form {
  display: flex; gap: 0; flex-wrap: wrap; margin: 18px 0;
  border: 1px solid var(--line, var(--ww-line)); background: var(--surface, var(--ww-card));
  box-shadow: 0 12px 26px rgba(23, 61, 52, .08);
}
.ww-search-input, .ww-select, .ww-input, .ww-textarea {
  border: 1px solid var(--line, var(--ww-line)); border-radius: var(--ww-radius); padding: 12px 16px;
  font-size: 1rem; background: var(--surface, var(--ww-card)); color: var(--text, var(--ww-ink));
  font-family: inherit;
}
.ww-search-form .ww-search-input {
  border: 0; border-right: 1px solid var(--line, var(--ww-line)); border-radius: 0;
  background: transparent;
}
.ww-search-form .ww-search-input:last-of-type { border-right: 0; }
.ww-textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 110px; }
.ww-search-input { flex: 1 1 220px; }
.ww-search-form .ww-btn { border-radius: 0; }
.ww-input:focus, .ww-select:focus, .ww-textarea:focus, .ww-search-input:focus {
  outline: none; border-color: var(--ww-ink); box-shadow: 0 0 0 3px rgba(200, 242, 68, .45);
}

.ww-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--ww-radius); padding: 12px 20px; font-weight: 800; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; font-size: .92rem; font-family: var(--ww-font-display);
  transition: background .16s ease, border-color .16s ease, transform .1s ease;
}
.ww-btn:active { transform: scale(.98); }
.ww-btn-primary { background: var(--ww-lime); color: var(--ww-ink); }
.ww-btn-primary:hover { background: var(--ww-lime-dark); }
.ww-btn-primary:disabled { opacity: .5; cursor: not-allowed; background: var(--ww-lime); }
.ww-btn-ghost { background: transparent; border-color: var(--line, var(--ww-line)); color: var(--text, var(--ww-ink)); }
.ww-btn-ghost:hover { border-color: var(--ww-ink); background: var(--ww-lime-soft); }
.ww-btn-danger { background: var(--ww-destructive); color: #fffdf7; }
.ww-btn-danger:hover { background: #9c3c2c; }
.ww-btn-sm { padding: 8px 14px; font-size: .8rem; }
.ww-btn-full { width: 100%; }

/* ── Pricing ──────────────────────────────────────────────────────────────── */
.ww-plans { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 24px 0; }
.ww-plan-card {
  border: 1px solid var(--ww-ink); border-radius: var(--ww-radius);
  padding: 26px 24px; background: var(--surface, var(--ww-card));
  box-shadow: 5px 5px 0 var(--ww-ink);
}
.ww-plan-card h3 { margin: 0 0 8px; font-family: var(--ww-font-display); letter-spacing: -.02em; }
.ww-plan-card .ww-plan-price { font-family: var(--ww-font-display); font-size: 1.6rem; font-weight: 800; margin: 6px 0 14px; }
.ww-plan-card .ww-plan-price small { font-size: .8rem; font-weight: 500; color: var(--muted, var(--ww-muted)); }
.ww-plan-card ul { padding-left: 18px; margin: 14px 0; color: var(--muted, var(--ww-muted)); font-size: .9rem; line-height: 1.7; }
.ww-plan-card ul li::marker { color: var(--ww-lime-dark); }

/* ── Alerts / forms ───────────────────────────────────────────────────────── */
.ww-alert { border-radius: var(--ww-radius); padding: 13px 16px; font-size: .88rem; margin: 14px 0; }
.ww-alert-danger  { background: #fff4ef; color: #843d2b; border: 1px solid #c99e8e; }
.ww-alert-success { background: #dcefcf; color: #264d3d; border: 1px solid #b9dfc0; }
.ww-alert-info    { background: var(--surface-soft, var(--ww-surface-soft)); color: #315b4d; border: 1px solid #b9c8b9; }
.ww-form-field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.ww-form-field label { font-weight: 700; font-size: .88rem; color: var(--ww-ink); }
.ww-auth-card { max-width: 420px; margin: 0 auto; }
.ww-disclaimer {
  background: var(--surface-soft, var(--ww-surface-soft)); border: 1px solid var(--line, var(--ww-line));
  border-radius: var(--ww-radius); padding: 14px 18px; font-size: .85rem;
  color: var(--muted, var(--ww-muted)); margin: 20px 0;
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.ww-pagination { display: flex; justify-content: space-between; align-items: center; margin: 24px 0; gap: 12px; }

/* ── Manage (editorial) area ──────────────────────────────────────────────── */
.ww-manage-shell { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.ww-manage-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 16px; }
.ww-manage-nav a {
  display: block; padding: 9px 14px; border-radius: var(--ww-radius); text-decoration: none;
  color: var(--text, var(--ww-ink)); font-size: .9rem; font-weight: 700;
  border-left: 2px solid transparent;
}
.ww-manage-nav a:hover, .ww-manage-nav a.is-active { background: var(--ww-lime-soft); border-left-color: var(--ww-ink); }
.ww-stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 20px; }
.ww-stat-card { border: 1px solid var(--line, var(--ww-line)); border-radius: var(--ww-radius); padding: 16px 18px; background: var(--surface, var(--ww-card)); }
.ww-stat-value { font-family: var(--ww-font-display); font-size: 1.8rem; font-weight: 800; color: var(--ww-ink); }
.ww-stat-label { font-size: .76rem; color: var(--muted, var(--ww-muted)); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.ww-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ww-table th, .ww-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line, var(--ww-line)); vertical-align: top; }
.ww-table th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--muted, var(--ww-muted)); border-bottom: 1px solid var(--ww-ink); }
.ww-table tbody tr:hover { background: var(--ww-lime-soft); }
.ww-table-wrap { overflow-x: auto; margin-bottom: 20px; border: 1px solid var(--line, var(--ww-line)); }
.ww-table-wrap .ww-table { border: 0; }
.ww-inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .ww-manage-shell { grid-template-columns: 1fr; }
  .ww-manage-nav { flex-direction: row; flex-wrap: wrap; position: static; }
}

/* ── Toggle switch (smooth transition) ───────────────────────────────────── */
.ww-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.ww-switch input { opacity: 0; width: 0; height: 0; }
.ww-switch-track {
  position: absolute; inset: 0; background: var(--ww-line); border-radius: 999px;
  cursor: pointer; transition: background-color .2s ease;
}
.ww-switch-track::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(23, 61, 52, .3);
  transition: transform .2s ease;
}
.ww-switch input:checked + .ww-switch-track { background: var(--ww-lime); }
.ww-switch input:checked + .ww-switch-track::before { background: var(--ww-ink); transform: translateX(18px); }
.ww-switch input:focus-visible + .ww-switch-track { outline: 3px solid var(--ww-lime); outline-offset: 2px; }

/* ── Preloader ────────────────────────────────────────────────────────────── */
.ww-spinner {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  animation: ww-spin .7s linear infinite; vertical-align: -3px; margin-right: 8px;
}
.ww-spinner.is-dark { border-color: rgba(23, 61, 52, .2); border-top-color: var(--ww-ink); }
@keyframes ww-spin { to { transform: rotate(360deg); } }
.ww-btn.is-loading { pointer-events: none; opacity: .85; }
.ww-btn.is-loading .ww-btn-label { opacity: .85; }

/* ── Pre-footer CTA / trust band ──────────────────────────────────────────── */
.ww-prefooter {
  background: var(--ww-ink); color: #f4f1e8; padding: 36px 24px; margin-top: 40px;
  border-top: 3px solid var(--ww-lime);
}
.ww-prefooter-inner {
  max-width: 1000px; margin: 0 auto; display: flex; align-items: center;
  justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.ww-prefooter h2 { margin: 0 0 6px; font-family: var(--ww-font-display); font-size: 1.3rem; letter-spacing: -.02em; }
.ww-prefooter p { margin: 0; color: #c0d0c8; font-size: .92rem; }
.ww-prefooter .ww-btn-primary { background: var(--ww-lime); color: var(--ww-ink); }
.ww-prefooter .ww-btn-primary:hover { background: var(--ww-lime-dark); }

/* ── Mobile responsiveness ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .ww-search-form { flex-direction: column; }
  .ww-search-form .ww-search-input { border-right: 0; border-bottom: 1px solid var(--line, var(--ww-line)); }
  .ww-search-input, .ww-select, .ww-btn { width: 100%; }
  .ww-plans { grid-template-columns: 1fr; }
  .ww-prefooter-inner { flex-direction: column; text-align: center; }
  .ww-card, .ww-plan-card { padding: 16px; }
}

/* RTL */
[dir="rtl"] .ww-result-row-meta { text-align: right; }
[dir="rtl"] .ww-switch input:checked + .ww-switch-track::before { transform: translateX(-18px); }
