<template>
  <div class="box" :class="{'box-padding': !removePadding,'box-shadowed': variant === 'shadow', 'box-bordered': variant === 'border', 'stretch-content': stretchContent}">
    <slot></slot>
  </div>
</template>

<script>

export default {
  name: "Box",
  props: {
    variant: {
      type: String,
      default: 'shadow',
      validator: (value) => ['shadow', 'border'].includes(value)
    },
    stretchContent: {
      type: Boolean,
      default: false
    },
    removePadding: {
      type: Boolean,
      default: false
    }
  }
}
</script>

<style scoped>

.box-shadowed {
  box-shadow: 0 0.4rem 0.6rem -0.1rem rgba(0, 0, 0, 0.1);
}



.box-bordered {
  border: 0.1rem solid #E3EDFF;
}

.box {
  display: flex;
  background: white;
  border-radius: 0.8rem;
  position: relative;

}

.box-padding {
  padding: 1.5rem;
}

.stretch-content {
  flex-direction: column;
  width: 100%;
}

/* Fade transition for Vue.js */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease-in-out;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.fade-enter-to,
.fade-leave-from {
  opacity: 1;
}

/* Optional: Add a slight delay to prevent content jumping */
.fade-enter-active {
  transition-delay: 0.15s;
}

.fade-leave-active {
  transition-delay: 0s;
}

/* Ensure the transition container maintains consistent height */
.destination-edit-routes {
  min-height: fit-content;
}

</style>