/* regulatorySearch.css - Styles for monetary authority search results */

/* ================================
   SEARCH RESULTS CONTAINER
   ================================ */

.search-results-container {
  margin-top: 2rem;
  width: 100%;

  /* Sticky header support: make results area scrollable (table scrolls within this box) */
  max-height: 460px; /* tweak as desired */
  overflow: auto;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10);
}


/* Loading, No Results, Error states */
.search-loading,
.search-no-results,
.search-error {
  padding: 2rem;
  text-align: center;
  font-family: "Roboto", sans-serif;
  font-size: 1rem;
  color: var(--ink, #434343);
}

.search-error {
  color: #dc2626;
}

/* ================================
   RESULTS TABLE - DESKTOP
   ================================ */

.regulatory-results-table {
  width: 100%;
  border-collapse: separate; /* required for sticky header + rounded container */
  border-spacing: 0;
  font-family: "Roboto", sans-serif;
  font-size: 0.95rem;
  background: #ffffff;

  /* Table should not clip sticky header; container handles rounding */
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.regulatory-results-table thead {
  background: #4d555b;
  color: #ffffff;
}

.regulatory-results-table thead th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


/* ================================
   STICKY TABLE HEADER (SAFE)
   ================================ */

.regulatory-results-table thead th {
  position: sticky;
  top: 0;
  z-index: 2; /* keep header above body rows */
  background: #4d555b; /* ensure solid background while scrolling */
}

/* Subtle separator line under header during scroll */
.regulatory-results-table thead th {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.regulatory-results-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s ease;
  vertical-align: middle;  
}

.regulatory-results-table tbody tr:hover {
  background: #f3f4f6;
}

/* Alternating row colors */
.regulatory-results-table tbody tr.row-even {
  background: #f7f7f4;
}

.regulatory-results-table tbody tr.row-odd {
  background: #c2c0bb;
}

.regulatory-results-table tbody tr.row-even:hover,
.regulatory-results-table tbody tr.row-odd:hover {
  background: #e8e8e5;
}

.regulatory-results-table tbody td {
  padding: 1rem;
  color: var(--ink, #434343);
  vertical-align: middle;  
}

/* Number column styling */
.col-number {
  width: 60px;
  text-align: center;
  font-weight: 600;
  color: #4d555b;
}

.regulatory-results-table tbody td.col-number {
  text-align: center;
  font-weight: 500;
}

/* URL Link styling */
/* =========================================
   Regulatory links — reference-style hover
   Align with Payments Hub reference links
   ========================================= */

.url-link {
  position: relative;
  display: inline-block;

  /* Match Payments Hub "ink" baseline; hover adds the accent */
  color: var(--ink, #434343);
  text-decoration: none;
  font-weight: 500;
}

/* Animated underline (same behavior as ph-ref-link / atg__also-live-link) */
.url-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background-color: currentColor;
  transition: width 0.25s ease;
}

.url-link:hover::after,
.url-link:focus-visible::after {
  width: 100%;
}

/* Subtle color shift only (no default underline) */
.url-link:hover {
  color: #434343;
  text-decoration: none;
}

/* Not Available styling */
.url-not-available {
  color: #9ca3af;
  font-style: italic;
}

/* Number column styling */
.col-number {
  width: 60px;
  text-align: center !important;
  font-weight: 600;
  color: #fffffF;
  vertical-align: middle;
}

.regulatory-results-table thead th.col-number {
  text-align: center !important;
  vertical-align: middle;
}

.regulatory-results-table tbody td.col-number {
  text-align: center !important;
  vertical-align: middle;
  font-weight: 500;
  padding: 1rem 0.5rem;  /* Reduce horizontal padding */
}

/* ================================
   MOBILE RESPONSIVE TABLE
   ================================ */

@media (max-width: 768px) {
  .regulatory-results-table {
    border: 0;
    box-shadow: none;
  }

  .regulatory-results-table thead {
    display: none;
  }

  .regulatory-results-table tbody {
    display: block;
  }

  .regulatory-results-table tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    overflow: hidden;
  }

  .regulatory-results-table tbody tr.row-even,
  .regulatory-results-table tbody tr.row-odd {
    background: #ffffff;
  }

  .regulatory-results-table tbody td {
    display: block;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    padding-left: 45%;
  }

  .regulatory-results-table tbody td:last-child {
    border-bottom: none;
  }

  .regulatory-results-table tbody td:before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    width: 40%;
    font-weight: 600;
    color: #4d555b;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
  }

  /* First two rows get background colors */
  .regulatory-results-table tbody td:nth-child(1),
  .regulatory-results-table tbody td:nth-child(2) {
    background: #f7f7f4;
  }

  .regulatory-results-table tbody tr.row-odd td:nth-child(1),
  .regulatory-results-table tbody tr.row-odd td:nth-child(2) {
    background: #c2c0bb;
  }
}

/* Number column - keep it inline on mobile */
  .regulatory-results-table tbody td.col-number {
    display: inline-block;
    width: auto;
    padding-left: 1rem;
    font-weight: 600;
    background: transparent;
  }

  .regulatory-results-table tbody td.col-number:before {
    content: none;
  }

/* ================================
   TABLET ADJUSTMENTS
   ================================ */

@media (min-width: 769px) and (max-width: 1024px) {
  .regulatory-results-table {
    font-size: 0.9rem;
  }

  .regulatory-results-table thead th,
  .regulatory-results-table tbody td {
    padding: 0.75rem;
  }
}

/* Force all cells in a row to align middle */
.regulatory-results-table tbody tr td {
  vertical-align: middle !important;
}

/* ==========================================================
   REGULATORY LANDSCAPE — Quick Win Polish (Hierarchy + Contrast)
   Drop this at the END of regulatorySearch2.css (or paymentsHub3.css)
   ========================================================== */

/* 1) Card container: calmer, more "curated module" */
#regulatory .regulatory-search-container{
  background: #F3F1EC;                 /* warmer neutral than #eae8e3 */
  border: 1px solid rgba(0,0,0,0.10);  /* softer border */
  border-radius: 12px;                 /* slightly more refined than 8px */
  padding: 28px 28px 30px;             /* better breathing room */
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

/* 2) Title hierarchy: slightly stronger anchor + better spacing */
#regulatory .search-header{
  margin-bottom: 18px;                 /* was 1.5rem; make it intentional */
}

