/* ============================================
   Norvio Data Search — Frontend Styles v5.3.11
   Polished result UI, no search/extractor changes.
   ============================================ */

.norvio-search-widget {
    max-width: 940px;
    margin: 0 auto;
    padding: 0 18px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #17172f;
    line-height: 1.6;
}

.nds-search-header {
    text-align: center;
    margin-bottom: 26px;
}

.nds-search-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 8px 0;
    color: #17172f;
}

.nds-search-subtitle {
    font-size: 14px;
    color: #7b8491;
    margin: 0 auto;
    max-width: 680px;
}

.nds-search-form {
    margin: 0 auto 12px;
}

.nds-input-group {
    display: flex;
    align-items: center;
    min-height: 54px;
    background: #fff;
    border: 1px solid #dbe3ea;
    border-radius: 15px;
    padding: 5px 6px 5px 17px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 7px 22px rgba(15, 23, 42, 0.055);
}

.nds-input-group:focus-within {
    border-color: #0f9f73;
    box-shadow: 0 0 0 4px rgba(15, 159, 115, 0.12), 0 8px 24px rgba(15, 23, 42, 0.07);
}

.nds-search-icon {
    flex-shrink: 0;
    color: #7a8794;
    margin-right: 12px;
}

.nds-input-group:focus-within .nds-search-icon {
    color: #0f9f73;
}

.nds-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 12px 0;
    background: transparent;
    color: #17172f;
    font-family: inherit;
}

.nds-search-input::placeholder {
    color: #98a2ad;
}

.nds-search-button {
    flex-shrink: 0;
    background: #2878ee;
    color: #fff;
    border: none;
    border-radius: 11px;
    padding: 12px 26px;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    transition: background 0.16s ease, transform 0.16s ease;
    font-family: inherit;
    white-space: nowrap;
}

.nds-search-button:hover { background: #1f67d4; }
.nds-search-button:active { transform: translateY(1px); }
.nds-search-button.nds-loading { opacity: 0.7; pointer-events: none; }

.nds-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 12px 0 18px;
}

.nds-filter-btn {
    background: #f2f7f5;
    color: #485563;
    border: 1px solid #dfe9e5;
    border-radius: 999px;
    padding: 7px 15px;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
}

.nds-filter-btn:hover {
    background: #e8f3ef;
    color: #172b25;
    border-color: #c7ded5;
}

.nds-filter-btn.nds-filter-active {
    background: #17172f;
    color: #fff;
    border-color: #17172f;
}


.nds-advanced-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    margin: 0 0 18px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid #dfe9e5;
    border-radius: 15px;
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.035);
}

.nds-advanced-filters label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    font-size: 11px;
    font-weight: 800;
    color: #687481;
    letter-spacing: 0.01em;
}

.nds-select-filter {
    width: 100%;
    min-height: 40px;
    border: 1px solid #d4dfda;
    border-radius: 11px;
    background: #fff;
    color: #172b25;
    font-size: 13px;
    font-weight: 650;
    padding: 8px 10px;
    font-family: inherit;
    outline: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.025);
}

.nds-select-filter:focus {
    border-color: #0f9f73;
    box-shadow: 0 0 0 3px rgba(15, 159, 115, 0.12);
}

.nds-search-status {
    display: none;
    margin: 8px 0 14px;
    padding: 9px 12px;
    border-radius: 12px;
    background: #f7faf9;
    color: #5b6673;
    font-size: 13px;
    font-weight: 650;
    text-align: left;
    border: 1px solid #edf2f0;
}

.nds-search-status.nds-status-no-results {
    text-align: center;
    color: #8a94a1;
    font-style: italic;
    background: transparent;
    border-color: transparent;
}

.nds-results {
    margin-top: 8px;
}

.nds-result-card {
    background: #fff;
    border: 1px solid #e4ece8;
    border-left: 4px solid #cbd5e1;
    border-radius: 16px;
    padding: 17px 20px 15px;
    margin-bottom: 13px;
    transition: box-shadow 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
    animation: ndsFadeIn 0.22s ease;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.nds-result-card:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.075);
    transform: translateY(-1px);
}

