/**
 * Insights Tab Styles
 * 
 * Styling for the Insights tab in Activities modal showing AI-generated
 * lead intelligence and recommendations
 */

/* ==================== Insights Tab Styles ==================== */

.insights-main-container {
  padding: 20px;
  background: #f7f7f7;
}

.insights-header-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.insights-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 16px;
}

.header-card {
  padding: 20px;
  border: 2px solid #e5e7eb;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.header-card:hover {
  border-color: #30a5bf;
  box-shadow: 0 4px 12px rgba(48, 165, 191, 0.1);
}

/* KPI Header - Icon and Label */
.kpi-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-header i {
  font-size: 16px;
  color: #6b7280;
}

.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  font-weight: 600;
}

/* KPI Value - Large Number/Text */
.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
}

.kpi-unit {
  font-size: 22px;
  color: #6b7280;
  font-weight: 500;
  margin-left: 2px;
}

/* KPI Trend - Description Below */
.kpi-trend {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.5;
  opacity: 0.85;
}

.trend-text {
  flex: 1;
  font-weight: 400;
}

.trend-text.truncated {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trend-text.expanded {
  display: block;
}

.show-more-btn {
  background: none;
  border: none;
  color: #30a5bf;
  font-size: 11px;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  transition: color 0.2s;
}

.show-more-btn:hover {
  color: #2590a8;
}

.show-more-btn i {
  font-size: 10px;
  transition: transform 0.2s;
}

.show-more-btn.expanded i {
  transform: rotate(180deg);
}

.trend-indicator {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Color States for Cards */
.header-card.temperature-hot {
  border-left: 4px solid #ef4444;
}

.header-card.temperature-hot .kpi-value {
  color: #ef4444;
}

.header-card.temperature-warm {
  border-left: 4px solid #f59e0b;
}

.header-card.temperature-warm .kpi-value {
  color: #f59e0b;
}

.header-card.temperature-cold {
  border-left: 4px solid #3b82f6;
}

.header-card.temperature-cold .kpi-value {
  color: #3b82f6;
}

.header-card.stage-interest {
  border-left: 4px solid #8b5cf6;
}

.header-card.stage-evaluation {
  border-left: 4px solid #6366f1;
}

.header-card.stage-negotiation {
  border-left: 4px solid #10b981;
}

.header-card.score-1,
.header-card.score-2,
.header-card.score-3 {
  border-left: 4px solid #ef4444;
}

.header-card.score-4,
.header-card.score-5,
.header-card.score-6 {
  border-left: 4px solid #f59e0b;
}

.header-card.score-7,
.header-card.score-8 {
  border-left: 4px solid #3b82f6;
}

.header-card.score-9,
.header-card.score-10 {
  border-left: 4px solid #10b981;
}

.header-card.activity-high {
  border-left: 4px solid #10b981;
}

.header-card.activity-high .kpi-value {
  color: #10b981;
}

.header-card.activity-medium {
  border-left: 4px solid #f59e0b;
}

.header-card.activity-medium .kpi-value {
  color: #f59e0b;
}

.header-card.activity-low {
  border-left: 4px solid #6b7280;
}

.header-card.activity-low .kpi-value {
  color: #6b7280;
}

.header-card.probability-high {
  border-left: 4px solid #10b981;
}

.header-card.probability-high .kpi-value {
  color: #10b981;
}

.header-card.probability-medium {
  border-left: 4px solid #f59e0b;
}

.header-card.probability-medium .kpi-value {
  color: #f59e0b;
}

.header-card.probability-low {
  border-left: 4px solid #ef4444;
}

.header-card.probability-low .kpi-value {
  color: #ef4444;
}

.trend-indicator.high {
  background: #d1fae5;
  color: #065f46;
}

.trend-indicator.medium {
  background: #fef3c7;
  color: #92400e;
}

.trend-indicator.low {
  background: #fee2e2;
  color: #991b1b;
}

/* Old Card Styles - Keeping for backward compatibility */
.card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  margin-bottom: 10px;
  font-weight: 600;
}

.card-value {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.card-value i {
  font-size: 24px;
  color: #30a5bf;
}

.card-value-unit {
  font-size: 18px;
  color: #6b7280;
  font-weight: 500;
}

.insights-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.insights-card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #33475b;
  letter-spacing: -0.01em;
}

.insights-card-body {
  padding: 20px;
}

.success-score {
  font-size: 28px;
  font-weight: 700;
  color: #30a5bf;
}

.engagement-score {
  font-size: 24px;
  font-weight: 700;
  color: #6366f1;
}

.progress-bar-container {
  background: #e5e7eb;
  border-radius: 8px;
  height: 12px;
  overflow: hidden;
  margin: 16px 0;
}

.recommendation-text {
  font-style: italic;
  color: #6b7280;
  margin: 0 0 16px 0;
  line-height: 1.6;
}

.factors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.factor-column {
  padding: 12px;
  border-radius: 6px;
}

.factor-column.positive {
  background: #f0fdf4;
  border: 1px solid #86efac;
}

.factor-column.negative {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.factor-header {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.factor-column.positive .factor-header {
  color: #059669;
}

.factor-column.negative .factor-header {
  color: #dc2626;
}

.factor-list {
  margin: 0;
  padding-left: 20px;
  color: #4b5563;
  font-size: 13px;
}

.factor-list li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.action-item {
  padding: 16px;
  background: #f9fafb;
  border-left: 4px solid #9ca3af;
  border-radius: 6px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-item.priority-high {
  background: #fef2f2;
  border-left-color: #ef4444;
}

.action-item.priority-medium {
  background: #fef3c7;
  border-left-color: #f59e0b;
}

.action-item.priority-low {
  background: #f0f9ff;
  border-left-color: #3b82f6;
}

.action-item:last-child {
  margin-bottom: 0;
}

.action-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.priority-badge {
  background: #6b7280;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.priority-badge.high {
  background: #ef4444;
}

.priority-badge.medium {
  background: #f59e0b;
}

.priority-badge.low {
  background: #3b82f6;
}

.timing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.action-priority {
  background: #6b7280;
  color: white;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 14px;
}

.action-item.priority .action-priority {
  background: #f59e0b;
}

.action-content {
  flex: 1;
}

.action-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: #1f2937;
  font-size: 15px;
}

.action-reasoning {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.action-timing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}

.action-talking-points {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.talking-points-header {
  font-weight: 600;
  font-size: 13px;
  color: #374151;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-talking-points ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: #6b7280;
}

.action-talking-points li {
  margin-bottom: 4px;
  line-height: 1.5;
}

/* Summary Section */
.summary-text {
  font-size: 15px;
  color: #374151;
  line-height: 1.7;
  margin: 0;
}

/* Company Activity Details */
.activity-relevance,
.recent-developments,
.timing-opportunities {
  margin-bottom: 20px;
}

.activity-relevance:last-child,
.recent-developments:last-child,
.timing-opportunities:last-child {
  margin-bottom: 0;
}

.activity-relevance h4,
.recent-developments h4,
.timing-opportunities h4 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.activity-relevance h4 i,
.recent-developments h4 i,
.timing-opportunities h4 i {
  color: #30a5bf;
}

.activity-relevance p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

.recent-developments ul,
.timing-opportunities ul {
  margin: 0;
  padding-left: 20px;
}

.recent-developments li,
.timing-opportunities li {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 8px;
}

.recent-developments li:last-child,
.timing-opportunities li:last-child {
  margin-bottom: 0;
}

.insight-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insight-item {
  padding: 14px;
  background: #f9fafb;
  border-radius: 6px;
  border-left: 3px solid #30a5bf;
}

.insight-item.insight-opportunity {
  border-left-color: #10b981;
  background: #f0fdf4;
}

.insight-item.insight-timing {
  border-left-color: #f59e0b;
  background: #fef3c7;
}

.insight-item.insight-risk {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.insight-header {
  display: flex;
  align-items: start;
  gap: 10px;
}

.insight-icon {
  color: #30a5bf;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.insight-item.insight-opportunity .insight-icon {
  color: #10b981;
}

.insight-item.insight-timing .insight-icon {
  color: #f59e0b;
}

.insight-item.insight-risk .insight-icon {
  color: #ef4444;
}

.insight-text {
  color: #1f2937;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 500;
  flex: 1;
}

.insight-evidence {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
  margin-top: 8px;
  padding-left: 26px;
  font-style: italic;
}

.engagement-summary {
  color: #4b5563;
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.engagement-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.engagement-column {
  padding: 12px;
  border-radius: 6px;
}

.engagement-column.strengths {
  background: #f0fdf4;
  border: 1px solid #86efac;
}

.engagement-column.concerns {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.engagement-header {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.engagement-column.strengths .engagement-header {
  color: #059669;
}

.engagement-column.concerns .engagement-header {
  color: #dc2626;
}

.engagement-column ul {
  margin: 0;
  padding-left: 20px;
  color: #4b5563;
  font-size: 13px;
}

.engagement-column li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.opportunity-item {
  padding: 16px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  margin-bottom: 12px;
}

.opportunity-item:last-child {
  margin-bottom: 0;
}

.opportunity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.opportunity-type {
  font-weight: 600;
  color: #166534;
  text-transform: capitalize;
  font-size: 15px;
}

.opportunity-badges {
  display: flex;
  gap: 8px;
}

.opp-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.opp-badge.value {
  background: #dcfce7;
  color: #166534;
}

.opp-badge.likelihood {
  background: #dbeafe;
  color: #1e40af;
}

.opportunity-description {
  color: #166534;
  font-size: 14px;
  line-height: 1.5;
}

.activity-level {
  display: inline-flex;
  align-items: center;
  background: #f3f4f6;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  color: #374151;
  font-weight: 600;
  text-transform: capitalize;
}

.news-item {
  padding: 12px;
  background: #f9fafb;
  border-left: 3px solid #30a5bf;
  border-radius: 4px;
  margin-bottom: 10px;
}

.news-item:last-child {
  margin-bottom: 0;
}

.news-title {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.4;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.news-date {
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
}

.news-relevance {
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.news-relevance.high {
  background: #fef3c7;
  color: #92400e;
}

.news-relevance.medium {
  background: #f3f4f6;
  color: #4b5563;
}

.comm-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-box {
  text-align: center;
  padding: 16px;
  background: #f9fafb;
  border-radius: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #30a5bf;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.sentiment-box {
  padding: 12px;
  background: #f0fdf4;
  border-radius: 6px;
  text-align: center;
}

.sentiment-label {
  font-size: 12px;
  color: #166534;
  font-weight: 600;
}

.sentiment-value {
  font-size: 16px;
  color: #166534;
  font-weight: 700;
  margin-left: 6px;
}

.insights-metadata {
  padding: 16px;
  background: white;
  border-radius: 6px;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
  border: 1px solid #e5e7eb;
}

.insights-metadata i {
  margin-right: 6px;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .insights-header-cards {
    grid-template-columns: 1fr 1fr;
  }
  
  .factors-grid,
  .engagement-details {
    grid-template-columns: 1fr;
  }
  
  .comm-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .opportunity-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .insights-header-cards {
    grid-template-columns: 1fr;
  }
  
  .card-value {
    font-size: 28px;
  }
  
  .comm-stats-grid {
    grid-template-columns: 1fr;
  }
}