#regulatory .search-title{
  font-size: 1.05rem;                  /* keep size stable */
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #2B2B2B;
  margin: 0;
}

/* 3) Controls rhythm: align with the rest of Payments Hub spacing */
#regulatory .search-interface{
  display: block;                      /* keep your layout intact */
}

#regulatory .search-input-group{
  gap: 14px;                           /* slightly tighter than 0.75rem */
}

/* 4) Input + Select contrast tuning (no layout/logic change)
      NOTE: This also fixes the 'cursor: not-allowed' which reads as disabled. */
#regulatory .search-input,
#regulatory .search-filter{
  background: #F7F6F3;                 /* subtle contrast vs card */
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;                 /* refined feel */
  color: #2F3437;
}

/* Cursor polish (purely visual; no logic change) */
#regulatory .search-input{ cursor: text; }
#regulatory .search-filter{ cursor: pointer; }

/* Placeholder: slightly inkier than default to feel less "raw" */
#regulatory .search-input::placeholder{
  color: rgba(77, 85, 91, 0.58);
}

/* Focus: subtle “designed” focus ring (respects your outline-removal rules) */
#regulatory .search-input:focus,
#regulatory .search-filter:focus{
  border-color: rgba(158, 181, 190, 0.95);                 /* #9EB5BE family */
  box-shadow: 0 0 0 2px rgba(158, 181, 190, 0.25);
}

/* 5) Results area: add separation + keep it light and editorial */
#regulatory .search-results-container{
  margin-top: 18px;
}

/* If your JS injects a table, these rules will improve perceived quality */
#regulatory .search-results-container table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: visible;
  border-radius: 10px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.08);
}

#regulatory .search-results-container thead th{
  /* Keep your refined look */
  background-color: #515A61;
  color: #FFFFFF;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 14px 14px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(0,0,0,0.25);

  /* Bring sticky back (override-safe) */
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}


#regulatory .search-results-container tbody td{
  font-size: 0.94rem;
  line-height: 1.45;
  color: #2E2F2F;              /* darker, more print-like */
  padding: 14px 14px;
}

/* Gentle hover to reduce “raw table” feel (no behavior change) */
#regulatory .search-results-container tbody tr:hover{
    background-color: #EEECE7;
}

#regulatory .search-results-container tbody tr:nth-child(even) {
  background-color: #E6E4DF;   /* lighter, warmer */
}

