/* ============================================================
   btn-validation.css
   BlockTrust Network - Site-wide validation styling

   Works with:
   /js/btn-validation.js
   Parsley
   Optional Flatpickr

   Version: 1.0.0
   ============================================================ */


/* ============================================================
   FIELD VALIDATION STATES
   ============================================================ */

.btn-field-error {
  border: 2px solid #c62828 !important;
  background-color: #fff5f5 !important;
}

.btn-field-error:focus {
  border-color: #b00020 !important;
  background-color: #fffafa !important;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.18) !important;
  outline: none !important;
}

.btn-field-valid {
  border-color: #ced4da;
}


/* ============================================================
   PARSLEY ERROR MESSAGE
   ============================================================ */

.btn-error-message {
  color: #c62828;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 5px;
  font-weight: 600;
}

.btn-error-message div {
  margin-top: 2px;
}


/* ============================================================
   DATE FIELD WRAPPER + CALENDAR ICON
   ============================================================ */

.date-wrap {
  position: relative;
  width: 100%;
}

.date-wrap input {
  padding-right: 40px;
}

.date-icon-btn {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #555;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
}

.date-icon-btn:hover {
  background-color: #f1f1f1;
  color: #222;
}

.date-icon-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.18);
}


/* ============================================================
   CONDITIONAL FIELD AREAS
   ============================================================ */

.btn-conditional-field {
  margin-top: 10px;
}

.btn-conditional-field.is-hidden {
  display: none !important;
}


/* ============================================================
   MODAL BACKDROP
   ============================================================ */

.btn-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.46);
  display: none;
  z-index: 9998;
}


/* ============================================================
   VALIDATION FOLLOW-UP MODAL
   ============================================================ */

.btn-validation-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 440px;
  max-width: calc(100% - 32px);
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
  display: none;
  z-index: 9999;
  overflow: hidden;
  font-family: inherit;
  color: #222;
}

.btn-validation-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e5e5;
  background: #fafafa;
}

.btn-validation-modal-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}

.btn-validation-modal-x {
  border: 0;
  background: transparent;
  color: #666;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.btn-validation-modal-x:hover {
  color: #111;
}

.btn-validation-modal-x:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.18);
  border-radius: 4px;
}

.btn-validation-modal-body {
  padding: 18px;
}

.btn-validation-modal-body p {
  margin: 0 0 14px 0;
  color: #444;
  font-size: 14px;
  line-height: 1.45;
}

.btn-validation-modal-body label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: #333;
  font-size: 13px;
}

.btn-validation-modal-body input,
.btn-validation-modal-body select,
.btn-validation-modal-body textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #b9b9b9;
  border-radius: 5px;
  background: #fff;
  color: #222;
  font-size: 14px;
  line-height: 1.35;
  box-sizing: border-box;
}

.btn-validation-modal-body textarea {
  resize: vertical;
  min-height: 92px;
}

.btn-validation-modal-body input:focus,
.btn-validation-modal-body select:focus,
.btn-validation-modal-body textarea:focus {
  outline: none;
  border-color: #2b6cb0;
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.16);
}

.btn-validation-modal-error {
  color: #c62828;
  font-size: 12px;
  margin-top: 7px;
  display: none;
  font-weight: 700;
}

.btn-validation-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid #e5e5e5;
  background: #fafafa;
  text-align: right;
}


/* ============================================================
   MODAL BUTTONS
   ============================================================ */

.btn-validation-btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  text-align: center;
  vertical-align: middle;
}

.btn-validation-btn + .btn-validation-btn {
  margin-left: 8px;
}

.btn-validation-btn-primary {
  background: #1f5f99;
  border-color: #1f5f99;
  color: #ffffff;
}

.btn-validation-btn-primary:hover {
  background: #174b79;
  border-color: #174b79;
}

.btn-validation-btn-light {
  background: #ffffff;
  border-color: #cfcfcf;
  color: #333333;
}

.btn-validation-btn-light:hover {
  background: #f2f2f2;
  border-color: #bdbdbd;
}

.btn-validation-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 95, 153, 0.18);
}


/* ============================================================
   SMALL SCREEN MODAL ADJUSTMENTS
   ============================================================ */

@media (max-width: 520px) {
  .btn-validation-modal {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
  }

  .btn-validation-modal-header,
  .btn-validation-modal-body,
  .btn-validation-modal-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .btn-validation-btn {
    width: 100%;
    margin-left: 0 !important;
    margin-top: 8px;
  }

  .btn-validation-modal-footer {
    text-align: center;
  }
}


/* ============================================================
   OPTIONAL FIELD HELPERS
   ============================================================ */

.btn-validation-help {
  color: #666;
  font-size: 12px;
  margin-top: 4px;
}

.btn-validation-required-mark {
  color: #c62828;
  font-weight: 700;
  margin-left: 3px;
}

/* ============================================
   TYPEAHEAD – FINAL POLISH
   ============================================ */

.ui-autocomplete {
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.ui-menu-item-wrapper {
  cursor: pointer;
}

/* Prevent weird bold/italic inheritance */
.ui-menu-item-wrapper {
  font-weight: normal;
}

/* Fix overflow issues inside containers */
.ui-front {
  z-index: 9999 !important;
}

/* ============================================
   TYPEAHEAD INPUT (Searchable Dropdown Style)
   ============================================ */

.typeahead-input {
  width: 100%;
  height: 38px;              /* matches Bootstrap */
  padding: 6px 12px;         /* matches */
  font-size: 14px;
  line-height: 1.5;

  border: 1px solid #ced4da;
  border-radius: 4px;
  background: #fff;

  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.typeahead-input:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(13,110,253,.25);
}


/* Wrapper adds dropdown arrow */
.typeahead-wrapper {
  position: relative;
}

.typeahead-wrapper::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #666;
}

.delete-product-row-btn {
  background: transparent;
  border: 1px solid #ccc;
  color: #666;
  font-size: 14px;
  width: 24px;
  height: 24px;
  line-height: 20px;
  border-radius: 4px;
  padding: 0;
  text-align: center;
  cursor: pointer;
}

.delete-product-row-btn:hover {
  border-color: #999;
  color: #333;
  background: #f5f5f5;
}

.use-prev-date {
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
}
