/* Reason Tooltip Styles */

/* Typography clamps to keep header to 1-2 lines */
.reason-tooltip__name {
  max-width: 48ch;
  white-space: normal;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.reason-tooltip__description {
  max-width: 56ch;
  opacity: 0.8;
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.3;
}

.reason-tooltip__summary p {
  margin: 8px 0 0;
  line-height: 1.35;
  font-size: 13px;
}

.reason-tooltip__explanation-text {
  margin: 0;
  line-height: 1.35;
  font-size: 13px;
}

/* Dev warning styling - quiet and subtle */
.reason-tooltip__dev-warn {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 8px;
  color: #f59e0b;
  background: #fef3c7;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #f59e0b;
}

/* Base tooltip styling */
.reason-tooltip {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 320px;
  font-family: system-ui, -apple-system, sans-serif;
}

.reason-tooltip__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reason-tooltip__header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.reason-tooltip__emoji {
  font-size: 16px;
  line-height: 1;
}

.reason-tooltip__title {
  flex: 1;
  min-width: 0;
}

/* Chip improvements - better semantic layout */
.reason-tooltip__chips {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.reason-tooltip__chip {
  display: flex;
  gap: 8px;
  font-size: 12px;
  padding: 4px 8px;
  background: #f3f4f6;
  border-radius: 4px;
  margin: 0;
}

.reason-tooltip__chip dt {
  font-weight: 500;
  color: #6b7280;
  margin: 0;
}

.reason-tooltip__chip dd {
  font-weight: 600;
  color: #111827;
  margin: 0;
}

/* Collapsible sections */
.reason-tooltip__details-toggle,
.reason-tooltip__math-toggle,
.reason-tooltip__expand-button {
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reason-tooltip__details-toggle:hover,
.reason-tooltip__math-toggle:hover,
.reason-tooltip__expand-button:hover {
  color: #374151;
}

.reason-tooltip__chevron {
  transition: transform 0.2s ease;
  font-size: 10px;
}

.reason-tooltip__details-content,
.reason-tooltip__math-content {
  margin-top: 8px;
}

.reason-tooltip__step-list {
  margin: 8px 0 0;
  padding-left: 16px;
  font-size: 12px;
}

.reason-tooltip__step {
  margin: 4px 0;
  line-height: 1.4;
}

/* Color variants */
.reason-tooltip--green {
  border-color: #10b981;
}

.reason-tooltip--blue {
  border-color: #3b82f6;
}

.reason-tooltip--purple {
  border-color: #8b5cf6;
}

.reason-tooltip--orange {
  border-color: #f59e0b;
}

.reason-tooltip--gray {
  border-color: #6b7280;
}

/* Formula display */
.reason-tooltip__formula {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}

.reason-tooltip__expansion {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: monospace;
  font-size: 12px;
}

.reason-tooltip__arrow {
  color: #6b7280;
}

.reason-tooltip__expanded {
  background: #f3f4f6;
  padding: 2px 4px;
  border-radius: 3px;
}

.reason-tooltip__label {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .reason-tooltip {
    max-width: 280px;
  }

  .reason-tooltip__name {
    max-width: 40ch;
  }

  .reason-tooltip__description {
    max-width: 44ch;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .reason-tooltip__chevron {
    transition: none;
  }
}
