/* ============================================================
   PGB Natural Language Gym Search — Stylesheet v2
   Colours work on both light and dark page backgrounds.
   All text is explicitly set — no reliance on inherited colour.
   ============================================================ */

#pgb-nl-search-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 0 16px;
    color: #ffffff;  /* default text white for dark bg */
}

/* ── Search box ── */
.pgb-nl-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

#pgb-nl-search-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid #e5c158;
    border-radius: 6px;
    background: #1a1a1a;
    color: #ffffff;
    outline: none;
    transition: border-color .2s;
}
#pgb-nl-search-input::placeholder { color: #888; }
#pgb-nl-search-input:focus {
    border-color: #e5c158;
    box-shadow: 0 0 0 3px rgba(229,193,88,.25);
}

#pgb-nl-search-btn {
    padding: 14px 28px;
    background: #e5c158;
    color: #111;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
#pgb-nl-search-btn:hover  { background: #d4a820; }
#pgb-nl-search-btn:active { background: #ba8e0a; }

/* ── Example queries ── */
.pgb-nl-example-queries {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}
.pgb-nl-example {
    color: #e5c158;
    text-decoration: none;
    font-size: 12px;
    padding: 4px 10px;
    border: 1px solid rgba(229,193,88,.4);
    border-radius: 20px;
    transition: background .15s;
    flex-shrink: 0;
    white-space: nowrap;
    scroll-snap-align: start;
}
.pgb-nl-example:hover {
    background: rgba(229,193,88,.12);
    color: #fff;
}

/* ── Scrollbar styling for example queries ── */
.pgb-nl-example-queries::-webkit-scrollbar {
    height: 4px;
}
.pgb-nl-example-queries::-webkit-scrollbar-track {
    background: transparent;
}
.pgb-nl-example-queries::-webkit-scrollbar-thumb {
    background: rgba(229,193,88,.4);
    border-radius: 4px;
}
.pgb-nl-example-queries::-webkit-scrollbar-thumb:hover {
    background: rgba(229,193,88,.6);
}

/* ── Status line ── */
#pgb-nl-search-status {
    margin-bottom: 14px;
    padding: 10px 16px;
    background: rgba(255,255,255,.06);
    border-left: 4px solid #e5c158;
    border-radius: 4px;
    font-size: 14px;
    color: #ddd;
}
#pgb-nl-search-status.pgb-loading {
    border-left-color: #4a90d9;
    color: #90bfe8;
}
#pgb-nl-search-status.pgb-error {
    border-left-color: #e74c3c;
    color: #f08080;
    background: rgba(231,76,60,.12);
}

/* ── Parsed requirements box ── */
#pgb-nl-search-parsed {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: rgba(229,193,88,.08);
    border: 1px solid rgba(229,193,88,.35);
    border-radius: 6px;
    font-size: 13px;
    color: #eee;
}
#pgb-nl-search-parsed strong {
    display: block;
    margin-bottom: 8px;
    color: #e5c158;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
}
#pgb-nl-parsed-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
#pgb-nl-parsed-list li {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(229,193,88,.3);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 12px;
    color: #e5c158;
}

/* ── Results header ── */
.pgb-nl-results-header {
    font-size: 15px;
    color: #e0e0e0;          /* light grey — readable on dark bg */
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.pgb-nl-results-header strong { color: #ffffff; }

/* ── Result card ── */
.pgb-nl-result-card {
    display: flex;
    gap: 16px;
    padding: 18px;
    margin-bottom: 14px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    transition: border-color .2s, background .2s;
    color: inherit;
    cursor: pointer;   /* whole card opens the listing (see pgb-search.js) */
}
.pgb-nl-result-card:hover {
    border-color: #e5c158;
    background: rgba(229,193,88,.07);
}

.pgb-nl-card-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 6px;
    object-fit: cover;
    background: #2a2a2a;
}

.pgb-nl-card-body { flex: 1; min-width: 0; }

.pgb-nl-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px;
    line-height: 1.3;
}

