/**
 * Shared output elements — hero, sections, fields, risk meter, confidence, timeline, adjustments, previews
 * Split from outputs.css — Phase 3.3
 */

/* ========================================
   COMMON OUTPUT ELEMENTS
   ======================================== */

.output-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  overflow: hidden;
}

.output-card:last-child {
  margin-bottom: 0;
}

.output-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-secondary);
  border-bottom: 1px solid var(--color-border);
}

.output-card__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.output-card__body {
  padding: var(--space-5);
}

/* ========================================
   HERO OUTPUT (Primary Result)
   ======================================== */

.output-hero {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
}

.output-hero--primary {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary-lighter) 100%);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.output-hero--info {
  background: linear-gradient(135deg, var(--color-info-light) 0%, rgba(59, 130, 246, 0.04) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.output-hero--success {
  background: linear-gradient(135deg, var(--color-success-light) 0%, rgba(34, 197, 94, 0.04) 100%);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.output-hero--warning {
  background: linear-gradient(135deg, var(--color-warning-light) 0%, rgba(245, 158, 11, 0.04) 100%);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.output-hero--error {
  background: linear-gradient(135deg, var(--color-error-light) 0%, rgba(239, 68, 68, 0.04) 100%);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.output-hero::before {
  content: attr(data-icon);
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--color-surface);
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-md);
  border-radius: var(--radius-sm);
  border: 1px solid inherit;
}

.output-hero__label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.output-hero__text {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-base);
  color: var(--color-text);
}

.output-hero__meta {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

/* ========================================
   SECTIONS
   ======================================== */

.output-section {
  margin-bottom: var(--space-5);
}

.output-section:last-child {
  margin-bottom: 0;
}

.output-section__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.output-section__content {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
}

/* ========================================
   FIELDS (Key-Value Pairs)
   ======================================== */

.output-field {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.output-field:last-child {
  margin-bottom: 0;
}

.output-field__label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  min-width: 120px;
}

.output-field__value {
  font-size: var(--font-size-sm);
  color: var(--color-text);
}


/* ========================================
   ALTERNATIVES
   ======================================== */

.alternatives {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}

.alternatives__title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.alternatives__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-3);
}

.alternative-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.alternative-card:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-lighter);
}

.alternative-card.is-selected {
  border-color: var(--color-primary);
  border-width: 2px;
  background: var(--color-primary-light);
}

.alternative-card__text {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-3);
}

.alternative-card__actions {
  display: flex;
  gap: var(--space-2);
}

/* ========================================
   COPY/ACTION FEEDBACK
   ======================================== */

.copy-feedback {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-text);
  color: white;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease;
  z-index: var(--z-toast);
}

/* ========================================
   RISK METER
   ======================================== */

.risk-meter {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-secondary);
  border-radius: var(--radius-md);
}

.risk-meter__bar {
  flex: 1;
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.risk-meter__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.risk-meter__fill--low {
  background: var(--color-success);
  width: 25%;
}

.risk-meter__fill--medium {
  background: var(--color-warning);
  width: 50%;
}

.risk-meter__fill--high {
  background: var(--color-error);
  width: 85%;
}

.risk-meter__label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  min-width: 60px;
}

/* ========================================
   CONFIDENCE INDICATOR
   ======================================== */

.confidence {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.confidence__value {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

/* ========================================
   ACTION ITEMS LIST
   ======================================== */

.action-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.action-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-item:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-lighter);
}

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

.action-item__number {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-secondary);
  border-radius: 50%;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.action-item--recommended .action-item__number {
  background: var(--color-primary);
  color: white;
}

.action-item__content {
  flex: 1;
}

.action-item__text {
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.action-item__meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ========================================
   TIMELINE (For Plan Steps)
   ======================================== */

.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-5);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__marker {
  position: absolute;
  left: calc(-1 * var(--space-8) + 4px);
  top: 0;
  width: 16px;
  height: 16px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 50%;
  z-index: 1;
}

.timeline__item--complete .timeline__marker {
  background: var(--color-success);
  border-color: var(--color-success);
}

.timeline__item--active .timeline__marker {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-light);
}

.timeline__item--pending .timeline__marker {
  background: var(--color-surface-secondary);
}

.timeline__content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.timeline__item--active .timeline__content {
  border-color: var(--color-primary);
}

.timeline__title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.timeline__desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}


/* ========================================
   RESPONSIVE OUTPUT ADJUSTMENTS
   ======================================== */

