/* ============================================================================
   CAP Lapeyrouse-Fossat — Styles témoignages (bloc dashboard + modale)
   ============================================================================

   Style :
     1. Le petit bloc "Mon témoignage" dans le dashboard membre (sous le
        bloc "Mon profil professionnel"). Visuellement cohérent avec
        .dashboard-profile-block (cf. 05-espace-pages.css) mais discret.
     2. La modale #testimonialModal qui s'ouvre par-dessus le dashboard,
        avec 5 états visuels gérés par testimonials.js.

   Masquage feature flag : si testimonial_submission_enabled = false, le
   bloc dashboard est masqué via CSS (fallback) en plus du masquage JS.
   ============================================================================ */

/* ============================================================================
   Bloc dashboard "Mon témoignage"
   ============================================================================
   Imite .dashboard-profile-block mais en plus compact, sans barre de
   progression (pas de notion de % pour un témoignage). */

.dashboard-testimonial-block {
  background: rgba(1, 21, 45, 0.4);
  border: 1px solid rgba(183, 144, 68, 0.25);
  border-radius: 3px;
  padding: 0.85rem 1.1rem 0.95rem 1.1rem;
  margin-top: 0.75rem;
}

.dashboard-testimonial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.dashboard-testimonial-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 239, 227, 0.85);
}

.dashboard-testimonial-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 20px;
  white-space: nowrap;
  font-family: 'Manrope', sans-serif;
}

.dashboard-testimonial-badge-pending {
  background: #f3d57a;
  color: #6b4e10;
}

.dashboard-testimonial-badge-approved {
  background: #4f9c4f;
  color: #ffffff;
}

.dashboard-testimonial-badge-rejected {
  background: var(--red-500);
  color: #ffffff;
}

.dashboard-testimonial-hint {
  font-size: 0.78rem;
  color: rgba(245, 239, 227, 0.7);
  line-height: 1.5;
  margin: 0 0 0.75rem 0;
  font-style: italic;
}

.dashboard-testimonial-btn {
  width: 100%;
  background: transparent;
  color: var(--gold-400);
  border: 1px solid var(--gold-500);
  padding: 0.6rem 1rem;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.25s ease;
}

.dashboard-testimonial-btn:hover {
  background: var(--gold-500);
  color: var(--navy-950);
}

/* Masquage par feature flag (fallback) */
body[data-features-testimonial-submission-enabled="false"] .dashboard-testimonial-block {
  display: none !important;
}

/* ============================================================================
   Modale #testimonialModal
   ============================================================================
   Réutilise les classes .member-modal / .member-modal-overlay / .member-modal-content
   pour le conteneur (animation, fond noir transparent, fermeture overlay). On
   ne style ici que le contenu spécifique de la modale témoignage. */

.testimonial-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--cream-300, #e8e0d3);
  margin-bottom: 1.5rem;
}

.testimonial-modal-header svg {
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.testimonial-modal-header > div {
  flex: 1;
  min-width: 0;
}

/* ============================================================================
   États visuels DANS la modale
   ============================================================================ */

/* État loading : skeleton + petit spinner */
.testimonial-state-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  color: var(--ink-500, #6b6b6b);
  font-size: 0.875rem;
}

.testimonial-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--cream-300, #e8e0d3);
  border-top-color: var(--gold-500, #c89e51);
  border-radius: 50%;
  animation: testimonialSpinner 0.8s linear infinite;
}

@keyframes testimonialSpinner {
  to { transform: rotate(360deg); }
}

/* ============================================================================
   Formulaire de soumission (état empty / reformulation depuis rejected)
   ============================================================================ */

.testimonial-textarea {
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
  line-height: 1.55;
}

.testimonial-form-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-500, #6b6b6b);
  line-height: 1.4;
}

.testimonial-form-hint > span:first-child {
  flex: 1;
}

.testimonial-char-counter {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}

/* ============================================================================
   Cards de statut (pending / approved / rejected)
   ============================================================================ */

.testimonial-status-card {
  padding: 1.25rem 1.25rem 1rem 1.25rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.testimonial-status-pending {
  background: #fef9ef;
  border-color: #f3e3b8;
}

.testimonial-status-approved {
  background: #f0f9f0;
  border-color: #c5e4c5;
}

.testimonial-status-rejected {
  background: #fdf5f3;
  border-color: #f0c5bd;
}

.testimonial-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.875rem;
}

.testimonial-status-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 20px;
  white-space: nowrap;
}

.testimonial-status-badge-pending {
  background: #f3d57a;
  color: #6b4e10;
}

.testimonial-status-badge-approved {
  background: #4f9c4f;
  color: #ffffff;
}

.testimonial-status-badge-rejected {
  background: var(--red-500);
  color: #ffffff;
}

.testimonial-status-date {
  font-size: 0.8rem;
  color: var(--ink-500, #6b6b6b);
  font-variant-numeric: tabular-nums;
}

.testimonial-status-quote {
  margin: 0 0 0.875rem 0;
  padding: 0.875rem 1rem;
  background: #ffffff;
  border-left: 3px solid var(--gold-500, #c89e51);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-700, #333);
}

.testimonial-status-role {
  margin: 0 0 0.75rem 0;
  font-size: 0.85rem;
  color: var(--ink-600, #555);
}

.testimonial-status-role span {
  color: var(--ink-800, #222);
  font-weight: 500;
}

.testimonial-status-info {
  margin: 0.75rem 0 1rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-600, #555);
}

.testimonial-rejection-reason {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-700, #333);
}

.testimonial-rejection-reason strong {
  color: var(--red-500);
  margin-right: 0.25rem;
}

/* ============================================================================
   Ligne d'actions (boutons)
   ============================================================================ */

.testimonial-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 500px) {
  .testimonial-actions {
    flex-direction: column-reverse;
  }
  .testimonial-actions .btn {
    width: 100%;
  }
}

/* Variante danger-outline si pas définie ailleurs */
.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--red-500);
  color: var(--red-500);
}

.btn-danger-outline:hover {
  background: var(--red-500);
  color: #ffffff;
}
