/**
 * The following styles get applied inside the editor only.
 *
 * Replace them with your own styles or remove the file completely.
 */

.splide:not(.is-overflow) .splide__pagination{
  display: flex;
}

.wp-block-block-and-function-orphic-block-and-function {
	border: 1px dotted #f00;
}

.wp-block-orphic-ui-carousel {
  position: relative;
  margin: 2rem 0;
  padding-bottom: 60px; // Espace pour le bouton

  // Bouton d'ajout de slide
  .add-slide-button {
    position: absolute !important;
    bottom: 0 !important;
    right: 20px !important;
    z-index: 1000 !important;
    background: white!important;
    color: #1d2327!important;
    border: 1px solid black!important;
    padding: 8px 16px;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    
    &:hover {
      color: #007cba!important;
      border-color: #007cba!important;
    }
  
    &:focus {
      box-shadow: 0 0 0 1px #1d2327, 0 0 0 3px #f3f4f6;
      outline: none;
    }
  }
}

.orphic-ui-carousel {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 20px 0;

  &-container {
    position: relative;
    width: 100%;
    background: #fff;
  }

  &-buttons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex !important;
    justify-content: space-between;
    pointer-events: none;
    padding: 0 10px;
    z-index: 10;
    opacity: 1 !important;
  }

  &-button {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    opacity: 0.6;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #333;

    &:hover {
      opacity: 1;
      background: rgba(255, 255, 255, 0.95);
    }

    &:focus {
      outline: none;
    }

    &.prev {
      left: -1.5em;
    }

    &.next {
      right: -1.5em;
    }

    @media (max-width: 768px) {
      width: 40px;
      height: 40px;

      &.prev {
        left: -0.5em;
      }

      &.next {
        right: -0.5em;
      }
    }
  }

  &-slider {
    overflow-x: scroll;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding: 10px 0;

    &::-webkit-scrollbar {
      display: none;
    }

    > .block-editor-inner-blocks {
      overflow: visible;

      > .block-editor-block-list__layout {
        display: flex;
        gap: 20px;
        width: max-content;
        min-width: 100%;
        padding: 0 10px;

        > .block-list-appender {
          display: none;
        }

        > .wp-block-orphic-ui-carousel-slide {
          flex: 0 0 var(--slide-width, calc((100% - 40px) / 2));
          width: var(--slide-width, calc((100% - 40px) / 2));
          scroll-snap-align: start;
          scroll-snap-stop: always;
        }
      }
    }
  }
}

.wp-block-orphic-ui-carousel-slide {
  display: flex;
  flex-direction: column;

  &-content {
    height: 100%;
    width: 100%;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;

    .block-editor-inner-blocks,
    .block-editor-block-list__layout {
      height: 100%;
    }

    .block-editor-rich-text__editable {
      margin: 0;

      &.wp-block-heading {
        margin-bottom: 1rem;
      }
    }
  }
}

// Style de pagination simple
.splide__pagination {
  bottom: -2rem;
  padding: 1rem 0;

  &__page {
    width: 10px;
    height: 10px;
    background: #d1d1d1;
    border: none;
    border-radius: 50%;
    margin: 0 6px;
    transition: all 0.2s ease;
    opacity: 1;

    &.is-active {
      transform: none;
      background: #333;
    }

    &:hover {
      opacity: 1;
      background: #999;
    }
  }
}

.orphic-ui-carousel-controls {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.orphic-ui-carousel-add-button {
  background: #007cba;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;

  &:hover {
    background: #006ba1;
  }
}
