/* ==========================================================================
   Rinascient — Barre latérale de feedback d'équipe (Phase de développement)
   Permet à l'équipe de poster des remarques ciblées par rubrique, de les
   consulter, de naviguer vers chaque section et d'exporter le récapitulatif.
   ========================================================================== */

/* --- Bouton déclencheur flottant --------------------------------------- */
.feedback-trigger {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 400;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(11, 42, 42, 0.94);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(204, 85, 0, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.25s var(--ease, ease), background 0.25s, box-shadow 0.25s;
  user-select: none;
}
.feedback-trigger:hover {
  transform: translateY(-2px);
  background: #0f3939;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.65), 0 0 0 2px rgba(255, 138, 61, 0.35);
}
.feedback-trigger:active {
  transform: translateY(0);
}
.feedback-trigger-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff8a3d;
}
.feedback-trigger-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #b84d00;
  color: #fff;
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
}
.feedback-trigger-badge[data-count="0"] {
  display: none;
}

/* Positionnement ajusté sur mobile */
@media (max-width: 860px) {
  .feedback-trigger {
    right: 14px;
    bottom: 14px;
    padding: 8px 13px;
    font-size: 0.75rem;
  }
}

/* --- Fond estompé (backdrop) ------------------------------------------- */
.feedback-backdrop {
  position: fixed;
  inset: 0;
  z-index: 490;
  background: rgba(8, 26, 26, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.feedback-open .feedback-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* --- Tiroir latéral (sidebar drawer) ----------------------------------- */
.feedback-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100vw);
  z-index: 500;
  display: flex;
  flex-direction: column;
  background: #0b2a2a;
  color: #e5ecec;
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.55);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: var(--font-sans, system-ui, sans-serif);
}
.feedback-open .feedback-drawer {
  transform: translateX(0);
}

/* En-tête du tiroir */
.feedback-header {
  padding: 20px 22px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 56, 56, 0.5);
}
.feedback-header-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.feedback-title {
  font-family: var(--font-serif, serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}
.feedback-subtitle {
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  color: #ff8a3d;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.feedback-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.feedback-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Barre d'outils et filtres */
.feedback-tools {
  padding: 12px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(14, 46, 46, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.feedback-filter-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  padding: 3px;
  border-radius: 8px;
}
.feedback-tab {
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.feedback-tab:hover {
  color: #ffffff;
}
.feedback-tab.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-weight: 600;
}
.feedback-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.feedback-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  font-family: var(--font-mono, monospace);
  cursor: pointer;
  transition: all 0.2s;
}
.feedback-export-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Zone de défilement principale */
.feedback-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.feedback-body::-webkit-scrollbar {
  width: 6px;
}
.feedback-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Bloc d'ajout de commentaire (Formulaire) */
.feedback-form-box {
  background: rgba(18, 56, 56, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feedback-form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
}
.feedback-autodetect-hint {
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  color: #ff8a3d;
  font-weight: 400;
}

.feedback-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.feedback-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.feedback-input,
.feedback-select,
.feedback-textarea {
  width: 100%;
  padding: 8px 10px;
  background: rgba(8, 26, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: #ffffff;
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.8125rem;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}
.feedback-input:focus,
.feedback-select:focus,
.feedback-textarea:focus {
  outline: none;
  border-color: #ff8a3d;
  background: rgba(11, 42, 42, 0.9);
}
.feedback-select {
  cursor: pointer;
}
.feedback-select option {
  background: #0b2a2a;
  color: #ffffff;
}

/* Puces de type */
.feedback-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.feedback-type-opt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.feedback-type-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.feedback-type-opt:has(input:checked),
.feedback-type-opt.is-checked {
  background: rgba(204, 85, 0, 0.25);
  border-color: #ff8a3d;
  color: #ffffff;
}

.feedback-textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.45;
}

.feedback-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 0;
  border-radius: 6px;
  background: #b84d00;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.feedback-submit-btn:hover {
  background: #cc5500;
  transform: translateY(-1px);
}
.feedback-submit-btn:active {
  transform: translateY(0);
}
.feedback-msg {
  font-size: 0.75rem;
  margin: 0;
  display: none;
}
.feedback-msg.is-ok {
  display: block;
  color: #7ae77a;
}
.feedback-msg.is-err {
  display: block;
  color: #ff7575;
}

/* Liste des commentaires */
.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feedback-empty {
  text-align: center;
  padding: 36px 16px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8125rem;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

/* Carte de commentaire */
.feedback-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s var(--ease, ease);
  position: relative;
}
.feedback-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}
.feedback-card.is-resolved {
  opacity: 0.55;
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.05);
}
.feedback-card.is-resolved:hover {
  opacity: 0.85;
}

/* En-tête de la carte */
.feedback-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.feedback-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.feedback-pill-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.type-idea { background: rgba(255, 170, 0, 0.18); color: #ffb833; border: 1px solid rgba(255, 170, 0, 0.35); }
.type-bug { background: rgba(255, 77, 77, 0.18); color: #ff8585; border: 1px solid rgba(255, 77, 77, 0.35); }
.type-content { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.35); }
.type-design { background: rgba(192, 132, 252, 0.18); color: #d8b4fe; border: 1px solid rgba(192, 132, 252, 0.35); }

/* Bouton / badge vers la rubrique */
.feedback-sec-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  color: #ff8a3d;
  background: rgba(204, 85, 0, 0.12);
  border: 1px solid rgba(204, 85, 0, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.feedback-sec-link:hover {
  background: rgba(204, 85, 0, 0.3);
  color: #ffffff;
  border-color: #ff8a3d;
}

.feedback-version-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.625rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Texte du commentaire */
.feedback-card-text {
  font-size: 0.84rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.feedback-card.is-resolved .feedback-card-text {
  text-decoration: line-through;
  color: rgba(255, 255, 255, 0.55);
}

/* Pied de carte */
.feedback-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-mono, monospace);
}
.feedback-author-info {
  display: flex;
  gap: 6px;
}
.feedback-author-name {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.feedback-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.feedback-action-btn {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.6875rem;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.2s;
}
.feedback-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.feedback-btn-resolve {
  color: #86efac;
}
.feedback-btn-resolve:hover {
  background: rgba(134, 239, 172, 0.15);
  color: #a7f3d0;
}
.feedback-btn-delete {
  color: #fca5a5;
}
.feedback-btn-delete:hover {
  background: rgba(252, 165, 165, 0.15);
  color: #fecaca;
}

/* Notification de confirmation (Toast) */
.feedback-toast {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 600;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(11, 42, 42, 0.95);
  color: #ffffff;
  border: 1px solid #ff8a3d;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  font-size: 0.8125rem;
  font-weight: 500;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.feedback-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

/* Effet d'illumination de la section ciblée lorsqu'on clique sur son lien */
.feedback-target-highlight {
  outline: 3px solid #ff8a3d !important;
  outline-offset: 4px;
  animation: feedback-pulse 2.2s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes feedback-pulse {
  0% { outline-color: #ff8a3d; box-shadow: 0 0 0 8px rgba(255, 138, 61, 0.45); }
  70% { outline-color: #ff8a3d; box-shadow: 0 0 0 16px rgba(255, 138, 61, 0); }
  100% { outline-color: transparent; box-shadow: none; }
}
