/*!
 *   Custom CSS
 */
body {
  background-image: url('/admin/img/bg.jpg');
}

#particles-js {
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
}

.textblur-black {
  /* color:rgba(0,0,0,0);
    text-shadow:0 0 8px rgba(0,0,0,1); */
  filter: blur(3px);
  -webkit-filter: blur(3px);
}

.alert-float {
  position: absolute;
  top: 0;
  z-index: 9999;
}

@media (min-width: 576px) {
  .modal-sm {
    max-width: 80%;
  }
}

@media (min-width: 992px) {

  .modal-lg,
  .modal-xl {
    max-width: 80%;
  }
}

@media (min-width: 1200px) {
  .modal-xl {
    max-width: 80%;
  }
}


.btn-purple {
  color: #ffffff;
  background-color: #6f42c1;
}

.badge-purple {
  color: #ffffff;
  background-color: #6f42c1;
}

a.badge-purple:hover,
a.badge-purple:focus {
  color: #ffffff;
  background-color: #492788;
}

a.badge-purple:focus,
a.badge-purple.focus {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(145, 44, 185, 0.5);
}

.text-warp {
  word-break: break-all;
  word-wrap: break-word;
}

.double-del-line {
  text-decoration: line-through double;
}

.bg-light-yellow {
  background-color: #ffeaaa;
}

.custom-file-input:lang(en)~.custom-file-label::after {
  content: "Browse";
}

.custom-file-input~.custom-file-label[data-browse]::after {
  content: attr(data-browse);
}

.custom-file-label::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: block;
  height: 2.25rem;
  padding: 0.375rem 0.75rem;
  line-height: 1.5;
  color: #495057;
  content: "瀏覽";
  background-color: #e9ecef;
  border-left: inherit;
  border-radius: 0 0.25rem 0.25rem 0;
}

.img-thumbnail.fixed-height {
  height: 120px;
  width: auto;
  object-fit: contain;
}

.img-order-badge {
  position: absolute;
  top: 5px;
  left: 5px;
}

.img-remove-button {
  position: absolute;
  top: 5px;
  right: 5px;
}

.fixed-height {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

#uploaded-images {
  min-height: 180px;
}

.img-placeholder {
  pointer-events: none;
}

.img-order-badge {
  font-size: 1.25rem;
  padding: 0.4rem 0.7rem;
  border-radius: 0.3rem;
}

.btn-left-top {
  top: 5px;
  left: 5px;
  z-index: 10;
}

.btn-right-top {
  top: 5px;
  right: 5px;
  z-index: 10;
}

.btn-left-bottom {
  bottom: 5px;
  left: 5px;
  z-index: 10;
}

.btn-right-bottom {
  bottom: 5px;
  right: 5px;
  z-index: 10;
}

.cursor-pointer {
  cursor: pointer;
}

table td img {
  max-width: 50% !important;
  height: auto !important;
  width: auto !important;
  /* 移除原本 width=xxx */
}

/* Flex 排版：卡片可自由換行、sortable 正確運作 */
#sortableProducts {
  display: flex;
  flex-wrap: wrap;
}

/* 一行 8 個（100% / 8 = 12.5%） */
.product-card {
  width: 12.5%;
  padding: 5px;
  cursor: move;
  box-sizing: border-box;
}

