/* Forth Campus CRM - application styles on top of Vuexy core.css.
   Brand colours themselves are set in core.css by tools/build_assets.py. */

/* WhatsApp assistant */
.fc-wa-image {
  max-width: 100%;
  max-height: 260px;
  border-radius: 0.5rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
}
.fc-wa-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  font-size: 0.9375rem;
}
.fc-wa-steps {
  counter-reset: fc-step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
}
.fc-wa-steps li::before {
  counter-increment: fc-step;
  content: counter(fc-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.375rem;
  border-radius: 50%;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  font-weight: 600;
  font-size: 0.75rem;
}
.fc-wa-steps li.is-done::before {
  background: var(--bs-success);
  color: #fff;
  content: "\2713";
}
.btn-whatsapp {
  --bs-btn-color: #fff;
  --bs-btn-bg: #0f7a40;
  --bs-btn-border-color: #0f7a40;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #0c6635;
  --bs-btn-hover-border-color: #0c6635;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #0a5a2f;
  --bs-btn-active-border-color: #0a5a2f;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #0f7a40;
  --bs-btn-disabled-border-color: #0f7a40;
}
/* Footer: the two button groups wrap as one tidy row set. */
#fcWhatsappModal .modal-footer {
  gap: 0.5rem;
}
#fcWhatsappModal .modal-footer > * {
  margin: 0;
}
/* Touch targets: at least 44px tall on phones and tablets. */
@media (max-width: 991.98px) {
  .fc-touch .btn {
    min-height: 44px;
  }
}
/* Phones: six actions in a 2 x 3 grid, labels on one line, image kept small
   so the message stays visible above the buttons. */
@media (max-width: 575.98px) {
  #fcWhatsappModal .modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0.75rem;
  }
  #fcWhatsappModal .fc-wa-actions {
    display: contents !important; /* beats Bootstrap's .d-flex */
  }
  #fcWhatsappModal .modal-footer .btn {
    white-space: nowrap;
    padding-inline: 0.5rem;
    font-size: 0.875rem;
  }
  #fcWhatsappModal .modal-body {
    padding: 1rem;
  }
  .fc-wa-image {
    max-height: 150px;
  }
}

/* Brand mark used until a logo is uploaded in Settings. */
.fc-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 0.5rem;
  background: var(--bs-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

/* Candidate grid: a table from 768px up, cards on phones (no sideways scrolling). */
.fc-cand-cards { display: none; }
.fc-cand-table { overflow-x: auto; }
@media (max-width: 767.98px) {
  .fc-cand-table table, .fc-cand-table thead { display: none !important; }
  .fc-cand-cards { display: block; }
}
.fc-cand-card {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  padding: 0.875rem;
  margin-bottom: 0.75rem;
  background: var(--bs-paper-bg, #fff);
}
.fc-cand-card .btn { min-height: 44px; flex: 1 1 0; white-space: nowrap; padding-inline: 0.25rem; }
.fc-remark { max-width: 14rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-timeline { list-style: none; margin: 0; padding: 0; }
.fc-timeline li { position: relative; padding: 0 0 1.25rem 1.5rem; border-left: 2px solid var(--bs-border-color); margin-left: 0.5rem; }
.fc-timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.fc-timeline li::before { content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--bs-primary); border: 2px solid var(--bs-paper-bg, #fff); }

/* Candidate list: WhatsApp icon keeps its colour among the round action icons. */
.fc-wa-icon, .fc-wa-icon:hover { color: #0f7a40 !important; }
.fc-cand-table table.dataTable td { vertical-align: middle; }
.fc-cand-table th { white-space: nowrap; }
.fc-cand-table .dt-search input { min-width: 19rem; max-width: 100%; }
@media (max-width: 575.98px) { .fc-cand-table .dt-search input { min-width: 0; width: 100%; } }

/* Phones: search on its own row; page size and the Export / Import buttons share the next row. */
@media (max-width: 767.98px) {
  .fc-cand-table .dt-layout-row:first-child { row-gap: 0.75rem; padding-top: 1rem; }
  .fc-cand-table .dt-layout-end { display: flex !important; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: nowrap; }
  .fc-cand-table .dt-layout-end .dt-length, .fc-cand-table .dt-layout-end .dt-buttons { margin: 0 !important; padding: 0 !important; width: auto; }
  .fc-cand-table .dt-search { margin: 0 !important; }
  .fc-cand-table .dt-layout-start, .fc-cand-table .dt-layout-end { padding-inline: 1rem !important; }
  .fc-cand-table .dt-paging { margin-top: 0.5rem; }
}
@media (max-width: 767.98px) {
  .fc-cand-table .dt-layout-start { padding-top: 1rem !important; }
  .fc-cand-table .dt-search, .fc-cand-table .dt-search input { width: 100% !important; min-width: 0; margin-left: 0 !important; }
  .fc-cand-table .dt-layout-end { padding-top: 0.75rem !important; padding-bottom: 0.25rem; }
}

/* Selection bar: the template removes top padding from a card body that follows a header. */
#fcBulkBar { padding-top: 1rem !important; padding-bottom: 1rem !important; }

/* Plain tables (Users, Messages, Import History, Trash): on phones each row becomes a
   labelled block, so nothing is cut off and nothing scrolls sideways. */
.fc-user-cell { display: flex; align-items: center; gap: 0.75rem; }
@media (max-width: 767.98px) {
  table.fc-stack thead { display: none; }
  table.fc-stack, table.fc-stack tbody, table.fc-stack tr, table.fc-stack td { display: block; width: 100%; }
  table.fc-stack tr { padding: 0.875rem 0; border-bottom: 1px solid var(--bs-border-color); }
  table.fc-stack tr:last-child { border-bottom: 0; }
  table.fc-stack td { border: 0 !important; padding: 0.25rem 1.25rem !important; text-align: left !important; white-space: normal !important; }
  table.fc-stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
  }
  table.fc-stack td.fc-stack-actions { padding-top: 0.625rem !important; display: flex; flex-wrap: wrap; gap: 0.5rem; }
  table.fc-stack td.fc-stack-actions .btn { min-height: 44px; display: inline-flex; align-items: center; }
  table.fc-stack td.fc-stack-actions form { display: inline-flex !important; }
  table.fc-stack td:empty { display: none; }
}
