/*!
 * ABC Premiums – Styles
 * Version: 2.3.7
 * Author: Rip Noel / Abacus Arts, Inc.
 */

/* ---------- Container ---------- */
.abc-prem {
  max-width: 1100px;
  margin: 0 auto;
  /* ensure our section can sit above a fixed site header if needed */
  position: relative;
  z-index: 2147483646;
}

/* ---------- Inline filter row ---------- */
.abc-row--filters,
.abc-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
  justify-content: center;
  margin: 14px 0 8px;
}
.abc-row--filters label,
.abc-filters label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 14px;
  color: #333;
}
.abc-row--filters select,
.abc-row--filters input[type="date"] {
  min-width: 160px;
  padding: 7px 10px;
  border: 1px solid #cfd6e4;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.abc-filters select,
.abc-filters input[type="date"] {
  min-width: 130px; /* narrower on public side */
  padding: 6px 9px;
  font-size: 13px;
  border: 1px solid #cfd6e4;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ---------- Uploader fieldset ---------- */
.abc-fieldset {
  border: none;
  margin: 10px 0 6px;
  padding: 0;
  display: flex;
  gap: 28px;
  justify-content: center;
}
.abc-fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-direction: row-reverse;
  font-weight: 600;
}
.abc-fieldset input[type="radio"] {
  accent-color: #1a337a;
}

/* ---------- Upload/link blocks ---------- */
#abc-file-wrap, #abc-link-wrap {
  text-align: center;
  margin: 6px 0 12px;
}
#abc-link-wrap input[type="url"] {
  width: 60%;
  max-width: 560px;
  padding: 8px 10px;
  border: 1px solid #cfd6e4;
  border-radius: 6px;
}
.abc-hidden { display: none; }

/* ---------- Submit button ---------- */
#abc-prem-form button[type="submit"] {
  display: block;
  margin: 0 auto 14px;
  background: #13307a;
  border: none;
  color: #fff;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
#abc-prem-form button[type="submit"]:hover { opacity: .92; }

/* ---------- Messages ---------- */
#abc-prem-success {
  text-align: center;
  margin: 6px 0;
  font-weight: 600;
  color: #1b7f1b;
}
#abc-prem-success.abc-error { color: #b32d2e; }

/* ---------- Table ---------- */
.abc-prem-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
.abc-prem-table th, .abc-prem-table td {
  border: 1px solid #e7eaf2;
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}
.abc-prem-table thead .abc-prem-header th {
  background-color: #1a337a !important;
  color: #fff !important;
  border-color: #1a337a !important;
  font-weight: 700;
}
.abc-prem-table tbody tr:nth-child(even) { background: #f7f9fc; }

/* ---------- Action buttons ---------- */
.abc-prem-table .abc-delete,
.abc-prem-table .abc-del-btn {
  background: #d73a34;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px 11px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.abc-prem-table .abc-delete:hover,
.abc-prem-table .abc-del-btn:hover { background: #bf2f2a; }

.abc-prem-table .abc-edit,
.abc-prem-table .abc-edit-btn {
  background: #1b7f1b;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px 11px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.abc-prem-table .abc-edit:hover,
.abc-prem-table .abc-edit-btn:hover { background: #156915; }

/* ---------- Modal (Edit) ---------- */
#abc-edit-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: flex-start;
  justify-content: center;
  /* sit above any site header / builder chrome */
  z-index: 2147483647;
  overflow-y: auto;
}

/* When we explicitly toggle .open */
#abc-edit-modal.open { display: flex; }

/* Fallback: if jQuery .show() adds inline display:block, force flex centering */
#abc-edit-modal[style*="display: block"] { display: flex !important; }

body.modal-open { overflow: hidden; }

#abc-edit-modal .abc-modal-content {
  background: #fff;
  width: 92%;
  max-width: 620px;
  border-radius: 10px;
  box-shadow: 0 14px 48px rgba(0,0,0,0.45);
  padding: 18px 18px 16px;
  text-align: center;
  margin-top: 350px !important; /* drop modal 350px on desktop */
}

/* Labels */
#abc-edit-modal .abc-modal-content label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
  font-weight: 600;
  color: #333;
}
#abc-edit-modal select,
#abc-edit-modal input[type="date"] {
  width: auto !important;
  min-width: 200px;
  max-width: 360px;
  padding: 7px 10px;
  border: 1px solid #cfd6e4;
  border-radius: 6px;
  background: #fff;
  margin: 0 auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Modal action buttons */
#abc-edit-modal .abc-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}
#abc-edit-modal .abc-btn-save,
#abc-edit-modal button[type="submit"] {
  background: #1b7f1b;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
#abc-edit-modal .abc-btn-save:hover,
#abc-edit-modal button[type="submit"]:hover { background: #156915; }

#abc-edit-modal .abc-btn-cancel,
#abc-edit-modal #edit-cancel {
  background: #d73a34;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
#abc-edit-modal .abc-btn-cancel:hover,
#abc-edit-modal #edit-cancel:hover { background: #bf2f2a; }

/* ---------- Responsive ---------- */
@media (max-width: 1540px) {
  .abc-row--filters, .abc-filters { flex-wrap: wrap; }
  .abc-row--filters select,
  .abc-row--filters input[type="date"],
  .abc-filters select,
  .abc-filters input[type="date"] {
    min-width: 150px;
  }
  #abc-link-wrap input[type="url"] { width: 92%; }
}
@media (max-width: 768px) {
  #abc-edit-modal .abc-modal-content { margin-top: 200px !important; }
}
@media (max-width: 520px) {
  .abc-row--filters label, .abc-filters label { width: 100%; }
  #abc-edit-modal .abc-modal-content { margin-top: 120px !important; }
}

/* ---------- Scroll wrapper for tables ---------- */
#abc-prem-list {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#abc-prem-list table {
  min-width: 600px;
  width: 100%;
  border-collapse: collapse;
}