/* ============================================================
   PR Funnel Page — Media Monitoring & PR Intelligence
   EPW-PRO-077: Simon Daily Briefing
   CSS prefix: .prf-*
   ============================================================ */

/* ---- Section containers ---- */
.prf-section {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}

.prf-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  background: #FFFBEB;
  border-bottom: 1px solid #FDE68A;
  transition: background 0.15s;
  position: sticky;
  top: 0;
  z-index: 10;
}
.prf-section-header:hover { background: #FEF3C7; }

.prf-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #92400E;
  display: flex;
  align-items: center;
  gap: 8px;
}

.prf-section-count {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #D97706;
  color: #fff;
}

.prf-section-arrow {
  font-size: 0.65rem;
  color: #D97706;
  transition: transform 0.2s;
}
.prf-section-arrow.open { transform: rotate(180deg); }

.prf-section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.2s;
  padding: 0 18px;
}
.prf-section-body.open {
  max-height: 8000px;
  padding: 16px 18px;
}

/* ---- Source Manager ---- */
.prf-source-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.prf-source-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94A3B8;
  padding: 6px 10px;
  border-bottom: 2px solid #E5E7EB;
}
.prf-source-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #F1F5F9;
  color: #374151;
  vertical-align: middle;
}
.prf-source-table tr:hover td { background: #FFFBEB; }

.prf-source-type {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.prf-source-type[data-type="rss"] { background: #DBEAFE; color: #1D4ED8; }
.prf-source-type[data-type="email"] { background: #F3E8FF; color: #7C3AED; }
.prf-source-type[data-type="api"] { background: #DCFCE7; color: #16A34A; }
.prf-source-type[data-type="whatsapp"] { background: #D1FAE5; color: #059669; }
.prf-source-type[data-type="scrape"] { background: #FEF3C7; color: #D97706; }

.prf-source-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}
.prf-source-status .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.prf-source-status .dot.ok { background: #22C55E; }
.prf-source-status .dot.error { background: #EF4444; }
.prf-source-status .dot.pending { background: #94A3B8; }

.prf-toggle-btn {
  background: none;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  cursor: pointer;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-family: inherit;
  transition: all 0.15s;
}
.prf-toggle-btn:hover { border-color: #D97706; color: #D97706; }
.prf-toggle-btn.enabled { color: #22C55E; }
.prf-toggle-btn.disabled { color: #94A3B8; }

.prf-del-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94A3B8;
  font-size: 0.85rem;
  padding: 2px 5px;
  transition: color 0.12s;
}
.prf-del-btn:hover { color: #EF4444; }

.prf-add-source-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 14px;
  font-size: 0.8rem;
  color: #D97706;
  background: none;
  border: 1px dashed #FDE68A;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  width: 100%;
}
.prf-add-source-btn:hover { background: #FFFBEB; border-color: #D97706; }

.prf-add-form {
  display: none;
  margin-top: 12px;
  padding: 14px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
}
.prf-add-form.visible { display: block; }

.prf-add-form label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #92400E;
  margin-bottom: 3px;
  margin-top: 10px;
}
.prf-add-form label:first-child { margin-top: 0; }

.prf-add-form input,
.prf-add-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #E5E7EB;
  border-radius: 5px;
  font-size: 0.82rem;
  font-family: inherit;
  color: #172351;
  outline: none;
}
.prf-add-form input:focus,
.prf-add-form select:focus { border-color: #D97706; }

.prf-add-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.prf-btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.prf-btn-primary {
  background: #D97706;
  color: #fff;
}
.prf-btn-primary:hover { background: #B45309; }
.prf-btn-secondary {
  background: #F1F5F9;
  color: #64748B;
}
.prf-btn-secondary:hover { background: #E2E8F0; }

/* ---- Discover Feed ---- */
.prf-feed-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.prf-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.prf-pill {
  padding: 4px 12px;
  border-radius: 16px;
  border: 1px solid #E5E7EB;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: #64748B;
}
.prf-pill:hover { border-color: #D97706; color: #D97706; }
.prf-pill.active {
  background: #D97706;
  color: #fff;
  border-color: #D97706;
}

.prf-sort-select {
  margin-left: auto;
  padding: 5px 10px;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: inherit;
  color: #374151;
  background: #fff;
  cursor: pointer;
}

/* ---- Feed Cards ---- */
.prf-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.prf-card:hover {
  border-color: #D97706;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.08);
}
.prf-card.read { opacity: 0.7; }

.prf-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.prf-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #172351;
  flex: 1;
}
.prf-card-title a {
  color: inherit;
  text-decoration: none;
}
.prf-card-title a:hover { color: #D97706; }

.prf-card-score {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: #FEF3C7;
  color: #92400E;
  white-space: nowrap;
}

.prf-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  color: #94A3B8;
  margin-bottom: 8px;
}

.prf-card-source-badge {
  font-weight: 600;
  color: #D97706;
}

.prf-card-excerpt {
  font-size: 0.82rem;
  color: #64748B;
  line-height: 1.5;
  margin-bottom: 10px;
}

.prf-card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.prf-tag {
  font-size: 0.66rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  background: #EDE9FE;
  color: #6D28D9;
  text-transform: capitalize;
}

.prf-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prf-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid #E5E7EB;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: #64748B;
  font-family: inherit;
}
.prf-feedback-btn:hover { border-color: #D97706; color: #D97706; }
.prf-feedback-btn.active-more {
  background: #DCFCE7;
  border-color: #16A34A;
  color: #16A34A;
}
.prf-feedback-btn.active-less {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #EF4444;
}

.prf-explain-panel {
  display: none;
  margin-top: 10px;
  padding: 10px 14px;
  background: #F8FAFC;
  border-radius: 6px;
  border: 1px solid #E5E7EB;
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.5;
}
.prf-explain-panel.visible { display: block; }

/* ---- Load More ---- */
.prf-load-more {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  border: 1px dashed #FDE68A;
  border-radius: 6px;
  background: none;
  color: #D97706;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.prf-load-more:hover { background: #FFFBEB; border-color: #D97706; }

/* ---- Preferences ---- */
.prf-pref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.prf-pref-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #F8FAFC;
  border-radius: 6px;
  border: 1px solid #E5E7EB;
}

.prf-pref-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  text-transform: capitalize;
  min-width: 80px;
}

.prf-pref-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #E5E7EB;
  outline: none;
}
.prf-pref-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #D97706;
  cursor: pointer;
}

.prf-pref-value {
  font-size: 0.72rem;
  font-weight: 700;
  color: #92400E;
  min-width: 30px;
  text-align: right;
}

/* ---- Briefing ---- */
.prf-briefing-content {
  font-size: 0.85rem;
  line-height: 1.7;
  color: #374151;
}
.prf-briefing-content h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #172351;
  margin: 14px 0 6px;
}
.prf-briefing-content ul { padding-left: 18px; }
.prf-briefing-content li { margin-bottom: 4px; }

.prf-briefing-list {
  margin-top: 16px;
}

.prf-briefing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid #F1F5F9;
  font-size: 0.82rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.12s;
}
.prf-briefing-row:hover { background: #FFFBEB; }

.prf-briefing-date {
  font-weight: 600;
  color: #172351;
}

.prf-briefing-items {
  font-size: 0.72rem;
  color: #94A3B8;
}

/* ---- Traffic Light (for Engine Room) ---- */
.prf-traffic-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.prf-traffic-dot.green { background: #22C55E; }
.prf-traffic-dot.amber { background: #F59E0B; }
.prf-traffic-dot.red { background: #EF4444; }
.prf-traffic-dot.pending { background: #94A3B8; }
.prf-traffic-dot.clash { background: #F59E0B; border: 2px solid #EF4444; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .prf-feed-controls { flex-direction: column; align-items: stretch; }
  .prf-sort-select { margin-left: 0; }
  .prf-pref-grid { grid-template-columns: 1fr; }
}

/* ---- Empty / Loading states ---- */
.prf-loading, .prf-empty {
  text-align: center;
  padding: 30px;
  font-size: 0.85rem;
  color: #94A3B8;
}
.prf-loading i { margin-right: 6px; }

.prf-error {
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  color: #EF4444;
}