.nds-result-strong {
    border-left-color: #0f9f73;
    background: linear-gradient(135deg, #f7fffb 0%, #fff 38%);
}

.nds-result-relevant {
    border-left-color: #2f77e8;
    background: linear-gradient(135deg, #f6f9ff 0%, #fff 38%);
}

@keyframes ndsFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.nds-result-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.nds-result-head-left {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.nds-result-head-right {
    flex-shrink: 0;
}

.nds-strong-label,
.nds-intent-label,
.nds-synonym-label,
.nds-topic-label {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 750;
    letter-spacing: 0.015em;
    margin: 0;
}

.nds-strong-label {
    background: #e7f8f1;
    color: #087453;
    border: 1px solid #bdebdc;
}

.nds-intent-label {
    background: #eaf2ff;
    color: #245fbd;
    border: 1px solid #cfe0ff;
}

.nds-synonym-label {
    background: #f3f4f6;
    color: #697586;
    border: 1px solid #e5e7eb;
}

.nds-quality-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: #f5f7f8;
    border: 1px solid #e5eaf0;
}

.nds-result-section-title {
    font-size: 12px;
    color: #8a94a1;
    font-weight: 600;
    margin: -1px 0 6px;
}

.nds-result-sentence {
    font-size: 15.5px;
    line-height: 1.62;
    color: #1d2433;
    margin: 0 0 12px;
    word-break: normal;
    overflow-wrap: anywhere;
}

.nds-result-sentence mark {
    background: #fff2a8;
    color: inherit;
    border-radius: 4px;
    padding: 0 3px;
}

.nds-hl-pct {
    color: #087453;
    font-weight: 800;
}

.nds-hl-eur {
    color: #a65f00;
    font-weight: 750;
}

.nds-hl-trend {
    color: #245fbd;
    font-weight: 750;
}

.nds-result-context,
.nds-result-trust,
.nds-result-concepts {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 8px;
}

.nds-result-metric-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 13px;
}

.nds-metric-chip {
    display: inline-flex;
    align-items: center;
    background: #f0fbf7;
    color: #087453;
    font-size: 12px;
    font-weight: 750;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #cdeee1;
    line-height: 1.25;
}

.nds-metric-chip.nds-chip-overflow {
    background: #f4f6f8;
    color: #667085;
    border-color: #e4e7ec;
    font-weight: 650;
}

.nds-result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #eef2f0;
    margin-top: 2px;
}

.nds-result-meta-left,
.nds-result-meta-right {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.nds-result-topic {
    display: inline-flex;
    align-items: center;
    background: #f4f7fb;
    color: #51606f;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
}

.nds-result-source {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    color: #2468d5;
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.nds-result-source:hover {
    color: #144a9f;
    text-decoration: underline;
}

.nds-result-source svg,
.nds-copy-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.nds-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f7f8fa;
    color: #404b5a;
    border: 1px solid #e1e6ec;
    border-radius: 9px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.nds-copy-btn:hover {
    background: #eef2f6;
    color: #182230;
    border-color: #d5dbe3;
}

.nds-copy-btn.nds-copied {
    background: #e7f8f1;
    color: #087453;
    border-color: #bdebdc;
}

.nds-result-strength,
.nds-debug-info {
    display: none;
}

body.wp-debug .nds-result-strength {
    display: inline-flex;
}

body.wp-debug .nds-debug-info {
    display: block;
}

.nds-results-empty,
.nds-results-loading {
    text-align: center;
    padding: 42px 20px;
    color: #8a94a1;
    font-size: 14px;
}

.nds-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #e5e7eb;
    border-top-color: #0f9f73;
    border-radius: 50%;
    animation: ndsSpin 0.7s linear infinite;
    margin-bottom: 10px;
}

@keyframes ndsSpin {
    to { transform: rotate(360deg); }
}

.nds-load-more-wrap {
    text-align: center;
    margin: 22px 0 6px;
}

.nds-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    gap: 7px;
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid #cfdad5;
    background: #fff;
    color: #16231f;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 4px 13px rgba(15, 23, 42, 0.045);
}

.nds-load-more:hover:not(:disabled) {
    background: #f2faf7;
    border-color: #a9d7c5;
    box-shadow: 0 7px 20px rgba(15, 23, 42, 0.07);
}

.nds-load-more:disabled {
    opacity: 0.65;
    cursor: wait;
}

