/* ============================================================
   💬 SECCIÓ D’OPINIONS I VALORACIONS
   ------------------------------------------------------------
   Inclou:
   1️⃣ Formulari d’opinió amb estrelles i botó
   2️⃣ Carrusel d’opinions d’usuaris
   3️⃣ Versió responsive per a mòbil
   ============================================================ */


/* ============================================================
   1️⃣ FORMULARI D’OPINIÓ
   ============================================================ */

/* 🟦✨ Caixa d’opinió principal */
.opinio-container {
  max-width: 550px;
  margin: 3rem auto;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(145deg, #fefefe 0%, #faf8ed 70%);
  background-image:
    radial-gradient(circle at top right, rgba(30,77,216,0.07), transparent 60%),
    radial-gradient(circle at bottom left, rgba(212,175,55,0.08), transparent 70%);
  border: 2px solid #e2c044;
  box-shadow: 0 8px 22px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.opinio-container:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

/* 🔹 Títol i subtítol */
.opinio-container h2 {
  margin-bottom: 8px;
  font-size: 1.6rem;
  background: linear-gradient(90deg, #1a237e, #3f51b5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.opinio-container p {
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
  color: #444;
}

/* ⭐ Sistema d’estrelles */
.star-rating {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 1rem;
}

.star-rating .star {
  font-size: 2.4rem;
  cursor: pointer;
  position: relative;
  color: #d4d4d4;
  transition: transform 0.2s ease, filter 0.25s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.star-rating .star:hover {
  transform: scale(1.15);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.star-rating .star::before {
  content: "☆";
  color: #ccc;
  transition: color 0.2s ease, transform 0.25s ease;
}

/* Estrelles actives o en hover */
.star-rating .star.hovered::before,
.star-rating .star.selected::before {
  content: "★";
  color: #e2c044;
  text-shadow: 0 0 8px rgba(212,175,55,0.4),
               0 2px 4px rgba(0,0,0,0.15);
  transform: scale(1.02);
}

/* ✏️ Textarea */
textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 8px;
  margin: 15px 0;
  border: 1.5px solid #ccc;
  resize: none;
  font-family: inherit;
  background: #fffdf6;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 6px rgba(212,175,55,0.3);
}

/* 🔘 Botó d’enviament */
button#enviar-opinio {
  background: linear-gradient(90deg, #1a237e, #3f51b5);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 25px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(26,35,126,0.25);
}

button#enviar-opinio:hover:enabled {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26,35,126,0.35);
}

button#enviar-opinio:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}


/* ============================================================
   2️⃣ OPINIONS DELS USUARIS (Carrusel Desktop)
   ============================================================ */
/* ========================================================= */
/* 💬 OPINIONS / TESTIMONIS                                  */
/* ========================================================= */

/* 🔹 Contenidor general */
#opinions-section {
  max-width: 1120px;
  margin: 3rem auto;
  padding: 0 1rem;
  text-align: center;
  font-family: 'Poppins', sans-serif;
}

/* 🔹 Títol principal */
.titol-opinions {
  font-weight: 700;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  color: #1a237e;                /* blau corporatiu */
  margin: 3rem auto 1rem;
  text-align: center;
}

.titol-opinions span {
  color: #b08a2e;                /* daurat corporatiu */
}

/* ========================================================= */
/* 🎠 Carrusel d’opinions                                    */
/* ========================================================= */

.carousel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  gap: 1rem;
  padding: 1rem 0;
  align-items: stretch;
}

/* Targetes d’opinió */
.opinio-card {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  background: #fffdf8;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 1rem;
  text-align: left;
  scroll-snap-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

  /* Animació d’aparició */
  opacity: 0;
  transform: translateY(10px);
  animation: fadeIn 0.6s ease forwards;
}

.opinio-card p,
.opinio-card small {
  overflow-wrap: anywhere;
}

/* Estrelles */
.opinio-card .estrelles {
  color: #f4af50;
  font-size: 1.2rem;
}

/* ========================================================= */
/* ✨ Animació d’aparició suau                               */
/* ========================================================= */

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================================= */
/* 📱 Responsive (≤600px) — Carrusel d’opinions mòbil        */
/* ========================================================= */

@media (max-width: 600px) {
  .opinio-container h2 {
    font-size: clamp(0.72rem, 4.05vw, 0.9rem);
    line-height: 1.1;
    white-space: nowrap;
    letter-spacing: -0.04em;
    overflow: hidden;
  }

  /* Contenidor principal del carrusel */
  .carousel {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    width: 100%;
    gap: 0.5rem;
    padding: 1rem 0 2rem;
  }

  /* Targetes d’opinió */
  .opinio-card {
    flex: 0 0 90%;
    max-width: 90%;
    margin: 0 auto;
    padding: 1.1rem 1.2rem;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.45;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  /* Targeta visible (activa) */
  .opinio-card.active {
    opacity: 1;
    transform: scale(1);
    margin: 0 auto;
  }

  /* Targeta sortint cap a l’esquerra */
  .opinio-card.exit-left {
    opacity: 0;
    transform: translateX(-150%) scale(0.96);
  }

  /* Títol “Què en pensen els usuaris?” */
  h2, .opinions-section h2 {
    font-size: 1.3rem;
    text-align: center;
    margin: 0 auto 1rem;
    line-height: 1.3;
    width: 90%;
  }

  /* Estrelles dins de la targeta */
  .opinio-card .stars {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: inline-block;
  }

  /* Sistema d’estrelles del formulari */
  .star-rating .star {
    font-size: 2rem;
  }

  .star-rating {
    gap: 4px;
  }
}

/* ============================================================
   🌙 DARK MODE — OPINIONS I VALORACIONS
   ============================================================ */

[data-theme="dark"] .opinio-container {
  background:
    radial-gradient(circle at top right, rgba(96,165,250,0.1), transparent 60%),
    radial-gradient(circle at bottom left, rgba(212,175,55,0.1), transparent 70%),
    linear-gradient(180deg, rgba(8,15,30,0.98) 0%, rgba(12,19,35,0.98) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 48px rgba(0,0,0,0.45);
}

[data-theme="dark"] .opinio-container h2 {
  background: linear-gradient(90deg, #93c5fd, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .opinio-container p {
  color: #cbd5e1;
}

/* ⭐ Estrelles */
[data-theme="dark"] .star-rating .star::before {
  color: #475569;
}

[data-theme="dark"] .star-rating .star.hovered::before,
[data-theme="dark"] .star-rating .star.selected::before {
  color: #facc15;
  text-shadow: 0 0 10px rgba(250,204,21,0.4);
}

/* ✏️ Textarea */
[data-theme="dark"] textarea {
  background: rgba(2, 6, 23, 0.72);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

[data-theme="dark"] textarea::placeholder {
  color: #64748b;
}

[data-theme="dark"] textarea:focus {
  border-color: #facc15;
  box-shadow: 0 0 8px rgba(250,204,21,0.25);
}

/* 🔘 Botó */
[data-theme="dark"] button#enviar-opinio {
  background: linear-gradient(135deg, #15306b, #2858c5);
  box-shadow: 0 10px 26px rgba(37,99,235,0.28);
}

[data-theme="dark"] button#enviar-opinio:hover:enabled {
  box-shadow: 0 14px 32px rgba(37,99,235,0.36);
}

/* ============================================================
   🌙 DARK MODE — CARRUSEL D’OPINIONS
   ============================================================ */

[data-theme="dark"] #opinions-section {
  color: #e5e7eb;
}

[data-theme="dark"] .titol-opinions {
  color: #e5e7eb;
}

[data-theme="dark"] .titol-opinions span {
  color: #facc15;
}

/* 🟦 Targetes */
[data-theme="dark"] .opinio-card {
  background: linear-gradient(180deg, rgba(10,18,32,0.98), rgba(14,23,42,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 14px 34px rgba(0,0,0,0.36);
}

[data-theme="dark"] .opinio-card p {
  color: #cbd5e1;
}

/* ⭐ Estrelles targeta */
[data-theme="dark"] .opinio-card .estrelles {
  color: #facc15;
}
