#wcf-template-library > .dialog-widget-content {
  width: 100%;
  max-width: 1200px;
}
#wcf-template-library .elementor-templates-modal__header__logo-area {
  width: 55px;
  height: 40px;
  background-image: url(../images/logo-big.png);
  background-position: right center;
  background-size: contain;
  background-repeat: no-repeat;
}
.aaeplugin-activate {
  background: transparent;
}

#wcf-template-library-filter-text {
  border: none;
  border-block-end: var(--e-a-border-bold);
  border-radius: 0;
  font-size: 11px;
  padding: 8px 15px 8px 0;
  transition: border 0.5s;
}
#wcf-template-library-filter-subtype {
  min-width: 150px;
}
#wcf-template-library-color-subtype {
  min-width: 150px;
}

#wcf-template-library-header-preview-back {
  padding: 15px;
  border-inline-end: 1px solid #e6e8ea;
  cursor: pointer;
  transition: color 0.5s;
}

.library--action {
  display: block;
  padding: 7px 0 10px;
  border-width: 0;
  font-family: Roboto, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 14px;
  transition: color 0.3s, opacity 0.3s, visibility 0.3s;
  cursor: pointer;
  z-index: 1;
  &.pro {
    color: #f12529;
  }
  &.insert {
    color: black;
    background-color: orange;
    padding: 7px;
    border-radius: 5px;
  }
}

#wcf-template-library .dialog-message {
  overflow-y: scroll;
}
.wcf-library-templates {
  column-count: 1;
  gap: 20px;
  margin-top: 25px;
  padding-bottom: 100px;

  @media (min-width: 576px) {
    column-count: 2;
  }

  @media (min-width: 768px) {
    column-count: 3;
  }

  @media (min-width: 992px) {
    column-count: 4;
  }
}

.wcf-library-template {
  background-color: #fff;
  position: relative;
  padding: 8px;
  border-radius: 3px;
  border: 1px solid #e6e8ea;
  text-align: left;
  margin-bottom: 20px;
  break-inside: avoid;

  .thumbnail {
    line-height: 0;
    background-color: #ddd;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top center;
    position: relative;
    max-height: 400px;
    overflow: hidden;
    img {
      line-height: 0;
      width: 100%;
      max-width: 100%;
    }

    &:before {
      content: "\e92e";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #d5dadf;
      background-color: rgba(0, 0, 0, 0.5);
      font-family: eicons;
      font-size: 20px;
      font-weight: 400;
      line-height: 20px;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s, visibility 0.3s;
      cursor: pointer;
      z-index: 1;
    }

    &:hover:before {
      opacity: 1;
      visibility: visible;
    }
  }

  .title {
    margin-bottom: 0;
    padding-top: 5px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    transition: opacity 0.3s;
  }

  .library--action {
    position: absolute;
    left: 8px;
    bottom: 0;
    opacity: 0;
    visibility: hidden;
  }

  &:hover .library--action {
    opacity: 1;
    visibility: visible;
  }

  &:hover .title {
    opacity: 0;
  }

  // V4 / Animated badges — same look as the dashboard's starter-template cards.
  .aae-tl-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
    pointer-events: none;
  }
  .aae-tl-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px;
    border-radius: 4px;
    font-family: Roboto, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff;
    &--v4 {
      background: #6366f1;
    }
    &--animated {
      background: #0fb981;
    }
  }

  // A V4 block on an editor that cannot render atomic elements.
  .library--action.insert[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    background-color: #c9ccd1;
    color: #333;
  }
  &:hover .library--action.insert[disabled] {
    opacity: 0.55;
  }
}

#wcf-template-library-builder {
  min-width: 170px;
}

.wcf-library-templates .aae-tl-empty {
  column-span: all;
  margin: 40px 0;
  text-align: center;
  color: #6d7882;
  font-size: 14px;
}

