/* src/assets/css/blocksmith.css */

.blocksmith-menu-item.menu-item::before {
  margin-bottom: 2px;
}
.blocksmith-add-btn.btn.icon.add::before {
  margin-bottom: -1px;
}

/* ####################### */
/* ### Plugin Settings ### */
/* ####################### */

.blocksmith-zilch {
  color: var(--light-text-color);
  padding-block: 100px;
  padding-inline: 0;
  text-align: center;
}

.blocksmith-zilch-text {
  font-size: 20px;
  line-height: 24px;
}

.blocksmith-zilch-text-small {
  font-size: 16px;
  line-height: 22px;
}

.blocksmith-zilch .btn {
  margin-top: 1rem;
}

.blocksmith-hint {
  margin-bottom: 20px;
  padding: 10px 15px;
  border: 1px solid #f7e6bc;
  border-radius: 5px;
  background-color: #fefce8;
  color: #8d5104;
  font-size: 13px;
}

/* Settings Wrapper Layout */
.blocksmith-settings-wrapper {
  display: flex;
  gap: 20px;
  overflow: scroll;
}

/* Content Styling */
.blocksmith-settings-content {
  flex: 1;
  padding: 20px;
}

/* Block Settings Overview */

.blocksmith-block-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 4rem;
}

.blocksmith-block-card-horizontal {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 800px;
  padding: 16px;
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.blocksmith-block-content {
  display: flex;
  align-items: flex-start;
}

.blocksmith-card-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
}

.blocksmith-block-image {
  flex-shrink: 0;
  width: 220px;
  height: 165px;
  aspect-ratio: auto;
  margin-right: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.blocksmith-block-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f7f7f7;
}

.blocksmith-blocktype-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.blocksmith-block-details {
  flex-grow: 1;
}

.blocksmith-block-details .blocksmith-blockname {
  margin: 0px;
  font-size: 16px;
  font-weight: 700;
}
.blocksmith-badge-label {
  font-weight: normal;
  font-size: 13px;
  margin-right: 4px;
  color: #555;
}

.blocksmith-badge {
  align-items: center;
  border: 1px solid var(--hairline-color);
  border-radius: var(--small-border-radius);
  color: var(--medium-text-color);
  cursor: pointer;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: var(--xs);
  line-height: 1;
  padding-block: var(--xs);
  padding-inline: calc(var(--xs) + 1px);
}

.blocksmith-copytextbtn__icon[data-icon="check"] {
  color: green;
  transition: color 0.3s ease-in-out;
  width: 9.5px;
  height: 12.5px;
}

.blocksmith-blocktype-header .blocksmith-badge.blocksmith-category {
  background-color: #e5f4ff;
}

.blocksmith-block-description {
  margin: 0 0 4px;
  font-size: 14px;
}

.blocksmith-block-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.blocksmith-matrix-field-badge {
  background-color: #fefce8;
  margin-right: 4px;
  margin-bottom: 0.5rem;
  cursor: default;
  font-size: 0.8em !important;
}

.blocksmith-category-badge {
  background-color: #e5f4ff;
  margin-right: 4px;
  cursor: default;
  font-size: 0.8em !important;
}

@media only screen and (max-width: 800px) {
  .blocksmith-block-card-horizontal {
    position: relative;
  }
  .blocksmith-block-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 48px;
  }
  .blocksmith-block-image {
    flex-shrink: 0;
    width: 100%;
    height: auto;
    aspect-ratio: unset;
    margin-right: 0;
    margin-bottom: 2rem;
  }
  .block-actions {
    position: absolute;
    top: 16px;
    right: 16px;
  }
  .blocksmith-block-details {
    margin-bottom: 2rem;
  }

  .blocksmith-card-footer {
    flex-direction: column;
    gap: 8px;
  }
  .blocksmith-category-badges {
    display: flex;
    flex-wrap: wrap;
  }
}

@media only screen and (min-width: 800px) {
  .blocksmith-wide-view .blocksmith-block {
    width: 32%;
  }
}

/* Block Settings */
.blocksmith-section-header.blocksmith-edit-block {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-end: 22px;
}
.blocksmith-section-header.blocksmith-edit-block h1 {
  margin: 0;
}

.blocksmith-preview-image {
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  overflow: hidden;
  background: #f7f7f7;
  width: 200px;
  height: auto;
  margin-top: 1rem;
  aspect-ratio: 3 / 2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.blocksmith-preview-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.blocksmith-settings-wrapper .field {
  margin-bottom: 1.5rem;
}

.blocksmith-settings-wrapper .field label {
  display: block;
  font-weight: bold;
}
.blocksmith-settings-wrapper .field label {
  display: block;
  font-weight: bold;
}

.blocksmith-settings-wrapper .field .instructions {
  margin-bottom: 0.5rem;
}

.blocksmith-settings-wrapper .field input,
.blocksmith-edit-wrapper .field textarea,
.blocksmith-edit-wrapper .field select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.blocksmith-settings-wrapper .buttons {
  display: flex;
  justify-content: space-between;
}

.blocksmith-settings-wrapper .buttons .btn {
  padding: 0.75rem 1.5rem;
  text-transform: uppercase;
  font-size: 14px;
}
.blocksmith-matrix-badges {
  display: flex;
  gap: 5px;
}

.blocksmith-settings-wrapper .tablepane {
  margin-inline: unset;
}

.blocksmith-settings-wrapper table.data td,
table.data th {
  box-sizing: border-box;
  padding-inline: 25px;
  position: relative;
}

/* ##################### */
/* ### Preview Modal ### */
/* ##################### */

body .blocksmith-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  background: white;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 90% !important;
  max-width: 1100px !important;
  height: 90% !important;
  max-height: 90% !important;
  overflow: auto;
}

