/* ============================================
   TIMELINE - Activity Timeline & Log Entries
   ============================================ */

/* Timeline Header Controls */
.timeline-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: 15px;
}

.timeline-header-controls select {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.timeline-header-controls select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Timeline Container */
.timeline-container {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Timeline Card */
.timeline-card {
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border-left: 4px solid var(--border);
}

.timeline-card[data-type="call"] {
  border-left-color: var(--success);
}

.timeline-card[data-type="appointment"] {
  border-left-color: var(--primary);
}

.timeline-card[data-type="concept"] {
  border-left-color: var(--warning);
}

.timeline-card[data-type="wvl"] {
  border-left-color: #8b5cf6;
}

.timeline-card[data-type="lead_note"] {
  border-left-color: var(--text-light);
}

.timeline-card[data-type="motivation"] {
  border-left-color: #f59e0b;
}

/* Timeline card color overrides based on outcome/status */
.timeline-card.border-success { border-left-color: var(--success) !important; }
.timeline-card.border-danger { border-left-color: var(--danger) !important; }
.timeline-card.border-warning { border-left-color: var(--warning) !important; }
.timeline-card.border-neutral { border-left-color: var(--text-light) !important; }

.timeline-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.timeline-icon {
  font-size: 18px;
}

.timeline-date {
  font-size: 12px;
  color: var(--text-light);
}

.timeline-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.timeline-card-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.timeline-card-content.timeline-no-content {
  color: var(--text-light);
  font-style: italic;
  font-size: 13px;
}

.timeline-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
}

/* ============ SHARED LOG ENTRY STYLES ============ */
/* Unified styles for Follow-ups, Calls, Appointments, Concepts */

.log-entry {
  font-size: 12px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 3px solid var(--border);
}

.log-entry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.log-entry-time {
  color: var(--text-light);
  font-size: 11px;
}

.log-entry-status {
  font-weight: 500;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--bg);
}

.log-entry-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.log-entry-content {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.log-entry-comment {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drilldown-card-clickable:hover {
  background: var(--bg-hover, #f9fafb);
}

.log-entry-scheduled {
  margin-top: 4px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

/* Status badge colors - unified across all sections */
.status-success { background: #dcfce7; color: #166534; }
.status-danger { background: #fee2e2; color: #991b1b; }
.status-warning { background: #fef3c7; color: #92400e; }
.status-neutral { background: #f3f4f6; color: #6b7280; }
.status-info { background: #dbeafe; color: #1d4ed8; }

/* Border colors for status */
.log-entry.border-success { border-left-color: var(--success); }
.log-entry.border-danger { border-left-color: var(--danger); }
.log-entry.border-warning { border-left-color: var(--warning); }
.log-entry.border-neutral { border-left-color: var(--text-light); }
.log-entry.border-info { border-left-color: #8b5cf6; }

/* Overdue styling */
.log-entry.border-overdue {
  border-left-color: var(--danger);
  background: #fef2f2;
}
.log-entry.border-overdue .log-entry-time {
  color: var(--danger);
  font-weight: 500;
}

/* Soon styling (within 7 days) */
.log-entry.border-soon {
  border-left-color: var(--warning);
  background: #fffbeb;
}

/* Completed/history items */
.log-entry.log-entry-completed {
  opacity: 0.7;
  border-left-color: var(--text-light);
  background: var(--bg);
}

/* Product and company tags for concepts */
.log-entry .product {
  font-weight: 600;
  color: var(--text);
}

.log-entry .company {
  color: var(--text-light);
  font-size: 11px;
}

/* Label tag (for appointments) */
.log-entry .appt-label-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .timeline-header-controls {
    margin-left: 0;
    margin-right: 10px;
  }

  .timeline-container {
    padding: 15px;
  }
}
