/* ==========================================================================
   srd-dates.css  (vsrd.co.za)
   Extra styles for:
     1. SRD payment dates      (partials/srd-dates.blade.php)
     2. "Still stuck?" help box (inside partials/srd-dates.blade.php)
     3. SRD status meanings    (partials/srd-status.blade.php)

   Works on top of style.css and does not change it. Headings, sections,
   .table, .table-dark and .table-responsive come from style.css. Every rule
   here uses an srd- class, so nothing else on the site is affected.

   Colours follow style.css: navy #1e3a8a, text #0f172a, muted #475569,
   border #e2e8f0, light #f8fafc, light blue #eef4ff.
   ========================================================================== */

.srd-section,
.srd-section *,
.srd-st,
.srd-st * {
  box-sizing: border-box;
}


/* ==========================================================================
   1. SRD PAYMENT DATES
   ========================================================================== */

/* Status badge: set by srd-dates.js from data-srd-start / data-srd-end */
.srd-status {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.srd-status--paid { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.srd-status--now  { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.srd-status--up   { background: #eef4ff; color: #1e3a8a; border-color: #dbe4ff; }

/* Badge line under each month H2 */
.srd-section .srd-badge {
  margin: 6px 0 10px;
}

/* Year table */
.table.srd-table td:nth-child(2) {
  font-variant-numeric: tabular-nums;
}
.table.srd-table tr.srd-row--current td {
  background: #f8fafc;
  font-weight: 600;
}

/* style.css turns .table into a scrolling block on mobile and gives every
   cell min-width:140px. That pushes a 3-column table off screen, so these
   tables keep normal table layout and share the width. */
@media (max-width: 768px) {
  .table.srd-table,
  .table.srd-st-table {
    display: table;
    width: 100%;
  }
  .table.srd-table th,
  .table.srd-table td,
  .table.srd-st-table th,
  .table.srd-st-table td {
    min-width: 0;
  }
}
@media (max-width: 420px) {
  .srd-status {
    padding: 2px 8px;
    font-size: 12px;
  }
}


/* ==========================================================================
   2. HELP BOX  ("Having trouble or still stuck?")
   ========================================================================== */

.srd-help {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 24px 0 8px;
  padding: 20px 22px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.04);
}
.srd-help__icon {
  display: flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e3a8a;
  color: #fff;
}
.srd-help__icon svg {
  width: 22px;
  height: 22px;
}
.srd-help__body {
  flex: 1;
  min-width: 0;
}
.srd-help .srd-help__title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: #0f172a;
}
.srd-help .srd-help__text {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.6;
  color: #475569;
}

/* Call + portal buttons */
.srd-help__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.srd-help .srd-help__btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border: 1px solid #1e3a8a;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.srd-help .srd-help__btn small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
}
.srd-help .srd-help__btn--call {
  background: #1e3a8a;
  color: #fff;
}
.srd-help .srd-help__btn--call:hover,
.srd-help .srd-help__btn--call:focus-visible {
  background: #172f6e;
  color: #fff;
}
.srd-help .srd-help__btn--web {
  background: #fff;
  color: #1e3a8a;
}
.srd-help .srd-help__btn--web:hover,
.srd-help .srd-help__btn--web:focus-visible {
  background: #eef4ff;
  color: #1e3a8a;
}

/* "Common problems" links */
.srd-help__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 14px;
}
.srd-help__links-label {
  margin-right: 2px;
  font-weight: 600;
  color: #0f172a;
}
.srd-help__links a {
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #1e3a8a;
  font-weight: 500;
  text-decoration: none;
}
.srd-help__links a:hover,
.srd-help__links a:focus-visible {
  background: #eef4ff;
  text-decoration: underline;
}

@media (max-width: 576px) {
  .srd-help {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  .srd-help__icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }
  .srd-help__actions {
    flex-direction: column;
  }
  .srd-help .srd-help__btn {
    justify-content: center;
    width: 100%;
    text-align: center;
  }
  .srd-help__links-label {
    width: 100%;
  }
}


/* ==========================================================================
   3. SRD STATUS MEANINGS  (#srd-status-meanings)
   ========================================================================== */

.srd-st .srd-st-lead {
  font-size: 16px;
}

/* Colour guide: ok = payment on the way, wait = SASSA is checking,
   act = you need to act, stop = not paid this month */