@media (max-width: 760px) {
    .norvio-search-widget {
        max-width: 100%;
        padding: 0 14px;
    }

    .nds-search-title { font-size: 21px; }
    .nds-search-subtitle { font-size: 13px; }

    .nds-input-group {
        min-height: auto;
        border-radius: 13px;
        padding: 5px 5px 5px 13px;
    }

    .nds-search-input {
        font-size: 15px;
        padding: 10px 0;
        min-width: 0;
    }

    .nds-search-button {
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 10px;
    }

    .nds-filter-bar { gap: 5px; }
    .nds-filter-btn { padding: 6px 11px; font-size: 11px; }
    .nds-advanced-filters { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
    .nds-select-filter { min-height: 38px; font-size: 12.5px; }

    .nds-result-card {
        padding: 15px 15px 13px;
        border-radius: 14px;
    }

    .nds-result-head {
        gap: 8px;
    }

    .nds-result-sentence {
        font-size: 14.5px;
        line-height: 1.58;
    }

    .nds-result-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .nds-result-meta-left,
    .nds-result-meta-right {
        width: 100%;
        justify-content: space-between;
    }

    .nds-copy-btn {
        margin-left: auto;
    }
}


/* v5.3.10: High-contrast pagination/status fixes. Theme-safe overrides. */
.norvio-search-widget .nds-search-status {
    background: #ffffff !important;
    color: #17231f !important;
    border: 1px solid #d9e6e1 !important;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.05) !important;
}

.norvio-search-widget .nds-load-more {
    background: #0f8f68 !important;
    color: #ffffff !important;
    border: 1px solid #0b7555 !important;
    box-shadow: 0 8px 22px rgba(15, 143, 104, 0.22) !important;
    text-shadow: none !important;
}

.norvio-search-widget .nds-load-more:hover:not(:disabled) {
    background: #0b7555 !important;
    color: #ffffff !important;
    border-color: #075f45 !important;
    box-shadow: 0 10px 26px rgba(15, 143, 104, 0.28) !important;
}

.norvio-search-widget .nds-load-more:disabled {
    background: #9fb8ae !important;
    color: #ffffff !important;
    border-color: #91aaa0 !important;
    opacity: 1 !important;
    cursor: wait !important;
}

@media (max-width: 480px) {
    .nds-advanced-filters { grid-template-columns: 1fr; }
}

/* v5.3.13: quick-filter pills removed from active UI. Hide any stale cached markup. */
.nds-filter-bar { display: none !important; }

/* v5.3.14 — editorial interpretation + attribution copy polish */
.nds-editorial-context {
    margin: 11px 0 4px;
    padding: 10px 12px;
    border: 1px solid #e1eee8;
    border-radius: 12px;
    background: rgba(239, 250, 246, 0.75);
}

.nds-editorial-label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #087453;
}

.nds-editorial-context p {
    margin: 0;
    color: #43505d;
    font-size: 13px;
    line-height: 1.45;
}

.nds-copy-btn {
    color: #233044;
    background: #f8fbfa;
    border-color: #cddbd6;
}

.nds-copy-btn:hover {
    color: #0a5f45;
    background: #eef9f5;
    border-color: #a7d6c6;
}


/* Norvio data landing page additions */
.norvio-data-landing .norvio-landing-toc {
  margin: 30px 0 38px;
  padding: 22px 24px;
  border: 1px solid rgba(15,104,79,.16);
  border-radius: 18px;
  background: #f7fbf8;
}
.norvio-data-landing .norvio-toc-title {
  margin: 0 0 12px;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  color: #0f513d;
}
.norvio-data-landing .norvio-landing-toc ol {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 8px;
}
.norvio-data-landing .norvio-landing-toc a {
  color: #123529;
  font-weight: 650;
  text-decoration: none;
}
.norvio-data-landing .norvio-landing-toc a:hover {
  color: #0f684f;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.norvio-data-landing .norvio-section-insight {
  margin-top: 18px;
  padding: 16px 18px;
  border-left: 4px solid rgba(15,104,79,.45);
  background: #f8fbf9;
  border-radius: 12px;
  color: #263d35;
}

/* v5.4.8 — compact sources + related links for generated landing drafts */
.norvio-data-landing .norvio-sources ul,
.norvio-data-landing .norvio-related-links ul {
  display: block;
  margin-top: 18px;
  padding: 0;
}

.norvio-data-landing .norvio-sources li,
.norvio-data-landing .norvio-related-links li {
  display: block;
  margin: 0 0 10px;
  padding: 12px 16px 12px 38px;
  border-radius: 12px;
  box-shadow: none;
  background: #f8fbf9;
  font-size: 0.95rem;
  line-height: 1.45;
}

.norvio-data-landing .norvio-sources li::before,
.norvio-data-landing .norvio-related-links li::before {
  top: 19px;
  width: 7px;
  height: 7px;
}

.norvio-data-landing .norvio-sources a,
.norvio-data-landing .norvio-related-links a {
  color: #174739;
  font-weight: 650;
  text-decoration: none;
}

.norvio-data-landing .norvio-sources a:hover,
.norvio-data-landing .norvio-related-links a:hover {
  color: #0f684f;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.norvio-data-landing .norvio-sources strong {
  color: #0f513d;
  font-weight: 780;
}