// Under the toolbar: why an era is not listed, and where to switch its widgets on.
.aae-tl-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid #d5d8dc;
  border-inline-start: 3px solid #524cff;
  border-radius: 4px;
  background: #f7f7fb;
  font-family: Roboto, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #3f444b;
  i {
    margin-top: 2px;
    color: #524cff;
  }
  a {
    color: #524cff;
    font-weight: 500;
    text-decoration: underline;
  }
}

// The dependency dialog: what a block/page uses that is switched off here.
#aae-tl-deps-dialog {
  > .dialog-widget-content {
    width: 480px;
    max-width: calc(100vw - 40px);
    border-radius: 8px;
  }
  .dialog-message {
    padding: 0;
    text-align: start;
  }
}

.aae-tl-deps {
  padding: 28px 28px 24px;
  font-family: Roboto, Arial, sans-serif;
  color: var(--e-a-color-txt-accent, #0c0d0e);

  &__title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
  }
  &__body,
  &__note {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--e-a-color-txt, #515962);
  }
  &__note {
    margin: 12px 0 0;
  }
  &__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--e-a-border-color, #e6e8ea);
    border-radius: 6px;
  }
  &__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    font-size: 13px;
    line-height: 1.4;
    border-top: 1px solid var(--e-a-border-color, #e6e8ea);
    &:first-child {
      border-top: 0;
    }
    &.is-unavailable {
      color: var(--e-a-color-txt-muted, #9da5ae);
    }
  }
  &__label {
    font-weight: 500;
  }
  &__kind {
    flex: 0 0 auto;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--e-a-color-txt-muted, #6d7882);
    .is-unavailable & {
      text-transform: none;
      letter-spacing: 0;
      color: var(--e-a-color-danger, #b0141a);
      flex: 1 1 auto;
      text-align: end;
    }
  }
  &__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
  }
  &__btn {
    appearance: none;
    border: 0;
    border-radius: 4px;
    padding: 0 16px;
    height: 36px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 36px;
    cursor: pointer;
    &--cancel {
      background: var(--e-a-bg-hover, #f1f3f5);
      color: var(--e-a-color-txt-accent, #0c0d0e);
      &:hover {
        background: var(--e-a-bg-active, #e6e8ea);
      }
    }
    &--enable {
      background: #524cff;
      color: #fff;
      &:hover {
        background: #3f39f0;
      }
    }
  }
}

.wcf-template-library--loading {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fcfcfc;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1);
  z-index: 2;
  transition: opacity 0.3s, visibility 0.3s;
}
.wcf-template-library--loading[hidden] {
  opacity: 0;
  visibility: hidden;
}

// Elementor's "Choose how to apply styles" dialog (opened on insert of a
// block that carries classes / variables). Elementor hardcodes its colours
// for the LIGHT UI, while the lightbox card takes the theme's background —
// so in the editor's dark mode the words were dark grey on a dark card.
// Re-point its own --gsd-* tokens at Elementor's theme tokens, which flip
// with the UI theme; in light mode they resolve to the same colours as before.
// `body` lifts it one step above Elementor's own rule, whatever the load order.
body .elementor-global-styles-dialog {
  --gsd-color-text-primary: var(--e-a-color-txt-accent, #0c0d0e);
  --gsd-color-text-secondary: var(--e-a-color-txt-hover, #3f444b);
  --gsd-color-text-tertiary: var(--e-a-color-txt-muted, #69727d);
  --gsd-color-divider: var(--e-a-border-color, rgba(0, 0, 0, 0.12));
  --gsd-color-secondary-main: var(--e-a-color-txt, #515962);

  // The Insert button is a light pink in both themes; its label must stay dark.
  .elementor-global-styles-dialog__button-insert {
    color: #0c0d0e;
  }

  .elementor-global-styles-dialog__button-cancel:hover {
    background: var(--e-a-bg-hover, rgba(0, 0, 0, 0.04));
  }
}