.srd-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-decoration: none;
  white-space: nowrap;
}
.srd-chip--ok   { background: #dcfce7; color: #166534; }
.srd-chip--wait { background: #eef4ff; color: #1e3a8a; }
.srd-chip--act  { background: #fef3c7; color: #92400e; }
.srd-chip--stop { background: #fee2e2; color: #991b1b; }
a.srd-chip::after {
  content: " \2193";
  font-weight: 700;
}
a.srd-chip:hover,
a.srd-chip:focus-visible { text-decoration: underline; }
a.srd-chip--ok:hover   { color: #166534; }
a.srd-chip--wait:hover { color: #1e3a8a; }
a.srd-chip--act:hover  { color: #92400e; }
a.srd-chip--stop:hover { color: #991b1b; }

.srd-dot {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.srd-dot--ok   { background: #16a34a; }
.srd-dot--wait { background: #1e3a8a; }
.srd-dot--act  { background: #d97706; }
.srd-dot--stop { background: #dc2626; }

/* Quick reference table */
.table.srd-st-table caption {
  caption-side: top;
  padding: 0 0 8px;
  font-size: 13px;
  text-align: left;
  color: #475569;
}
.table.srd-st-table th,
.table.srd-st-table td {
  text-align: left;
  vertical-align: top;
}
.table.srd-st-table tbody th {
  font-weight: 600;
  background: #f8fafc;
}

/* Phone: each row becomes a compact card (status, meaning, what to do).
   The HTML stays a real table, so Google and AI tools still read it as one. */
@media (max-width: 576px) {
  .table.srd-st-table,
  .table.srd-st-table tbody,
  .table.srd-st-table tr,
  .table.srd-st-table th,
  .table.srd-st-table td {
    display: block;
    width: 100%;
  }
  .table.srd-st-table caption {
    display: block;
  }
  .table.srd-st-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .table.srd-st-table tbody {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
  }
  .table.srd-st-table tr {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
  }
  .table.srd-st-table tr:last-child {
    border-bottom: 0;
  }
  .table.srd-st-table th,
  .table.srd-st-table td {
    padding: 0;
    border: 0;
    background: none;
    font-size: 14px;
    line-height: 1.5;
  }
  .table.srd-st-table tbody th {
    margin-bottom: 4px;
    background: none;
  }
  .table.srd-st-table td + td {
    margin-top: 2px;
    color: #475569;
  }
  .table.srd-st-table td + td::before {
    content: "What to do: ";
    font-weight: 600;
    color: #0f172a;
  }
}

/* Colour legend under the table */
.srd-st .srd-st-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 4px 0 20px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: #475569;
}
.srd-st-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Question accordions (native <details>, content stays in the HTML) */
.srd-st-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 16px;
}
.srd-st-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  scroll-margin-top: 90px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.srd-st-item:hover {
  border-color: #cbd5e1;
}
.srd-st-item[open] {
  border-color: #c7d2fe;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.04);
}
.srd-st-item > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  cursor: pointer;
  list-style: none;
}
.srd-st-item > summary::-webkit-details-marker {
  display: none;
}
.srd-st-item > summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin: 0 4px 4px auto;
  border-right: 2px solid #1e3a8a;
  border-bottom: 2px solid #1e3a8a;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.srd-st-item[open] > summary::after {
  margin-bottom: -4px;
  transform: rotate(-135deg);
}
.srd-st-item > summary:focus-visible {
  outline: 3px solid #1e3a8a;
  outline-offset: 2px;
}
.srd-st .srd-st-item h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 16.5px;
  line-height: 1.4;
}
.srd-st-body {
  padding: 2px 16px 14px 38px;
}
.srd-st-body > p:first-child {
  margin-top: 0;
}
.srd-st-body ul {
  margin-bottom: 0;
}
.srd-st-body li {
  margin-bottom: 6px;
  line-height: 1.6;
}
.srd-st-body li:last-child {
  margin-bottom: 0;
}

.srd-st .srd-st-source {
  font-size: 13px;
  color: #475569;
}

@media (max-width: 576px) {
  .srd-st-item > summary {
    gap: 10px;
    padding: 12px 14px;
  }
  .srd-st .srd-st-item h3 {
    font-size: 15.5px;
  }
  .srd-st-body {
    padding: 0 14px 12px;
  }
}


/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .srd-help .srd-help__btn,
  .srd-st-item,
  .srd-st-item > summary::after {
    transition: none;
  }
}
