/* ===== FEEDBACK NPS ===== */

/* ============================================
   PARTE 1: WIDGET FLUTUANTE (gerentes/membros)
   ============================================ */

#nps-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* Trigger Button */
.nps-widget-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
  transition: all 0.3s;
  animation: nps-pulse 2s ease-in-out infinite;
}

.nps-widget-trigger:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 28px rgba(245, 158, 11, 0.5);
}

.nps-widget-trigger.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

@keyframes nps-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(245, 158, 11, 0.6); }
}

/* Panel */
.nps-widget-panel {
  position: absolute;
  bottom: 56px;
  right: 0;
  width: 340px;
  background: rgba(15, 17, 30, 0.97);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: all 0.25s ease;
}

.nps-widget-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.nps-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.1);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fbbf24;
}

.nps-widget-close {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: background 0.2s;
}

.nps-widget-close:hover { background: rgba(239, 68, 68, 0.2); }

.nps-widget-body {
  padding: 18px;
}

.nps-widget-question {
  font-size: 0.85rem;
  color: #e2e8f0;
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Score Buttons */
.nps-widget-scores {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.nps-score-btn {
  aspect-ratio: 1;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.nps-score-btn:hover {
  transform: translateY(-2px);
}

.nps-score-btn.detrator { border-color: rgba(239, 68, 68, 0.2); }
.nps-score-btn.neutro { border-color: rgba(251, 191, 36, 0.2); }
.nps-score-btn.promotor { border-color: rgba(34, 197, 94, 0.2); }

.nps-score-btn.detrator:hover { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border-color: #ef4444; }
.nps-score-btn.neutro:hover { background: rgba(251, 191, 36, 0.15); color: #fde68a; border-color: #fbbf24; }
.nps-score-btn.promotor:hover { background: rgba(34, 197, 94, 0.15); color: #86efac; border-color: #22c55e; }

.nps-score-btn.selected.detrator { background: #ef4444; color: #fff; border-color: #ef4444; box-shadow: 0 3px 12px rgba(239, 68, 68, 0.4); }
.nps-score-btn.selected.neutro { background: #fbbf24; color: #1e293b; border-color: #fbbf24; box-shadow: 0 3px 12px rgba(251, 191, 36, 0.4); }
.nps-score-btn.selected.promotor { background: #22c55e; color: #fff; border-color: #22c55e; box-shadow: 0 3px 12px rgba(34, 197, 94, 0.4); }

.nps-widget-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 14px;
}

.nps-widget-comment textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e2e8f0;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 14px;
}

.nps-widget-comment textarea:focus { border-color: #fbbf24; }
.nps-widget-comment textarea::placeholder { color: rgba(255, 255, 255, 0.25); }

.nps-widget-submit {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nps-widget-submit:hover { box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35); }
.nps-widget-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* Success */
.nps-widget-success {
  text-align: center;
  padding: 20px 8px;
}

.nps-success-emoji {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.nps-widget-success h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #22c55e;
  margin-bottom: 4px;
}

.nps-widget-success p {
  font-size: 0.82rem;
  color: #94a3b8;
}


/* Light theme widget */
[data-theme="light"] .nps-widget-panel {
  background: rgba(255, 255, 255, 0.97);
  border-color: #e5e7eb;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .nps-widget-header { color: #d97706; border-bottom-color: #f3f4f6; }
[data-theme="light"] .nps-widget-question { color: #1e293b; }
[data-theme="light"] .nps-score-btn { background: #fafafa; color: #475569; border-color: #e5e7eb; }
[data-theme="light"] .nps-widget-scale { color: #94a3b8; }
[data-theme="light"] .nps-widget-comment textarea { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
[data-theme="light"] .nps-widget-comment textarea::placeholder { color: #94a3b8; }
[data-theme="light"] .nps-widget-success p { color: #475569; }


/* ============================================
   PARTE 2: PAINEL ADMIN (somente leitura)
   ============================================ */

.fb-container {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.fb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.fb-header-left h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
  display: flex;
  align-items: center;
  gap: 10px;
}

.fb-header-left h2 i { color: #fbbf24; }

.fb-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
  margin-top: 2px;
  display: block;
}

/* NPS Hero */
.fb-nps-card {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 28px 32px;
  border-radius: 16px;
  margin-bottom: 24px;
  border: 1px solid rgba(245, 158, 11, 0.15);
  background: rgba(15, 17, 30, 0.5);
}

.fb-nps-score-section { text-align: center; min-width: 120px; }

.fb-nps-big-score {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.fb-nps-excellent .fb-nps-big-score { color: #22c55e; }
.fb-nps-great .fb-nps-big-score { color: #4ade80; }
.fb-nps-ok .fb-nps-big-score { color: #fbbf24; }
.fb-nps-warn .fb-nps-big-score { color: #fb923c; }
.fb-nps-bad .fb-nps-big-score { color: #f87171; }

.fb-nps-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #e2e8f0);
}

.fb-nps-sublabel {
  font-size: 0.75rem;
  color: var(--text-secondary, #94a3b8);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.fb-nps-gauge-section { flex: 1; }

.fb-nps-gauge-bar {
  height: 12px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.fb-nps-gauge-fill {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0 6px 6px 0;
  transition: width 0.5s ease;
}

.fb-nps-gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-secondary, #94a3b8);
  margin-top: 4px;
}

.fb-nps-avg {
  display: flex;
  gap: 24px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
  flex-wrap: wrap;
}

.fb-nps-avg strong { color: var(--text-primary, #e2e8f0); }

/* Métricas */
.fb-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.fb-metric-card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(15, 17, 30, 0.5);
}

.fb-metric-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  border-radius: 0 3px 0 0;
  transition: width 0.6s ease;
}

.fb-promotor .fb-metric-bar { background: #22c55e; }
.fb-neutro .fb-metric-bar { background: #fbbf24; }
.fb-detrator .fb-metric-bar { background: #ef4444; }

.fb-metric-content {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.fb-metric-emoji { font-size: 1.8rem; }

.fb-metric-info h4 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
}

.fb-metric-info h4 span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary, #94a3b8);
}

.fb-metric-info p {
  font-size: 0.8rem;
  color: var(--text-secondary, #94a3b8);
  margin-top: 2px;
}

.fb-metric-info p small { opacity: 0.7; }

/* Section Title */
.fb-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #e2e8f0);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fb-section-title i { color: #fbbf24; }

/* Feedback List */
.fb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(15, 17, 30, 0.5);
  border: 1px solid rgba(245, 158, 11, 0.08);
  border-radius: 12px;
  transition: all 0.2s;
  gap: 16px;
}

.fb-item:hover { border-color: rgba(245, 158, 11, 0.2); }

.fb-item-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.fb-item-score {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.fb-item-score.promotor { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.fb-item-score.neutro { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.fb-item-score.detrator { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.fb-item-info { min-width: 0; }

.fb-item-user {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary, #e2e8f0);
  display: flex;
  align-items: center;
  gap: 6px;
}

.fb-item-user i { font-size: 0.75rem; color: var(--text-secondary, #94a3b8); }

.fb-item-comentario {
  font-size: 0.82rem;
  color: var(--text-secondary, #94a3b8);
  font-style: italic;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 450px;
}

.fb-item-comentario.fb-no-comment {
  font-style: normal;
  opacity: 0.5;
}

.fb-item-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.fb-item-date {
  font-size: 0.78rem;
  color: var(--text-secondary, #94a3b8);
  white-space: nowrap;
}

.fb-item-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.fb-item-badge.promotor { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.fb-item-badge.neutro { background: rgba(251, 191, 36, 0.1); color: #fbbf24; }
.fb-item-badge.detrator { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

/* Empty */
.fb-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary, #94a3b8);
}

.fb-empty i {
  font-size: 3rem;
  color: rgba(245, 158, 11, 0.3);
  margin-bottom: 16px;
}

.fb-empty p { margin-top: 8px; font-size: 0.9rem; }

/* Loading */
.fb-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary, #94a3b8);
}

.fb-loading i { margin-right: 8px; color: #fbbf24; }


/* ===== LIGHT THEME (admin panel) ===== */

[data-theme="light"] .fb-header-left h2 { color: #1e293b; }
[data-theme="light"] .fb-subtitle { color: #64748b; }

[data-theme="light"] .fb-nps-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .fb-nps-label { color: #1e293b; }
[data-theme="light"] .fb-nps-sublabel { color: #64748b; }
[data-theme="light"] .fb-nps-gauge-labels { color: #64748b; }
[data-theme="light"] .fb-nps-avg { color: #475569; }
[data-theme="light"] .fb-nps-avg strong { color: #0f172a; }

[data-theme="light"] .fb-metric-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .fb-metric-info h4 { color: #0f172a; }
[data-theme="light"] .fb-metric-info h4 span { color: #64748b; }
[data-theme="light"] .fb-metric-info p { color: #475569; }

[data-theme="light"] .fb-section-title { color: #1e293b; }

[data-theme="light"] .fb-item {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .fb-item:hover { border-color: #f59e0b; }
[data-theme="light"] .fb-item-user { color: #0f172a; }
[data-theme="light"] .fb-item-comentario { color: #475569; }
[data-theme="light"] .fb-item-date { color: #64748b; }
[data-theme="light"] .fb-empty { color: #475569; }
[data-theme="light"] .fb-loading { color: #475569; }


/* ===== RESPONSIVO ===== */

@media (max-width: 768px) {
  .fb-nps-card {
    flex-direction: column;
    text-align: center;
  }

  .fb-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .fb-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .fb-item-right {
    width: 100%;
    justify-content: space-between;
    margin-top: 12px;
  }

  .nps-widget-panel {
    width: 300px;
    right: -8px;
  }

  .fb-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
