
/* ==========================================
   WILDSTEPS CHILDREN SECTION
   Version 1.0
   ========================================== */

.ws-children-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ws-children-message {
  min-height: 20px;
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--ws-muted, #67727e);
}

/* ==========================================
   CHILD CARD GRID
   ========================================== */

.ws-children-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fill, minmax(225px, 1fr));
  gap: 24px;
  align-items: start;
}

.ws-child-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;

  min-width: 0;
  padding: 27px 18px 20px;

  background: var(--ws-surface, #ffffff);

  border: 1px solid var(--ws-line, #dfe5ea);
  border-radius: var(--ws-radius-lg, 20px);

  box-shadow: var(
    --ws-shadow-sm,
    0 2px 10px rgba(0,0,0,0.05)
  );

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.ws-child-card:hover {
  transform: translateY(-3px);
  box-shadow: var(
    --ws-shadow-md,
    0 12px 32px rgba(0,0,0,0.10)
  );
}

/* ==========================================
   CHILD CIRCLE
   ========================================== */

.ws-child-circle {
  position: relative;

  width: 162px;
  height: 162px;

  border-radius: 50%;
  overflow: hidden;

  border: 3px solid var(--ws-green, #22c55e);

  background: var(--ws-green-soft, #eaf8ef);

  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-child-circle-photo {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 48px;
  font-weight: 800;

  color: var(--ws-green-dark, #139447);
}

.ws-child-circle-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ws-child-circle-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  min-height: 47px;
  padding: 7px 10px 11px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(10, 23, 20, 0.76);

  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;

  overflow-wrap: anywhere;
}

/* ==========================================
   CARD DETAILS AND BUTTONS
   ========================================== */

.ws-child-summary {
  margin: 0;

  font-size: 12px;
  text-align: center;
  color: var(--ws-muted, #67727e);
}

.ws-child-buttons {
  display: flex;
  gap: 10px;
  width: 100%;
}

.ws-child-buttons button {
  flex: 1;
  min-height: 40px;

  padding: 10px 14px;

  border-radius: 9px;

  font-size: 12px;
  font-weight: 750;

  cursor: pointer;

  transition: background 0.2s ease;
}

.ws-child-edit-button {
  background: var(--ws-green, #22c55e);
  border: 1px solid var(--ws-green-dark, #139447);
  color: #ffffff;
}

.ws-child-edit-button:hover {
  background: var(--ws-green-dark, #139447);
}

.ws-child-files-button {
  background: var(--ws-surface, #ffffff);
  border: 1px solid var(--ws-line-strong, #cfd7de);
  color: var(--ws-ink, #15202b);
}

.ws-child-files-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ws-child-archive {
  border: none;
  background: transparent;

  color: var(--ws-muted, #67727e);

  font-size: 12px;
  font-weight: 650;

  cursor: pointer;
  text-decoration: underline;
}

.ws-child-archive:hover {
  color: var(--ws-red, #dc2626);
}

/* ==========================================
   EMPTY STATE
   ========================================== */

.ws-child-empty {
  grid-column: 1 / -1;

  padding: 55px 24px;

  border: 1px dashed var(--ws-line-strong, #cfd7de);
  border-radius: 18px;

  background: var(--ws-surface, #ffffff);
  text-align: center;
}

.ws-child-empty h2 {
  margin: 0 0 10px;
  font-size: 22px;
  color: var(--ws-ink-strong, #0d1720);
}

.ws-child-empty p {
  margin: 0;
  color: var(--ws-muted, #67727e);
}

/* ==========================================
   CHILD MODAL
   ========================================== */

.ws-child-modal .portal-modal-card {
  width: min(780px, 100%);
  max-width: 780px;
  max-height: 92vh;

  overflow-y: auto;
  overscroll-behavior: contain;
}

.ws-child-modal.hidden {
  display: none !important;
}

.ws-child-modal form {
  padding-bottom: 4px;
}

.ws-child-form-heading {
  margin: 25px 0 16px;
  padding-bottom: 10px;

  border-bottom: 1px solid var(--ws-line, #dfe5ea);

  color: var(--ws-ink-strong, #0d1720);

  font-size: 16px;
  font-weight: 800;
}

/* ==========================================
   FORM FIELDS
   ========================================== */

.ws-child-form-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 15px;
}

.ws-child-field {
  display: flex;
  flex-direction: column;
  gap: 7px;

  min-width: 0;
}

.ws-child-field.full-width {
  grid-column: 1 / -1;
}

.ws-child-field span {
  font-size: 12px;
  font-weight: 750;

  color: var(--ws-ink, #15202b);
}

.ws-child-field input {
  width: 100%;
  min-height: 43px;

  padding: 10px 12px;

  border: 1px solid var(--ws-line-strong, #cfd7de);
  border-radius: 9px;

  background: var(--ws-surface, #ffffff);
  color: var(--ws-ink, #15202b);

  font: inherit;
  font-size: 13px;
}

.ws-child-field input:focus {
  outline: 2px solid var(--ws-green, #22c55e);
  outline-offset: 1px;
}

.ws-child-field input[readonly] {
  background: var(--ws-surface-soft, #f7f9fa);
  color: var(--ws-muted, #67727e);
}

/* ==========================================
   PHOTOGRAPH UPLOAD
   ========================================== */

.ws-child-photo-upload {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.ws-child-photo-preview {
  width: 110px;
  height: 110px;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  overflow: hidden;

  border: 2px solid var(--ws-green, #22c55e);

  background: var(--ws-green-soft, #eaf8ef);

  color: var(--ws-green-dark, #139447);

  font-size: 32px;
  font-weight: 800;
}

.ws-child-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ws-child-photo-controls {
  flex: 1;
  min-width: 210px;
}

.ws-child-photo-controls p {
  font-size: 11px;
  color: var(--ws-muted, #67727e);
}

.ws-child-photo-controls button {
  margin-top: 10px;
}

/* ==========================================
   PARENT / CARER CARDS
   ========================================== */

.ws-child-contact {
  padding: 18px;
  margin-bottom: 14px;

  border: 1px solid var(--ws-line, #dfe5ea);
  border-radius: 12px;

  background: var(--ws-surface-soft, #f7f9fa);
}

.ws-child-contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;
  margin-bottom: 16px;
}

.ws-child-contact-header strong {
  font-size: 13px;
  color: var(--ws-ink-strong, #0d1720);
}

.ws-child-remove-contact {
  border: 0;
  background: transparent;

  color: var(--ws-red, #dc2626);

  font-size: 12px;
  font-weight: 700;

  cursor: pointer;
}

/* ==========================================
   FORM MESSAGES
   ========================================== */

.ws-child-form-message {
  min-height: 18px;

  margin: 15px 0;

  color: var(--ws-red, #dc2626);
  font-size: 13px;
}

.ws-child-privacy-note {
  margin: 18px 0 0;

  color: var(--ws-muted, #67727e);

  font-size: 12px;
  line-height: 1.6;
}

.ws-child-modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;

  margin-top: 18px;
}

/* ==========================================
   MOBILE / TABLET
   ========================================== */

@media (max-width: 700px) {
  .ws-children-grid {
    grid-template-columns:
      repeat(auto-fill, minmax(185px, 1fr));

    gap: 14px;
  }

  .ws-child-form-grid {
    grid-template-columns: 1fr;
  }

  .ws-child-field.full-width {
    grid-column: auto;
  }

  .ws-child-modal {
    padding: 10px;
  }

  .ws-child-modal .portal-modal-card {
    max-height: 96vh;
  }

  .ws-child-circle {
    width: 140px;
    height: 140px;
  }

  .ws-child-card {
    padding: 20px 12px;
  }

  .ws-child-photo-upload {
    align-items: flex-start;
  }
}

/* Automatic, non-editable fields */

#wsChildAge,
#wsChildYearGroup {
  background: #eef1f4 !important;
  color: #64748b !important;
  border: 1px solid #d5dce3 !important;
  cursor: not-allowed;
  opacity: 1;
}