/* =============================================================
   Pidilite Integrated Report 2025-26 — Search UI
   Command-palette overlay + grouped full results.
   Brand: ink black text, signature yellow highlight, gold accent.
   Same interaction model as the reference RETAL search UI, rebranded.
   ============================================================= */

:root {
  --rs-bg-soft:   #ffffff;
  --rs-bg-elev:   #ffffff;
  --rs-border:    #e7e7e9;
  --rs-border-2:  #d3d3d6;
  --rs-text:      #1f1f1f;
  --rs-text-2:    #54565a;
  --rs-text-3:    #8b8d91;
  --rs-accent:    #1c1c1c;              /* structural accent — CTAs, active borders */
  --rs-accent-d:  #000000;
  --rs-accent-2:  rgba(28,28,28,0.06);
  --rs-hi:        #ffe600;              /* Pidilite signature yellow */
  --rs-hi-soft:   rgba(255,230,0,0.32);
  --rs-mark-bg:   rgba(255,230,0,0.48);
  --rs-mark-fg:   #1f1f1f;
  --rs-shadow:    0 24px 64px rgba(16,24,40,0.18);
  --rs-row-hover: rgba(16,24,40,0.035);
  --rs-row-active:rgba(255,230,0,0.16);

  --rs-font-ui: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --rs-font-display: "Degular Mono", "Roboto", Arial, sans-serif;
}

/* anchor targets clear the fixed navbar when arriving via #hash */
html { scroll-padding-top: 96px; }

/* ============================================================
   TRIGGER STATE (existing header #searchBtn stays as-is)
   ============================================================ */
#searchBtn { position: relative; }

/* ============================================================
   FULL RESULTS OVERLAY (command palette)
   ============================================================ */
.rs-ov {
  position: fixed; inset: 0;
  background: rgba(20,20,22,0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 4000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 74px 20px 40px;
  overflow-y: auto;
}
.rs-ov.rs-open { display: flex; animation: rs-ov-in .2s ease-out; }
@keyframes rs-ov-in { from { opacity: 0; } to { opacity: 1; } }

.rs-ov-inner {
  width: 100%;
  max-width: 900px;
  background: var(--rs-bg-soft);
  border: 1px solid var(--rs-border);
  border-radius: 16px;
  box-shadow: var(--rs-shadow);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 114px);
  overflow: hidden;
  font-family: var(--rs-font-ui);
}

.rs-ov-head { padding: 14px 18px 0; border-bottom: 1px solid var(--rs-border); }
.rs-ov-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 14px;
}
.rs-ov-icon { color: var(--rs-text-2); flex-shrink: 0; }
.rs-ov-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--rs-text);
  font-family: var(--rs-font-ui);
  font-size: 21px;
  font-weight: 500;
  padding: 8px 2px;
  letter-spacing: -0.01em;
}
.rs-ov-input::placeholder { color: var(--rs-text-3); font-weight: 400; }
.rs-ov-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--rs-row-hover);
  border: 1px solid var(--rs-border);
  border-radius: 8px;
  color: var(--rs-text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.rs-ov-close:hover { background: var(--rs-row-active); color: var(--rs-text); }

.rs-ov-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 4px 4px 14px;
}
.rs-ov-count { font-size: 12.5px; letter-spacing: .01em; color: var(--rs-text-2); }
.rs-ov-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-ov-chip {
  font: inherit;
  font-size: 11.5px;
  padding: 5px 11px;
  border: 1px solid var(--rs-border);
  background: transparent;
  color: var(--rs-text-2);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, color .15s, border-color .15s;
}
.rs-ov-chip span {
  font-size: 10px;
  font-weight: 700;
  color: var(--rs-text-3);
  background: var(--rs-row-hover);
  padding: 1px 6px;
  border-radius: 999px;
}
.rs-ov-chip:hover { background: var(--rs-row-hover); color: var(--rs-text); }
.rs-ov-chip.is-on {
  background: var(--rs-hi-soft);
  border-color: #d9c200;
  color: var(--rs-text);
}
.rs-ov-chip.is-on span { background: var(--rs-accent); color: #fff; }

.rs-ov-body { padding: 12px 14px 22px; overflow-y: auto; flex: 1; }
.rs-ov-group + .rs-ov-group { margin-top: 24px; }
.rs-ov-group-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 12px;
  border-bottom: 1px solid var(--rs-border);
  margin-bottom: 6px;
}
.rs-ov-group-c { font-size: 11px; letter-spacing: .02em; color: var(--rs-text-3); margin-left: auto; }
.rs-ov-list { display: flex; flex-direction: column; gap: 1px; }
.rs-ov-count.rs-mob-count { padding: 6px 4px 12px; font-weight: 600; }

/* ============================================================
   RESULT ROW
   ============================================================ */
