/*
 * Toast thông báo (alertify.notify) cho giao diện marketplace.
 * Cùng hệ màu/chữ của site: font Quicksand, primary #0674ec, card trắng bo 4px, bóng 0 5px 40px.
 * Nạp sau alertify.min.css và style.css (public/themes/marketplace/config.php).
 */

.alertify-notifier {
  z-index: 99999;
}

.alertify-notifier.ajs-top {
  top: 90px;
}

.alertify-notifier.ajs-right {
  right: 24px;
}

.alertify-notifier .ajs-message {
  position: relative;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  width: 340px;
  max-width: calc(100vw - 32px);
  margin: 0;
  /* !important: style.css có rule .ajs-error/.ajs-success dùng !important */
  padding: 0 40px 0 60px !important;
  background: #fff !important;
  color: #555555 !important;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px !important;
  font-weight: 500;
  line-height: 22px;
  text-align: left;
  text-shadow: none !important;
  border: 0;
  border-left: 4px solid #0674ec;
  -webkit-border-radius: 4px !important;
  border-radius: 4px !important;
  -webkit-box-shadow: 0 5px 40px rgba(82, 85, 90, 0.2) !important;
  box-shadow: 0 5px 40px rgba(82, 85, 90, 0.2) !important;
  cursor: pointer;
  bottom: auto !important;
}

/* alertify ẩn toast bằng max-height/padding = 0, chỉ bật khi .ajs-visible */
.alertify-notifier .ajs-message.ajs-visible {
  padding: 16px 40px 16px 60px !important;
  margin-top: 12px;
  max-height: none;
}

.alertify-notifier .ajs-message .ajs-close {
  display: none;
}

/* Vòng tròn icon bên trái */
.alertify-notifier .ajs-message::before {
  content: "\f05a"; /* fa-info-circle */
  font-family: FontAwesome, sans-serif;
  position: absolute;
  left: 16px;
  top: 16px;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  font-size: 16px;
  font-weight: normal;
  color: #0674ec;
  background: rgba(6, 116, 236, 0.1);
  -webkit-border-radius: 50%;
  border-radius: 50%;
}

/* Nút đóng (×) */
.alertify-notifier .ajs-message::after {
  content: "\00d7";
  position: absolute;
  right: 14px;
  top: 12px;
  font-size: 20px;
  line-height: 20px;
  color: #b4b6c1;
  -webkit-transition: color .2s;
  transition: color .2s;
}

.alertify-notifier .ajs-message:hover::after {
  color: #555555;
}

.alertify-notifier .ajs-message.ajs-error {
  border-left-color: #ff6a6d;
}

.alertify-notifier .ajs-message.ajs-error::before {
  content: "\f071"; /* fa-exclamation-triangle */
  color: #ff6a6d;
  background: rgba(255, 106, 109, 0.12);
}

.alertify-notifier .ajs-message.ajs-success {
  border-left-color: #77de51;
}

.alertify-notifier .ajs-message.ajs-success::before {
  content: "\f00c"; /* fa-check */
  color: #4fbf26;
  background: rgba(119, 222, 81, 0.15);
}

.alertify-notifier .ajs-message.ajs-warning {
  border-left-color: #feb71d;
}

.alertify-notifier .ajs-message.ajs-warning::before {
  content: "\f12a"; /* fa-exclamation */
  color: #e69e00;
  background: rgba(254, 183, 29, 0.15);
}

/* Nội dung HTML trong toast (danh sách lỗi validate, đoạn văn) */
.alertify-notifier .ajs-message h4 {
  margin: 0 0 6px;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #000;
}

.alertify-notifier .ajs-message p {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 22px;
  color: #555555;
}

.alertify-notifier .ajs-message p:last-child {
  margin-bottom: 0;
}

.alertify-notifier .ajs-message ul {
  margin: 0;
  padding-left: 18px;
}

.alertify-notifier .ajs-message ul li {
  list-style: disc;
  font-size: 14px;
  line-height: 21px;
  color: #555555;
}

.alertify-notifier .ajs-message a {
  color: #0674ec;
  text-decoration: underline;
}

/* Trượt vào từ phải. Khung notifier rộng 0 và bám mép phải → toast hiện ở right = độ rộng toast. */
.alertify-notifier.ajs-right .ajs-message {
  right: -380px;
}

.alertify-notifier.ajs-right .ajs-message.ajs-visible {
  right: 340px;
}

@media (max-width: 575px) {
  .alertify-notifier.ajs-top {
    top: 16px;
  }

  .alertify-notifier.ajs-right {
    right: 16px;
    left: 16px;
    width: auto;
  }

  .alertify-notifier .ajs-message {
    width: auto;
    max-width: none;
  }

  .alertify-notifier.ajs-right .ajs-message,
  .alertify-notifier.ajs-right .ajs-message.ajs-visible {
    right: 0;
  }
}

