/* ===========================================
   VPS Theme (Bootstrap 5 Override)
   Colours:
   - Black:   #000000
   - White:   #FFFFFF
   - Yellow:  #FFFF00
   =========================================== */

/* --- Core Variables (Bootstrap 5 Override) --- */
:root {
  --bs-primary: #FFFF00;
  --bs-secondary: #000000;
  --bs-light: #FFFFFF;
  --bs-dark: #000000;
  --bs-body-bg: #000000;
  --bs-body-color: #FFFFFF;
}

/* --- Override Bootstrap container max-width for the header --- */
.custom-container.container {
  max-width: 100% !important;   /* Full width at all breakpoints */
  width: 100% !important;
}

/* =========================================================
   HEADER
   ========================================================= */
.xrm-attribute-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
  flex-wrap: nowrap;  
}

.xrm-attribute-value img {
  height: 64px !important;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.xrm-attribute-value h1,
.siteTitle,
.custom-sitetitle {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 2rem;
  line-height: 1.1;
  color: #FFFFFF;
  font-weight: 700;
  word-break: break-word;
  white-space: normal;
}

/* ===============================
   MOBILE VIEW
   =============================== */
@media (max-width: 992px) {
  .xrm-attribute-value {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
  }
  .xrm-attribute-value h1 {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
}

@media (max-width: 768px) {
  .xrm-attribute-value {
    flex-direction: column;        /* stack vertically */
    align-items: center;
    text-align: center;
  }

  .xrm-attribute-value img {
    height: 48px !important;       /* smaller logo on mobile */
    margin-bottom: 0.5rem;
  }

  .xrm-attribute-value h1,
  .siteTitle,
  .custom-sitetitle {
    font-size: 1.6rem;             /* slightly smaller heading */
  }
  
}

@media (max-width: 480px) {
  .xrm-attribute-value img {
    height: 40px !important;       /* further shrink for small screens */
  }

  .xrm-attribute-value h1,
  .siteTitle,
  .custom-sitetitle {
    font-size: 1.4rem;
  }
}

/* =========================================================
   BODY / TYPOGRAPHY
   ========================================================= */
body {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-family: 'Roboto', Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  color: #FFFFFF !important;
  font-weight: 700;
  font-family: 'Roboto', Arial, sans-serif;
}

/* =========================================================
   FORMS / MODALS
   ========================================================= */
.crmEntityFormView,
.entitylist,
.modal-content,
.popover-content {
  border: none !important;
  box-shadow: none !important;
}

label,
.entityform label,
.form-label {
  color: #FFFFFF !important;
  font-weight: 600;
  font-family: 'Roboto', Arial, sans-serif;
}

@media (max-width: 992px) {
  label,
  .entityform label,
  .form-label {
    font-weight: 700;
  }
}

.form-select,
.form-control {
  border-radius: 9999px !important;
  background-color: #ffffff !important;
  color: #000000 !important;
  padding: 0.5rem 1rem !important;
  line-height: 1.2;
  padding-left: 1rem !important;
}

.form-control + .text-muted[aria-hidden="true"],
.form-select + .text-muted[aria-hidden="true"] {
  position: absolute !important;
  left: 1rem !important;           /* match your input padding */
  margin: 0 !important;
  font-size: 1rem;
  color: #6c757d;
  pointer-events: none;
}

/* --- 🆕 Readonly picklist styling --- */
select.readonly.form-select.picklist[aria-disabled="true"] {
  display: block !important;              /* unhide select */
}

select.readonly.form-select.picklist:has(option[value=""]:checked) {
  color: transparent !important;
}

/* Style readonly text fields */
.form-control[readonly],
.form-select[readonly],
input[aria-disabled="true"],
select[aria-disabled="true"] {
  background-color: #e9ecef !important; /* soft gray background */
  color: #6c757d !important;            /* muted text */
  cursor: not-allowed;                  /* makes it obvious it's not editable */
  border: 1px solid #ccc !important;
  box-shadow: none !important;
}

/* Optional: remove the strong pill look for readonly */
.form-control[readonly] {
  border-radius: 9999px;
  opacity: 1; /* make sure it doesn't look disabled */
}

/* Optional: italicize the text to visually distinguish */
.form-control[readonly]::placeholder,
.form-control[readonly],
.form-select[readonly] {
  font-style: italic;
}

/* Optional: remove hover highlight */
.form-control[readonly]:hover,
.form-select[readonly]:hover {
  background-color: #e9ecef !important;
  color: #6c757d !important;
  border-color: #ccc !important;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn-default,
.btn-primary,
.btn-secondary {
  background-color: #FFFF00 !important;
  border-color: #FFFF00 !important;
  color: #000000 !important;
  border-radius: 9999px !important;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-default:hover {
  background-color: #e6e600 !important;
  border-color: #e6e600 !important;
  color: #000000 !important;
}

/* =========================================================
   LISTS
   ========================================================= */
.list-group {
  background-color: #000000 !important;
  color: #FFFFFF !important;
}

.list-group-item {
  background-color: #000000 !important;
  border-color: #FFFFFF !important;
  border-width: 1px !important;
  color: #FFFFFF !important;
  font-weight: 600;
}

.list-group-item.active {
  background-color: #FFFF00 !important;
  border-color: #FFFF00 !important;
  color: #000000 !important;
}

.list-group-item:first-child {
  border-top-left-radius: 9999px !important;
  border-bottom-left-radius: 9999px !important;
}

.list-group-item:last-child {
  border-top-right-radius: 9999px !important;
  border-bottom-right-radius: 9999px !important;
}

/* Mobile adjustments for list pills */
@media (max-width: 992px) {
  .list-group-item:first-child,
  .list-group-item:last-child {
    border-radius: 0 !important;
  }
  .list-group {
    border-radius: 0 !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .list-group-item
  {
    font-weight: 700;
  }
}

.list-group-item.incomplete,
.list-group-item.success {
  background-color: #000000 !important;
  border-color: #FFFFFF !important;
  color: #FFFFFF !important;
}

.list-group-item.text-muted {
  color: #FFFFFF !important;
}

/* =========================================================
   MESSAGES
   ========================================================= */
.message.error {
  background-color: #FFFF00 !important;
  border-color: #FFFF00 !important;
  color: #000000 !important;
}

.message.success,
.alert-success,
#MessagePanel.message.success {
  background-color: #FFFFFF !important;  /* white background */
  color: #000000 !important;             /* black text */
  border-radius: 12px !important;
  padding: 1.25rem 1.5rem !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-family: 'Roboto', Arial, sans-serif !important;
}

/* Make the strong (title) line pop */
#MessagePanel.message.success strong {
  color: #000000 !important;
  font-weight: 700 !important;
}

/* =========================================================
   LINKS
   ========================================================= */
a,
.a {
  color: #000000 !important;
  text-decoration: none;
  margin-left: 0px !important;
}

a:hover,
.a:hover {
  color: #000000 !important;
  text-decoration: underline;
  margin-left: 0px !important;
}

/* =========================================================
   TABS / PROGRESS NAV
   ========================================================= */
.entityform-tab-title,
.tab-title {
  display: none !important;
}

.nav-tabs,
.nav-pills {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

.nav-pills .nav-link,
.nav-tabs .nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.nav-tabs .nav-link .fa,
.nav-pills .nav-link .fa {
  font-size: 0.9rem;
  line-height: 1;
}

.nav-pills .nav-link.active,
.nav-tabs .nav-link.active {
  background-color: #FFFF00;
  color: #000;
  border-color: #FFFF00;
}

.nav-tabs {
  border-bottom: 1px solid #fff;
  margin-top: 0.5rem;
}

/* =========================================================
   FORM GRID
   ========================================================= */
.crmEntityFormView .control,
.crmEntityFormView .form-group,
.crmEntityFormView .tab {
  margin-left: 0;
  margin-right: 0;
}

/* =========================================================
   ACTION BUTTON ROW (PREV / NEXT BUTTONS)
   ========================================================= */
.entityform .actions,
.entitylist .actions,
.form-actions {
  max-width: 100%;
  margin: 1rem auto 0 auto;
  padding: 0 16px;
}

.actions .col-md-6 {
  display: flex;
  align-items: center;
  width: 100%;
}

.actions .col-md-6 .btn-group {
  flex: 1;
  display: flex;
}

.actions .col-md-6 .btn-group:first-of-type {
  justify-content: flex-start;
}

.actions .col-md-6 .btn-group:last-of-type {
  justify-content: flex-end;
}

.entityform .actions .btn,
.form-actions .btn {
  min-width: 120px;
  font-weight: 600;
  text-align: center;
}

.actions .btn-group > .btn {
  flex: 0 0 auto !important;
  width: auto !important;
}

/* =========================================================
   NAVBAR / FOOTER
   ========================================================= */
.navbar,
.navbar-light,
.navbar-dark {
  background-color: #000000 !important;
}

.navbar a.nav-link,
.navbar-brand {
  color: #FFFFFF !important;
}

.navbar a.nav-link:hover {
  color: #FFFFFF !important;
}

footer {
  background-color: #000000;
  color: #FFFFFF;
  padding: 1rem;
  text-align: center;
}

footer a {
  color: #FFFF00;
}

footer a:hover {
  color: #FFFFFF;
}

footer .xrm-attribute-value {
  justify-content: flex-start !important;
  text-align: left !important;
}

/* ===============================
   Checkbox alignment fix
   =============================== */

/* Make the cell behave like a flex container */
.checkbox-cell {
  display: flex;
  align-items: flex-start;  /* aligns checkbox with top of text */
  gap: 0.5rem;              /* space between checkbox and text */
  vertical-align: top;
}

/* The table-info holds the text (label) and validator */
.checkbox-cell .table-info {
  order: 2;                /* ensure label text comes after the checkbox */
  flex: 1;                 /* allow wrapping */
  line-height: 1.4;
  white-space: normal;
}

/* Control contains the actual input */
.checkbox-cell .control {
  order: 1;
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
}

.checkbox-cell input[type="checkbox"] {
  margin-top: 0.25rem;      /* visually align with top of label */
  cursor: pointer;
  transform: scale(1.5);
  accent-color: #ffff00;
}

/* Make required asterisk inline with label text */
.checkbox-cell .validators {
  display: inline-block;
  margin-left: 0.25rem;
}

@media (max-width: 767px) {
  .checkbox-cell {
    gap: 0.25rem;
    align-items: flex-start;
  }

  .checkbox-cell .table-info {
    flex: 1 1 auto;
    max-width: calc(100% - 2.5rem);
    min-width: 0;
    white-space: normal;
    word-break: break-word;
  }

  .checkbox-cell .table-info label {
    padding: 0;
    margin: 0;
    line-height: 1.25;
  }

  .checkbox-cell input[type="checkbox"] {
    margin-top: -1px;
    flex-shrink: 0;
  }
}

/* =========================================================
   UTILITIES
   ========================================================= */
.bg-black { background-color: #000000 !important; color: #FFFFFF !important; }
.bg-white { background-color: #FFFFFF !important; color: #000000 !important; }
.bg-yellow { background-color: #FFFF00 !important; color: #000000 !important; }

.text-black { color: #000000 !important; }
.text-white { color: #FFFFFF !important; }
.text-yellow { color: #FFFF00 !important; }

/* =========================================================
   VPS FORM VALIDATION SUMMARY
   ========================================================= */
#ValidationSummaryEntityFormView {
  background-color: #111 !important;
  border: 2px solid #FFFF00 !important;
  border-radius: 12px !important;
  color: #FFFFFF !important;
  padding: 1.25rem 1.5rem !important;
  margin-top: 1.5rem !important;
  font-family: 'Roboto', Arial, sans-serif !important;
}

#ValidationSummaryEntityFormView h2.validation-header {
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: #FFFF00 !important;
  margin-bottom: 0.75rem !important;
}

#ValidationSummaryEntityFormView .fa-info-circle {
  color: #FFFF00 !important;
  margin-right: 0.5rem;
}

#ValidationSummaryEntityFormView ul {
  margin: 0;
  padding-left: 1.25rem;
}

#ValidationSummaryEntityFormView li {
  list-style: none;
  margin-bottom: 0.25rem;
}

#ValidationSummaryEntityFormView li a {
  color: #FFFFFF !important;
  text-decoration: underline !important;
  font-weight: 500;
  transition: color 0.2s ease-in-out;
}

#ValidationSummaryEntityFormView li a:hover,
#ValidationSummaryEntityFormView li a:focus {
  color: #FFFF00 !important;
}

/* --- Responsive VPS heading typography --- */
.xrm-attribute-value h1,
.siteTitle,
.custom-sitetitle {
  font-weight: 600 !important;
  font-size: clamp(1.8rem, 3.5vw + 0.5rem, 2.75rem) !important; /* max ≈44px */
  line-height: 1.1 !important;
}

/* Slightly heavier weight on smaller devices for visual balance */
@media (max-width: 992px) {
  .xrm-attribute-value h1,
  .siteTitle,
  .custom-sitetitle {
    font-weight: 700 !important;
  }
}