.pgb-nl-card-location {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.pgb-nl-card-price {
    font-size: 13px;
    font-weight: 600;
    color: #e5c158;
    margin-bottom: 10px;
}

.pgb-nl-card-matches {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.pgb-match-chip {
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 20px;
    background: rgba(39,174,96,.2);
    color: #7dda9a;
    border: 1px solid rgba(39,174,96,.35);
    white-space: nowrap;
}
.pgb-missed-chip {
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 20px;
    background: rgba(230,126,34,.15);
    color: #f0a060;
    border: 1px solid rgba(230,126,34,.3);
    white-space: nowrap;
}

.pgb-nl-card-cta {
    flex-shrink: 0;
    align-self: center;
}

/* ── View button ───────────────────────────────────────────────────────────
   This button renders inside a WordPress theme plus WooCommerce / WCFM /
   Directorist and other PGB stylesheets, all of which style bare <a>,
   a:visited, a:hover, a:focus, ".entry-content a" and so on. The old rule
   (.pgb-nl-card-cta a) only set the base colour and had no :visited / :focus /
   :active state, so any of those theme rules could win and turn the text
   faint (e.g. gold or grey text on the gold button).

   Fix: one class, scoped by the wrapper ID, with EVERY link state declared
   explicitly. !important is limited to the properties themes are known to
   override (text colour, background, underline). Contrast (text #111):
     normal  #e5c158  10.9:1     hover/focus  #d4a820  8.5:1
     active  #ba8e0a   6.3:1     disabled     #b8b8b8  9.5:1   (WCAG AA needs 4.5:1)
   ------------------------------------------------------------------------ */
#pgb-nl-search-wrap a.pgb-nl-view-btn,
#pgb-nl-search-wrap a.pgb-nl-view-btn:link,
#pgb-nl-search-wrap a.pgb-nl-view-btn:visited {
    display: inline-block;
    box-sizing: border-box;
    margin: 0;
    padding: 9px 18px;
    border: 1px solid #e5c158;
    border-radius: 5px;
    background-color: #e5c158 !important;
    background-image: none !important;
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none !important;
    text-shadow: none;
    white-space: nowrap;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
#pgb-nl-search-wrap a.pgb-nl-view-btn:hover,
#pgb-nl-search-wrap a.pgb-nl-view-btn:focus {
    background-color: #d4a820 !important;
    border-color: #d4a820;
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
    text-decoration: none !important;
}
#pgb-nl-search-wrap a.pgb-nl-view-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}
#pgb-nl-search-wrap a.pgb-nl-view-btn:active {
    background-color: #ba8e0a !important;
    border-color: #ba8e0a;
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
}
#pgb-nl-search-wrap a.pgb-nl-view-btn[aria-disabled="true"],
#pgb-nl-search-wrap a.pgb-nl-view-btn.is-disabled {
    background-color: #b8b8b8 !important;
    border-color: #b8b8b8;
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
    cursor: not-allowed;
    pointer-events: none;
}
/* Themes sometimes add icons/arrows to links through ::before/::after.
   The arrow in "View →" is real text, so nothing generated is wanted here. */
#pgb-nl-search-wrap a.pgb-nl-view-btn::before,
#pgb-nl-search-wrap a.pgb-nl-view-btn::after {
    content: none !important;
    display: none !important;
}

/* ── No results ── */
.pgb-nl-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 15px;
}
.pgb-nl-no-results strong {
    display: block;
    font-size: 18px;
    color: #ccc;
    margin-bottom: 8px;
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .pgb-nl-search-box { flex-direction: column; }
    #pgb-nl-search-btn { width: 100%; }
    .pgb-nl-result-card { flex-direction: column; }
    .pgb-nl-card-thumb { width: 100%; height: 160px; }
    .pgb-nl-card-cta { align-self: flex-start; }
}

.pgb-correction-notice {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 4px;
    font-size: 0.95em;
    color: #333;
}

.pgb-correction-notice strong {
    color: #ff9800;
    font-weight: 600;
}