.blocksmith-modal .blocksmith-hint {
  display: none;
  color: #d9534f;
  margin-top: 5px;
  font-size: 0.85em;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.blocksmith-modal img.image-error + .blocksmith-footer .blocksmith-hint {
  display: block;
}

.notice {
  position: relative;
  padding: 10px;
  border: 1px solid #ccc;
  background-color: #f9f9f9;
  border-radius: 4px;
  margin-bottom: 10px;
}

.notice .close-notice {
  position: absolute;
  top: 5px;
  right: 10px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.blocksmith-modal-content {
  text-align: center;
  height: calc(100% - 60px);
  padding: 20px;
  overflow-y: auto;
}

.blocksmith-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.tab-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

.blocksmith-tab {
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 5px 15px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
}

.blocksmith-tab:hover {
  background-color: #e5e5e5;
}

.blocksmith-tab.active {
  background-color: #bcdbff;
  border-color: #a5c5ff;
  font-weight: bold;
}

#blocksmith-categories-vue-admin-table .zilch {
  padding-block: 20px;
}

.categories-container {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.blocksmith-category-badge {
  background-color: #e5f4ff;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 0.9em !important;
}

.blocksmith-category-badge:hover {
  background-color: #bcdbff;
}

.blocksmith-category-badge.active {
  background-color: #bcdbff;
  border-color: #a5c5ff;
}

.blocksmith-category-badge.all-categories {
  background-color: #e5f4ff;
}

.blocksmith-category-badge.all-categories:hover {
  background-color: #bcdbff;
}

.blocksmith-category-badge.all-categories.active {
  background-color: #bcdbff;
  border-color: #a5c5ff;
}

.footer.blocksmith-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-block: 6px;
  padding-inline: var(--pane-padding, var(--xl));
  background-color: var(--gray-100);
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  border-radius: 0 0 var(--large-border-radius) var(--large-border-radius);
  box-shadow: inset 0 1px 0 var(--hairline-color);
  z-index: 1002;
}

.blocksmith-blocks {
  display: block;
  margin-top: 20px;
}

.blocksmith-block-gutter {
  width: 2%;
}

.blocksmith-block.blocksmith-block-hidden {
  opacity: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.blocksmith-block {
  cursor: pointer;
  max-width: 500px;
  width: 49%;
}

.blocksmith-block-inner {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

@media (max-width: 1177px) {
  .blocksmith-block {
    max-width: 100%;
  }
}

.blocksmith-block img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
  margin-bottom: 10px;
}

.blocksmith-block:hover .blocksmith-block-inner {
  transform: translateY(-3px);
  box-shadow: 0 4px 9px rgba(0, 0, 0, 0.2);
}

.blocksmith-block span {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  display: block;
  margin-bottom: 5px;
}

.blocksmith-footer {
  min-height: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ####################### */
/* ### Matrix Extended ### */
/* ####################### */

.matrix-extended-buttons {
  display: none !important;
}

.matrix-extended-buttons-above.matrix-extended-buttons,
.matrix-extended-buttons.blocksmith-preview-disabled {
  display: flex !important;
}

ul.matrix-extended > li > button[data-action="add-block"] {
  display: none !important;
}

ul.matrix-extended.blocksmith-preview-disabled
  > li
  > button[data-action="add-block"] {
  display: flex !important;
}

.nested-element-cards .matrix-extended-buttons.blocksmith-preview-disabled,
.nested-element-cards:not(.blocksmith-initialized) .matrix-extended-buttons {
  display: flex !important;
}

/* ####################### */
/* ### Button Group ### */
/* ####################### */
.blocksmith-btngroup {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.blocksmith-btngroup .btngroup {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  gap: 0.3rem;
  min-width: 0;
}

.blocksmith-btngroup .btngroup .btn.dashed {
  border: 1px dashed rgba(96, 125, 159, 0.5);
}

.blocksmith-btngroup .btngroup .btn {
  border-radius: var(--button-border-radius);
}

.blocksmith-insert-marker {
  margin-bottom: 0.3rem;
  width: 100%;
}

.blocksmith-insert-anchor {
  position: relative;
  height: 0;
  width: 100%;
}

.blocksmith-floating-btngroup {
  position: absolute;
  bottom: calc(100% + 6px);
  left: -16px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: left;
  gap: 0.5rem;
  pointer-events: auto;
  width: fit-content;
  padding: 5px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(20px);
  border: 1px dashed rgba(96, 125, 159, 0.5);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.blocksmith-floating-btngroup::after {
  content: "";
  position: absolute;
  top: calc(100% + 3px);
  left: 5px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #3f4d5a;
}

.blocksmith-floating-btngroup .btn.dashed {
  background-color: white;
}

.blocksmith-floating-btngroup.btns-removed {
  visibility: hidden;
  background: transparent !important;
  backdrop-filter: unset;
}

.blocksmith-floating-btngroup.btns-removed::after {
  visibility: visible;
}