.rs-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--rs-text);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 13px 12px;
  font: inherit;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.rs-row:hover, .rs-row.rs-active {
  background: var(--rs-row-active);
  border-color: #ecd94d;
}
.rs-row-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; grid-column: 1; }
.rs-row .rs-cat { align-self: flex-start; margin-bottom: 2px; }
.rs-row-title {
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--rs-text);
  font-weight: 600;
  white-space: normal;
}
.rs-row-snip {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--rs-text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rs-row mark { background: var(--rs-mark-bg); color: var(--rs-mark-fg); padding: 0 2px; border-radius: 2px; }
.rs-row-icon {
  color: var(--rs-text-3);
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  grid-column: 2;
}
.rs-row.rs-active .rs-row-icon, .rs-row:hover .rs-row-icon { color: var(--rs-accent); }

/* ---- category tags ---- */
.rs-cat {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.rs-cat-overview     { color: #1f1f1f;  border: 1px solid rgba(200,180,0,0.5); }
.rs-cat-leadership   { color: #1f1f1f;  border: 1px solid rgba(139,78,53,0.24); }
.rs-cat-performance  { color: #1f1f1f;  border: 1px solid rgba(44,93,128,0.24); }
.rs-cat-financial    { color: #1f1f1f;  border: 1px solid rgba(63,119,82,0.24); }
.rs-cat-business     { color: #1f1f1f;  border: 1px solid rgba(91,83,198,0.24); }
.rs-cat-marketing    { color: #1f1f1f;  border: 1px solid rgba(192,35,143,0.24); }
.rs-cat-csr          { color: #1f1f1f;  border: 1px solid rgba(31,157,87,0.26); }
.rs-cat-downloads    { color: #1f1f1f;  border: 1px solid rgba(107,99,88,0.24); }

/* ============================================================
   QUICK ANSWER CARD
   ============================================================ */
.rs-qa {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  background: var(--rs-bg-elev);
  border: 1px solid var(--rs-border-2);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 4px 2px 12px;
  cursor: pointer;
  color: var(--rs-text);
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
}
.rs-qa::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rs-hi); }
.rs-qa:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(16,24,40,.10); }
.rs-qa-tag {
  align-self: start;
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 10px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #1f1f1f; background: var(--rs-hi);
  border-radius: 3px; white-space: nowrap;
}
.rs-qa-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rs-qa-label {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--rs-text-2); font-weight: 600;
}
.rs-qa-value {
  font-family: var(--rs-font-display);
  font-size: 23px; line-height: 1.15; color: var(--rs-text); font-weight: 700;
  letter-spacing: -0.01em;
}
.rs-qa-note { font-size: 12px; color: var(--rs-text-2); line-height: 1.45; }
.rs-qa-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rs-accent); white-space: nowrap;
}
.rs-qa:hover .rs-qa-cta { color: var(--rs-accent-d); }
@media (max-width: 560px) {
  .rs-qa { grid-template-columns: 1fr; gap: 10px; }
  .rs-qa-cta { justify-self: flex-start; }
}

/* ============================================================
   SECTIONS / CHIPS / EMPTY STATES
   ============================================================ */
.rs-section { padding: 6px 2px; }
.rs-section + .rs-section { border-top: 1px solid var(--rs-border); margin-top: 6px; padding-top: 12px; }
.rs-section-h {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--rs-text-3); padding: 6px 8px 10px; font-weight: 600;
}
.rs-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 6px 4px; }
.rs-chip {
  font: inherit; font-size: 12px; padding: 6px 12px;
  border: 1px solid var(--rs-border); background: transparent; color: var(--rs-text-2);
  border-radius: 999px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.rs-chip:hover { background: var(--rs-row-hover); color: var(--rs-text); border-color: var(--rs-border-2); }
.rs-chip-clear { color: var(--rs-text-3); }

.rs-empty { padding: 30px 16px 24px; text-align: left; color: var(--rs-text-2); }
.rs-empty p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.rs-empty p:first-child {
  font-family: var(--rs-font-display);
  font-size: 20px; font-weight: 700; color: var(--rs-text); letter-spacing: -0.01em; margin-bottom: 10px;
}
.rs-empty-sub { color: var(--rs-text-3); }
.rs-empty strong { color: var(--rs-text); font-weight: 700; box-shadow: inset 0 -9px 0 var(--rs-hi-soft); }
.rs-empty-lg { padding: 56px 30px; text-align: center; }
.rs-link {
  background: none; border: none; color: var(--rs-accent);
  font: inherit; font-size: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #d9c200;
  text-decoration-thickness: 2px; padding: 0; font-weight: 600;
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 640px) {
  .rs-ov { padding: 0; }
  .rs-ov-inner { max-width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; }
  .rs-ov-input { font-size: 18px; }
}

/* ============================================================
   BODY LOCK + TARGET PULSE
   ============================================================ */
body.rs-locked { overflow: hidden; }

.rs-pulse { position: relative; animation: rs-pulse-anim 2.2s ease-out forwards; }
@keyframes rs-pulse-anim {
  0%   { box-shadow: 0 0 0 0 rgba(255,230,0,0.75), inset 0 0 0 0 rgba(255,230,0,0); }
  20%  { box-shadow: 0 0 0 16px rgba(255,230,0,0), inset 0 0 0 3px rgba(255,230,0,0.75); }
  100% { box-shadow: 0 0 0 0 rgba(255,230,0,0), inset 0 0 0 0 rgba(255,230,0,0); }
}