#regulatory .search-results-container tbody tr:nth-child(odd) {
  background-color: #FAF9F6;
}


/* 6) Keep your existing responsive behavior intact */
@media (min-width: 1024px){
  #regulatory .regulatory-search-container{
    padding: 32px 32px 34px;
  }
}

#regulatory .search-results-container td:nth-child(2) {
  font-size: 0.8rem;
  font-weight: 600;
  color: #5F6B73;
}
#regulatory .search-results-container a {
  color: #3A6F8F;
  text-decoration: none;
  font-weight: 500;
}

#regulatory .search-results-container a:hover {
  text-decoration: underline;
}

/* ===== Sticky header regression fix (override-safe) ===== */

/* Fix: table should not clip sticky header */
#regulatory .search-results-container table{
  overflow: visible;
}

/* Fix: keep the refined header styling BUT re-assert sticky */
#regulatory .search-results-container thead th{
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}


/* =========================
   ENTRY CARD: clean mobile typography + spacing
   ========================= */
.entry-card * { min-width: 0; }  /* prevents text blocks from overflowing */

.entry-card-header {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  row-gap: 6px;
  align-items: start;
}

.entry-card-title {
  line-height: 1.2;
}

.entry-card-meta {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: nowrap;
  white-space: nowrap;
  font-size: 0.92rem;
  opacity: 0.8;
}

/* Scope text stays readable and doesn't collide */
.entry-card-scope,
.entry-card-desc {
  margin-top: 10px;
  line-height: 1.35;
}

/* On narrow screens stack meta under title */
@media (max-width: 520px) {
  .entry-card-header {
    grid-template-columns: 1fr;
  }
  .entry-card-meta {
    justify-content: flex-start;
    white-space: normal;
  }
}

/* ==========================================================
   FIX: Mobile table layout + scoped col-number + scrollbar
   Paste at END of regulatorySearch2.css
   ========================================================== */

/* Tasteful scrollbar (container scrolls, sticky header remains) */
.search-results-container{
  scrollbar-width: thin;                 /* Firefox */
  scrollbar-color: rgba(77,85,91,0.35) transparent;
}
.search-results-container::-webkit-scrollbar{
  width: 10px;
}
.search-results-container::-webkit-scrollbar-track{
  background: transparent;
}
.search-results-container::-webkit-scrollbar-thumb{
  background: rgba(77,85,91,0.28);
  border-radius: 999px;
  border: 3px solid transparent;         /* creates “inset” look */
  background-clip: content-box;
}
.search-results-container::-webkit-scrollbar-thumb:hover{
  background: rgba(77,85,91,0.38);
  background-clip: content-box;
}

/* Re-scope mobile rules correctly */
@media (max-width: 768px) {

  /* Keep your mobile “card rows”, but make spacing safer */
  .regulatory-results-table tbody td{
    padding-left: 52%;                   /* more room so label never collides */
    word-break: break-word;              /* long names/URLs won’t overflow */
  }

  .regulatory-results-table tbody td:before{
    width: 46%;
    white-space: normal;
  }

  /* Number column - keep it clean on mobile (scoped correctly) */
  .regulatory-results-table tbody td.col-number{
    display: block;                      /* consistent with card layout */
    padding-left: 1rem;                  /* no label offset */
    font-weight: 700;
  }
  .regulatory-results-table tbody td.col-number:before{
    content: none;
  }
}

/* Extra-safety for very small screens (iPhone/older Android) */
@media (max-width: 480px) {
  .regulatory-results-table tbody td{
    padding-left: 1rem;                  /* remove left “label column” */
  }
  .regulatory-results-table tbody td:before{
    position: static;
    display: block;
    width: auto;
    margin: 0 0 0.25rem 0;
  }
}


/* ==========================================================
   MOBILE FIX — Regulatory results: prevent label/value overlap
   Drop at END of regulatorySearch2.css
   ========================================================== */

@media (max-width: 768px) {
  .regulatory-results-table tbody td {
    padding-left: 52%;            /* give labels more room (FR needs it) */
    word-break: break-word;       /* long authority names won't collide */
    overflow-wrap: anywhere;
  }

  .regulatory-results-table tbody td:before {
    width: 48%;
    white-space: normal;          /* allow label to wrap inside label area */
    line-height: 1.2;
  }
}