@media (max-width: 640px) {
  .negotiation-intel {
    grid-template-columns: 1fr;
  }
  
  .decision-option__pros-cons {
    grid-template-columns: 1fr;
  }
  
  .alternatives__grid {
    grid-template-columns: 1fr;
  }
  
  .finance-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ========================================
   COMPACT RESEARCH RESULTS (V4.4.5)
   ======================================== */

.opp-research-compact {
  margin-top: 12px;
  padding: 10px;
  background: linear-gradient(135deg, var(--color-sky-50) 0%, var(--color-green-50) 100%);
  border: 1px solid var(--color-sky-200);
  border-radius: 8px;
  font-size: 12px;
}

.opp-research-compact__title {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-sky-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.opp-research-compact__list {
  margin: 0;
  padding-left: 16px;
  color: var(--color-neutral-700);
}

.opp-research-compact__list li {
  margin-bottom: 4px;
  line-height: 1.4;
}

.opp-research-compact__tip {
  margin-top: 8px;
  padding: 8px;
  background: var(--color-yellow-50);
  border-radius: 4px;
  color: var(--color-yellow-800);
  font-size: 11px;
}

.opp-research-compact__empty {
  color: var(--color-neutral-400);
  font-style: italic;
  text-align: center;
  padding: 8px;
}

/* Smaller research button for compact layout */
.opp-person-v2__research {
  padding: 5px 10px;
  font-size: 10px;
}

/* ========================================
   COACHING NOTES STYLING (V4.4.6)
   ======================================== */

.opp-action__coaching {
  margin-top: 8px;
  padding: 8px 10px;
  background: linear-gradient(135deg, var(--color-blue-50) 0%, var(--color-green-50) 100%);
  border-radius: 6px;
  font-size: 12px;
  color: var(--color-blue-800);
  font-style: italic;
}

.opp-risk__coaching {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--color-yellow-50);
  border-radius: 6px;
  font-size: 12px;
  color: var(--color-yellow-800);
  font-style: italic;
}

/* ========================================
   RESEARCH INTEGRATION CSS (V4.4.7)
   ======================================== */

/* Enriched badge */
.opp-enriched-badge {
  display: inline-block;
  padding: 2px 6px;
  background: linear-gradient(135deg, var(--color-blue-500) 0%, var(--color-violet-500) 100%);
  color: white;
  font-size: 9px;
  font-weight: 600;
  border-radius: 4px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Research facts on person card */
.opp-person-v2__research-facts {
  margin-top: 12px;
  padding: 10px;
  background: linear-gradient(135deg, #ecfdf5 0%, var(--color-sky-50) 100%);
  border: 1px solid #a7f3d0;
  border-radius: 8px;
}

.opp-person-v2__research-facts-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-emerald-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.opp-research-facts-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: var(--color-neutral-700);
}

.opp-research-facts-list li {
  margin-bottom: 4px;
  line-height: 1.4;
}

.opp-person-v2__comm-tip {
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-yellow-800);
  background: var(--color-yellow-50);
  padding: 6px 8px;
  border-radius: 4px;
}

/* Email Research Style Button */
.email-research-style-btn {
  margin-left: auto;
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--color-violet-500) 0%, var(--color-indigo-500) 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.email-research-style-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.email-research-style-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* Email Style Research Results */
.email-style-research {
  margin: 12px 0;
}

.email-style-loading {
  padding: 16px;
  text-align: center;
  color: var(--color-violet-500);
  background: var(--color-violet-50);
  border-radius: 8px;
  animation: pulse 1.5s ease-in-out infinite;
}

.email-style-results {
  padding: 16px;
  background: linear-gradient(135deg, var(--color-violet-50) 0%, var(--color-blue-50) 100%);
  border: 1px solid var(--color-violet-300);
  border-radius: 10px;
}

.email-style-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-violet-700);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.email-style-item {
  font-size: 12px;
  color: var(--color-neutral-700);
  margin-bottom: 10px;
}

.email-style-item ul {
  margin: 4px 0 0 16px;
  padding: 0;
}

.email-style-item li {
  margin-bottom: 4px;
}

.email-style-opening {
  margin-top: 12px;
  padding: 10px;
  background: var(--color-yellow-50);
  border-radius: 6px;
  font-size: 12px;
  color: var(--color-yellow-800);
}

.email-style-close {
  margin-top: 12px;
  padding: 6px 12px;
  background: var(--color-neutral-200);
  border: none;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

.email-style-close:hover {
  background: var(--color-neutral-300);
}

.email-style-empty {
  color: var(--color-neutral-500);
  font-style: italic;
  padding: 10px 0;
}

.email-style-error {
  color: var(--color-red-600);
  padding: 10px;
  background: var(--color-red-50);
  border-radius: 6px;
}

/* Update email header to use flexbox for button alignment */
.email-output__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========================================
   OUTPUT ADJUSTMENT PANEL
   Post-run refinement interface (NOT chat)
   ======================================== */

.output-adjust {
  margin-top: 0;
}

/* Collapsed State */
.output-adjust__collapsed {
  padding: 0;
}

.output-adjust__divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--color-border) 20%, var(--color-border) 80%, transparent 100%);
  margin: 16px 0;
}

