<template>
  <div class="d-flex justify-center align-center flex-column">
    <v-icon size="8" class="fa-solid fa-circle icon-title"></v-icon>
    <p class="text-center solution-subtitle">3 solutions</p>
  </div>
  <h3 class="text-center title ">
    Trouvez la solution <br />
    faite pour vous
  </h3>



  <div v-if="smAndDown">
    <div class="d-flex justify-center align-center mb-6">
          <div class="carousel-button" @click="goPrevious">
            <i class="fas fa-chevron-left"></i>
          </div>
          <div class="carousel-button" @click="goNext">
            <i class="fas fa-chevron-right"></i>
          </div>
        </div>
    <Carousel
      :itemsToShow="1.1"
      :itemsToScroll="1"
      v-slot="{ carousel: _carousel }"
      ref="carousel"
    >
      <Slide
        v-for="(solution, index) in solutions"
        :key="index"
      >
        <v-col cols="12" class="col-info-sm">
          <div class="opentalent-container">
            <small class="opentalent-small-sm">Opentalent</small>

            <h2 class="logiciel-name-sm">{{ solution.name }}</h2>
            <hr class="bar-sm" />
            <p class="description-logiciel-sm">
              {{ solution.description }}
            </p>

            <nuxt-link :to="solution.link">
              <v-row>
                <div :class="solution.class">
                  <v-img :src="solution.image" class="logo-sm"></v-img>
                </div>
              </v-row>
            </nuxt-link>
            <v-row>
              <v-col cols="6">
                <ul class="list-solutions-sm">
                  <li
                    class="details-solution-sm"
                    v-for="(sol, i) in solution.solutions.slice(0, 4)"
                    :key="'sol-' + i"
                  >
                    {{ sol }}
                  </li>
                </ul>
              </v-col>
              <v-col cols="6" class="solution-column">
                <ul class="list-solutions-sm" >
                  <li
                    class="details-solution-sm"
                    v-for="(sol, i) in solution.solutions.slice(4)"
                    :key="'sol-' + i"
                  >
                    {{ sol }}
                  </li>
                </ul>
              </v-col>
            </v-row>
          </div>
        </v-col>
      </Slide>
    </Carousel>
  </div>
</template>

<script setup>
import { Carousel, Slide } from "vue3-carousel";
import "vue3-carousel/dist/carousel.css";
import { useDisplay } from "vuetify";
const { smAndDown } = useDisplay();
const carousel = ref(null);

const goPrevious = () => {
  carousel.value.prev();
};

const goNext = () => {
  carousel.value.next();
};

const solutions = [
  {
    name: "Artist",
    description: "Orchestre, chorales, compagnies de danse, théâtre et cirque",
    image: "/images/OpenTalent_LogoNoir_Jaune_white.png",
    class: "artist-image-sm",
    solutions: [
      "Gestion des membres",
      "Agenda",
      "Matériel & médiathèque",
      "Export de données",
      "Communication",
      "Statistiques",
      "Site internet",
      "Partage de données en réseau",
    ],
  },
  {
    name: "School",
    description: "Petits et grands établissements d'enseignement artistique",
    image: "/images/logo_school_white.png",
    link: "/logiciels/school",
    class: "school-image-sm",
    solutions: [
      "Gestion des personnes",
      "Préinscription en ligne*",
      "Agenda",
      "Suivi pédagogique",
      "Règlements",
      "Communication",
      "Site internet",
      "Statistiques",
    ],
  },
  {
    name: "Manager",
    description: "Fédérations, confédérations et collectivités",
    image: "/images/OpenTalent_LogoNoir_rouge_manager_white.png",
    link: "/logiciels/manager",
    class: "manager-image-sm",
    solutions: [
      "Gestion des personnes",
      "Agenda",
      "Suivi pédagogique",
      "Règlements",
      "Communication",
      "Site internet",
      "Statistiques",
    ],
  },
];
</script>

<style scoped>
.carousel-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background-color: transparent;
  border: 2px solid #000000;
  cursor: pointer;
  margin-right: 1rem;
  margin-top: 4rem;
}

.carousel-button i {
  color: #000000;
}
.solution-column {
  margin-left: -3rem;
}
.logo-sm {
  width: 8rem;
  height: 4rem;
  margin-top: 15rem;
  margin-left: .5rem;
}

.list-solutions {
  margin-top: 0.9rem;
  font-size: 0.5rem;
}

.list-solutions-sm {
  margin-top: 1rem;
  font-size: 1rem;
  
}

.details-solution-sm {
  font-size: .9rem;
  margin-top: .2rem;
  width: 9rem;
  margin-left: 1rem;
  font-family: "Barlow";
  font-style: normal;
  line-height: 18px;
  color: #091d20;
}

.bar-sm {
  color: #c3e5e7;
  width: 20rem;
}
.artist-image-sm {
  position: relative;
  background: url(/images/solutions/artist.jpg);
  background-size: cover;
  background-position: center;
  border-radius: 0px 0px 10px 10px;
  width: 19rem;
  height: 20rem;
  margin-top: 4rem;
  margin-left: 1rem;
}

.artist-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
  border-radius: 0px 0px 10px 10px;
  opacity: 0;
  transition: opacity 0.3s;
}

.artist-image:hover::before {
  opacity: 1;
  cursor: pointer;
}
.manager-image-sm {
  position: relative;
  background: url(/images/solutions/manager.png);
  background-size: cover;
  background-position: center;
  border-radius: 0px 0px 10px 10px;
  width: 19rem;
  height: 20rem;
  margin-top: 4rem;
  margin-left: 1rem;
}

.manager-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
  border-radius: 0px 0px 10px 10px;
  opacity: 0;
  transition: opacity 0.3s;
}
.carousel-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background-color: transparent;
  border: 2px solid #000000;
  cursor: pointer;
  margin-right: 1rem;
  margin-top: 4rem;
}

.carousel-button i {
  color: #000000;
}
.manager-image:hover::before {
  opacity: 1;
  cursor: pointer;
}

.school-image-sm {
  position: relative;
  background: url(/images/solutions/school.jpg);
  background-size: cover;
  background-position: center;
  border-radius: 0px 0px 10px 10px;
  width: 19rem;
  height: 20rem;
  margin-top: 4rem;
  margin-left: 1rem;
}

.school-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
  border-radius: 0px 0px 10px 10px;
  opacity: 0;
  transition: opacity 0.3s;
}

.school-image:hover::before {
  opacity: 1;
  cursor: pointer;
}

.col-info:first-child {
  margin-left: 9rem;
}

.col-info {
  width: 4rem;
  margin-left: 2rem;
}

.solution-img {
  width: 15rem;
  height: 15rem;
  object-fit: cover;
  margin-top: 2rem;
}

.description-logiciel {
  font-family: "Barlow";
  font-style: normal;
  font-size: 0.9rem;
  line-height: 0.9rem;
  margin-top: 1rem;
  color: #eff9fb;
}

.description-logiciel-sm {
  font-family: "Barlow";
  font-style: normal;
  font-size: 0.9rem;
  line-height: 0.9rem;
  margin-top: 1rem;
  width: 13rem;
  margin-right: auto;
  text-align: left;
}

.logiciel-name-sm {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-size: 30px;
  line-height: 2rem;
  color: #c3e5e7;
  margin-bottom: 1rem;
  margin-right: auto;
  text-align: left;
}

.opentalent-small-sm {
  margin-right: auto;
  text-align: left;
}

.opentalent-container {
  text-align: left;
}
</style>