/* 圖片：固定高、不可拖曳（避免搶走 sortable 事件） */
.product-img {
  height: 100px;
  width: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

/* 商品名稱自動換行（兩行高度） */
.product-name {
  font-size: 12px;
  line-height: 1.2;
  white-space: normal;
  word-break: break-all;
  height: 32px;
  overflow: hidden;
}

/* 拖曳 placeholder（大小與卡片一致） */
.sortable-placeholder {
  width: 12.5%;
  height: 150px;
  margin: 5px;
  border: 2px dashed #999;
  background: #f3f3f3;
}

/* 移除按鈕：右上角、圓形、FontAwesome */
.remove-product-btn {
  border-radius: 50%;
  padding: 4px 6px !important;
  top: 5px !important;
  right: 5px !important;
}

.js-page-sortable tr {
  cursor: move;
}

.js-page-sortable .ui-sortable-placeholder {
  visibility: visible !important;
  outline: 2px dashed #17a2b8;
  background-color: rgba(23, 162, 184, 0.1);
  height: 56px;
}

/* Dynamic page form styles moved from show blade */
.card-form {
  border: none;
  border-radius: 16px;
}
.card-form .card-body {
  padding: 2rem;
}
.form-section {
  border: 1px solid #e8ebf3;
  border-radius: 18px;
  padding: 1.5rem;
  background: #fdfdfd;
  box-shadow: inset 0 0 8px rgba(123, 138, 255, 0.08);
}
.form-section + .form-section {
  margin-top: 1.5rem;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.section-title {
  font-weight: 700;
  color: #1b2a4f;
}
.section-subtitle {
  font-size: 0.92rem;
}
.badge-primary {
  background: linear-gradient(120deg, #5a7dff, #7f9dff);
  box-shadow: 0 6px 14px rgba(85, 118, 255, 0.4);
  font-weight: 600;
  padding: 0.4rem 0.75rem;
}
.page-form .form-group label {
  font-weight: 600;
  color: #31436f;
}
.btn-outline-secondary {
  border-width: 2px;
}

/* System settings panel layout */
.system-settings-card-body {
  padding: 1.5rem 2rem;
}
.system-settings-section {
  background: #ffffff;
  border: 1px solid #e5e9f3;
  border-radius: 16px;
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
.system-settings-section + .system-settings-section {
  margin-top: 1.25rem;
}
.system-settings-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #162240;
  margin-bottom: 1rem;
}
.system-settings-section-header {
  border-bottom: 1px solid #e5e9f3;
  margin-bottom: 1rem;
}
.section-toggle {
  width: 100%;
  padding: 0.65rem 0;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 1.15rem;
  font-weight: 700;
  color: #162240;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.section-toggle:hover,
.section-toggle:focus {
  text-decoration: none;
}
.section-toggle-icon {
  transition: transform 0.2s ease;
}
.section-toggle-icon.open {
  transform: rotate(180deg);
}
.system-settings-subsection-title {
  font-weight: 600;
  color: #2a334d;
  margin-bottom: 0.75rem;
  display: block;
}
.system-settings-section .form-group label {
  font-weight: 600;
  color: #31436f;
  margin-bottom: 0.35rem;
}
.system-settings-section .row + .row {
  margin-top: 1rem;
}

.checkips-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9ff;
  border-radius: 20px;
  padding: 1rem 1.5rem;
  border: 1px solid #dde2ef;
}
.checkips-panel-switch {
  flex: 0 0 auto;
}
.checkips-panel-content {
  flex: 1 1 auto;
  margin-left: 1.25rem;
}
.checkips-panel-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.checkips-panel-note {
  margin-bottom: 0.5rem;
}
.checkips-panel-list {
  margin: 0;
  padding-left: 1.25rem;
  color: #4b5663;
}
.checkips-card-layout {
  border-radius: 20px;
  border: none;
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.08);
}
.checkips-toggle-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.checkips-toggle-label {
  font-size: 1rem;
  font-weight: 700;
  color: #1b2a4f;
}
.checkips-toggle-control {
  margin-left: 0.75rem;
}
.checkips-info {
  padding-left: 0.5rem;
}
.checkips-info-list {
  list-style: disc;
  margin: 0;
  padding-left: 1.1rem;
}
.checkips-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: #f9fbff;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  border: 1px solid #dfe4ed;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.checkips-panel-switch {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkips-panel-content {
  flex: 1;
}

.checkips-panel-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.checkips-panel-note {
  margin-bottom: 0.75rem;
  color: #5f6575;
}

.checkips-panel-list {
  list-style: disc;
  margin: 0;
  padding-left: 1.2rem;
  color: #4b5663;
  line-height: 1.6;
}

.checkips-tablebox {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #dfe4ed;
  padding: 1rem 1.25rem;
  box-shadow: inset 0 0 0 1px transparent, 0 12px 28px rgba(15, 23, 42, 0.03);
  margin-top: 0.75rem;
}

.checkips-tablebox .table {
  margin-bottom: 0;
}

.checkips-tablebox .table thead th,
.checkips-tablebox .table thead tr {
  border-bottom: none;
}

.checkips-tablebox .table tbody tr {
  border-bottom: none;
}

.checkips-tablebox .form-control {
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
}

.checkips-tablebox .btn-primary {
  border-radius: 999px;
  padding: 0.35rem 1.25rem;
}

.ip-table-label {
  padding-bottom: 0.65rem;
}

.ip-table-wrapper {
  width: 100%;
}

.ip-new-row {
  background-color: #f7fafc;
}

.ip-error-row {
  background-color: #fff5f5;
}

.ip-new-row input.form-control {
  min-width: 0;
}

@media (max-width: 768px) {
  .ip-table-label {
    text-align: left;
  }
}