.output-adjust__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.output-adjust__toggle:hover {
  background: var(--color-surface-secondary);
  border-color: var(--color-border-hover);
}

.output-adjust__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.output-adjust__chevron {
  font-size: 10px;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
}

.output-adjust__toggle:hover .output-adjust__chevron {
  color: var(--color-text-secondary);
}

/* Expanded State */
.output-adjust__expanded .output-adjust__divider {
  margin-bottom: 12px;
}

.output-adjust__content {
  background: var(--color-surface-secondary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px;
}

.output-adjust__helper {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.output-adjust__input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  resize: vertical;
  min-height: 60px;
  max-height: 150px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.output-adjust__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-lighter);
}

/* Gold glow animation for adjustment input */
.output-adjust__input.gold-glow {
  border-color: #d4a f06;
  animation: goldPulse 2s ease-in-out infinite;
}

@keyframes goldPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(212, 175, 6, 0.2), 0 0 8px rgba(212, 175, 6, 0.3);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(212, 175, 6, 0.3), 0 0 16px rgba(212, 175, 6, 0.4);
  }
}

.output-adjust__input.gold-glow:focus {
  border-color: #d4af06;
  box-shadow: 0 0 0 3px rgba(212, 175, 6, 0.4), 0 0 12px rgba(212, 175, 6, 0.5);
  animation: none;
}

.output-adjust__input::placeholder {
  color: var(--color-text-muted);
  font-style: italic;
}

.output-adjust__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.output-adjust__cancel {
  color: var(--color-text-secondary);
}

.output-adjust__submit {
  min-width: 120px;
}

.output-adjust__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Updating State */
.output-adjust--updating .output-adjust__submit {
  pointer-events: none;
}

.output-adjust--updating .output-adjust__input {
  opacity: 0.6;
  pointer-events: none;
}

/* RTL Support */
[dir="rtl"] .output-adjust__toggle {
  flex-direction: row-reverse;
}

[dir="rtl"] .output-adjust__actions {
  flex-direction: row-reverse;
}

/* ========================================
   SPREADSHEET PREVIEW STYLES
   ======================================== */

.spreadsheet-preview {
  padding: 16px;
}

.spreadsheet-preview__sheet-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-neutral-700);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-neutral-200);
}

.spreadsheet-preview__table-wrapper {
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--color-neutral-200);
  border-radius: 8px;
  margin-bottom: 16px;
}

.spreadsheet-preview__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.spreadsheet-preview__table th,
.spreadsheet-preview__table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-neutral-200);
  border-right: 1px solid var(--color-neutral-100);
  white-space: nowrap;
}

.spreadsheet-preview__table th {
  background: var(--color-neutral-50);
  font-weight: 600;
  color: var(--color-neutral-700);
  position: sticky;
  top: 0;
}

.spreadsheet-preview__table tr:nth-child(even) td {
  background: var(--color-surface-secondary);
}

.spreadsheet-preview__table tr:hover td {
  background: var(--color-sky-50);
}

.spreadsheet-preview__empty {
  color: var(--color-neutral-500);
  font-style: italic;
  padding: 20px;
  text-align: center;
}

/* ========================================
   CALENDAR PREVIEW STYLES
   ======================================== */

.calendar-preview {
  padding: 20px;
  text-align: center;
}

.calendar-preview__icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.calendar-preview__title {
  font-size: 18px;
  font-weight: 600;
  color: #1e3a5f;
  margin-bottom: 12px;
}

.calendar-preview__time {
  font-size: 14px;
  color: var(--color-neutral-700);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.calendar-preview__location {
  font-size: 13px;
  color: var(--color-neutral-500);
  margin-bottom: 8px;
}

.calendar-preview__desc {
  font-size: 13px;
  color: var(--color-neutral-600);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-neutral-200);
  text-align: left;
}

.calendar-preview__attendees {
  font-size: 12px;
  color: var(--color-neutral-500);
  margin-top: 12px;
}

/* ========================================
   PDF PREVIEW STYLES
   ======================================== */

.pdf-preview {
  padding: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-neutral-200);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pdf-preview__title {
  font-size: 20px;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 8px;
}

.pdf-preview__subtitle {
  font-size: 12px;
  color: var(--color-neutral-500);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-neutral-200);
}

.pdf-preview__heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-neutral-700);
  margin-top: 16px;
  margin-bottom: 8px;
}

.pdf-preview__content {
  font-size: 13px;
  color: var(--color-neutral-600);
  line-height: 1.6;
  margin-bottom: 12px;
}

.pdf-preview__bullets {
  margin: 8px 0;
  padding-left: 20px;
}

.pdf-preview__bullets li {
  font-size: 13px;
  color: var(--color-neutral-600);
  margin-bottom: 6px;
}

