<template>
  <LayoutContainer :overflow="false">
    <div class="d-flex justify-center align-center flex-column">
      <v-icon
        size="8"
        class="fa-solid fa-circle icon-title"
      />
      <p class="text-center solution-subtitle">
        3 solutions
      </p>
    </div>
    <h3
      class="text-center title"
      :style="smAndDown ? '' : 'margin-bottom: 3rem'"
    >
      Trouvez la solution <br>
      faite pour vous
    </h3>

    <v-row v-if="!smAndDown">
      <v-col
        v-for="(solution, index) in solutions"
        :key="index"
        cols="4"
        class="col-info"
      >
        <div class="opentalent-container">
          <small class="opentalent-small">Opentalent</small>
          <h2 class="logiciel-name">
            {{ solution.name }}
          </h2>
          <hr class="bar">
          <p class="description-logiciel">
            {{ solution.description }}
          </p>

          <nuxt-link :to="solution.link">
            <v-row>
              <div :class="solution.class">
                <v-img
                  :src="solution.image"
                  class="logo"
                />
              </div>
            </v-row>
          </nuxt-link>

          <v-row>
            <v-col cols="6">
              <ul class="list-solutions">
                <li
                  v-for="(sol, i) in solution.solutions.slice(0, 4)"
                  :key="'sol-' + i"
                  class="details-solution"
                >
                  {{ sol }}
                </li>
              </ul>
            </v-col>
            <v-col cols="6">
              <ul class="list-solutions">
                <li
                  v-for="(sol, i) in solution.solutions.slice(4)"
                  :key="'sol-' + i"
                  class="details-solution"
                >
                  {{ sol }}
                </li>
              </ul>
            </v-col>
          </v-row>
        </div>
      </v-col>
    </v-row>

    <div v-if="smAndDown">
      <div class="d-flex justify-center align-center">
        <div
          class="carousel-button"
          @click="goPrevious"
        >
          <i class="fas fa-chevron-left" />
        </div>
        <div
          class="carousel-button ml-6"
          @click="goNext"
        >
          <i class="fas fa-chevron-right" />
        </div>
      </div>
      <Carousel
        ref="carousel"
        :items-to-show="1.5"
        :items-to-scroll="1"
      >
        <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"
                    />
                  </div>
                </v-row>
              </nuxt-link>
              <v-row>
                <v-col cols="6">
                  <ul class="list-solutions-sm">
                    <li
                      v-for="(sol, i) in solution.solutions.slice(0, 4)"
                      :key="'sol-' + i"
                      class="details-solution-sm"
                    >
                      {{ sol }}
                    </li>
                  </ul>
                </v-col>
                <v-col
                  cols="6"
                  class="solution-column"
                >
                  <ul class="list-solutions-sm">
                    <li
                      v-for="(sol, i) in solution.solutions.slice(4)"
                      :key="'sol-' + i"
                      class="details-solution-sm"
                    >
                      {{ sol }}
                    </li>
                  </ul>
                </v-col>
              </v-row>
            </div>
          </v-col>
        </Slide>
      </Carousel>
    </div>
  </LayoutContainer>
</template>

<script setup>
import { ref, onMounted } from "vue";
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",
    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",
    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",
    solutions: [
      "Gestion des personnes",
      "Agenda",
      "Suivi pédagogique",
      "Règlements",
      "Communication",
      "Site internet",
      "Statistiques",
    ],
  },
];
onMounted(() => {
  setTimeout(() => goNext(), 0);
});
</script>

<style scoped>
.solution-subtitle,
.title {
  font-family: "Barlow";
  font-style: normal;
}

.solution-subtitle {
  font-size: 1.5rem;
  line-height: 1rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
  color: #c1eff0;
  text-align: center;
  font-family: "Barlow";
  letter-spacing: 2.16px;
  text-transform: uppercase;
}
.title {
  font-size: 2rem;
  line-height: 42px;
  text-align: center;
  color: #ffffff;
}

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

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

.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: 4rem;
  height: 4rem;
  background-color: transparent;
  border: 2px solid #fff;
  cursor: pointer;
  margin-right: 1rem;
  margin-top: 2rem;
}

.carousel-button i {
  color: #fff;
}
.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;
}

.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;
  width: 20rem;
}

.description-logiciel-sm {
  font-family: "Barlow";
  font-style: normal;
  font-size: 1.2rem;
  color: #eff9fb;
  line-height: 1.3rem;
  margin-top: 1rem;
  width: 20rem;
  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;
  color: #fff;
}

.opentalent-container {
  text-align: left;
  margin-left: 1rem;
}
.icon-title {
  margin-top: 1rem;
  color: #ffffff;
}

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

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

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

.list-solutions-sm {
  margin-top: 1rem;
  font-size: 1.3rem;
}
.bar {
  color: #c3e5e7;
  width: 20rem;
}

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

.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 {
  position: relative;
  background: url(/images/solutions/manager.png);
  background-size: cover;
  background-position: center;
  border-radius: 0px 0px 10px 10px;
  width: 21rem;
  height: 20rem;
  margin-top: 2rem;
  margin-left: 0.9rem;
}

.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;
}

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

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

.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-sm {
  width: 20rem;
  margin-left: auto;
  margin-right: auto;
}
.solution-img {
  width: 15rem;
  height: 15rem;
  object-fit: cover;
  margin-top: 2rem;
}

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

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

.opentalent-small {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-size: 10px;
  line-height: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffffff;
}

.container {
  background: #0e2d32;
  margin-bottom: 29rem;
  height: 35rem;
  position: relative;
}
</style>