/* =====================================================================
 * Hộp thoại alertify.alert / confirm (vd. "Your password has been reset")
 * Card trắng bo 8px, tiêu đề chữ thường Quicksand, nút OK dạng pill màu primary như nút của site.
 * ===================================================================== */

.alertify .ajs-dimmer {
  background-color: rgba(17, 24, 39, 0.45);
  opacity: 1;
}

.alertify .ajs-dialog {
  max-width: 440px;
  min-height: 0;
  margin: 12vh auto 0;
  padding: 0;
  background: #fff;
  -webkit-border-radius: 8px;
  border-radius: 8px;
  -webkit-box-shadow: 0 20px 60px rgba(17, 24, 39, 0.25);
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.25);
  overflow: hidden;
  font-family: 'Quicksand', sans-serif;
}

.alertify .ajs-dialog .ajs-header {
  position: relative;
  margin: 0;
  padding: 28px 56px 0 84px;
  min-height: 44px;
  background: #fff;
  border: 0;
  -webkit-border-radius: 0;
  border-radius: 0;
  color: #000;
  font-family: 'Quicksand', sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  text-transform: none;
  letter-spacing: 0;
}

/* Icon tròn bên trái tiêu đề */
.alertify .ajs-dialog .ajs-header::before {
  content: "\f05a"; /* fa-info-circle */
  font-family: FontAwesome, sans-serif;
  font-weight: normal;
  position: absolute;
  left: 28px;
  top: 24px;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-size: 20px;
  color: #0674ec;
  background: rgba(6, 116, 236, 0.1);
  -webkit-border-radius: 50%;
  border-radius: 50%;
}

.alertify .ajs-dialog .ajs-body {
  padding: 6px 28px 0 84px;
  min-height: 0;
}

.alertify .ajs-dialog .ajs-body .ajs-content {
  padding: 0;
  color: #555555;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 24px;
}

.alertify .ajs-dialog .ajs-body .ajs-content p:last-child {
  margin-bottom: 0;
}

.alertify .ajs-dialog .ajs-footer {
  margin: 0;
  padding: 24px 28px 28px;
  min-height: 0;
  background: #fff;
  border: 0;
  -webkit-border-radius: 0;
  border-radius: 0;
}

.alertify .ajs-dialog .ajs-footer .ajs-buttons.ajs-primary {
  text-align: right;
}

.alertify .ajs-dialog .ajs-footer .ajs-buttons .ajs-button {
  min-width: 96px;
  height: 42px;
  min-height: 0;
  margin: 0 0 0 10px;
  padding: 0 26px;
  border: 1px solid #e4e5ea;
  -webkit-border-radius: 100px;
  border-radius: 100px;
  background: #fff;
  color: #555555;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 40px;
  text-transform: none;
  -webkit-transition: background .2s, box-shadow .2s, color .2s;
  transition: background .2s, box-shadow .2s, color .2s;
}

.alertify .ajs-dialog .ajs-footer .ajs-buttons .ajs-button:hover {
  background: #f4f5f8;
}

.alertify .ajs-dialog .ajs-footer .ajs-buttons .ajs-button.ajs-ok {
  border-color: #0674ec;
  background: #0674ec;
  color: #fff;
  -webkit-box-shadow: 0 4px 20px rgba(6, 116, 236, 0.3);
  box-shadow: 0 4px 20px rgba(6, 116, 236, 0.3);
}

.alertify .ajs-dialog .ajs-footer .ajs-buttons .ajs-button.ajs-ok:hover {
  background: #0563cb;
  border-color: #0563cb;
}

.alertify .ajs-dialog .ajs-footer .ajs-buttons .ajs-button:focus {
  outline: 0;
  -webkit-box-shadow: 0 0 0 3px rgba(6, 116, 236, 0.25);
  box-shadow: 0 0 0 3px rgba(6, 116, 236, 0.25);
}

/* Nút đóng (×) góc phải */
.alertify .ajs-dialog .ajs-commands {
  margin: 18px 18px 0 0;
}

.alertify .ajs-dialog .ajs-commands button.ajs-close {
  width: 30px;
  height: 30px;
  opacity: .5;
  -webkit-border-radius: 50%;
  border-radius: 50%;
}

.alertify .ajs-dialog .ajs-commands button.ajs-close:hover {
  opacity: 1;
  background-color: #f4f5f8;
}

@media (max-width: 575px) {
  .alertify .ajs-dialog {
    margin: 16vh 16px 0;
  }

  .alertify .ajs-dialog .ajs-header {
    padding: 24px 48px 0 72px;
    font-size: 18px;
  }

  .alertify .ajs-dialog .ajs-header::before {
    left: 20px;
    top: 20px;
  }

  .alertify .ajs-dialog .ajs-body {
    padding: 6px 20px 0 72px;
  }

  .alertify .ajs-dialog .ajs-footer {
    padding: 20px;
  }

  .alertify .ajs-dialog .ajs-footer .ajs-buttons .ajs-button {
    width: 100%;
    margin: 8px 0 0;
  }
}
