/* css/components/advice-result.css */

.advice-result {
  padding: var(--s-4);
}

.advice-result__breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: var(--s-5);
  font-family: var(--font-ui);
}

.advice-result__breadcrumb:hover {
  color: var(--accent);
}

.advice-result__category {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: var(--s-1);
}

.advice-result__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  font-family: var(--font-display);
  line-height: 1.2;
  margin-bottom: var(--s-1);
}

.advice-result__context {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: var(--s-5);
  line-height: 1.4;
}

/* Rekommendationsblock */
.advice-result__rec {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--s-4);
  margin-bottom: var(--s-4);
}

.advice-result__rec-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: var(--s-2);
}

.advice-result__rec-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: var(--s-2);
  font-family: var(--font-ui);
}

.advice-result__rec-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

/* Nyckeltal-grid */
.advice-result__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}

.advice-result__metric {
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: var(--s-3);
  text-align: center;
  border: 1px solid var(--border);
}

.advice-result__metric-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  display: block;
}

.advice-result__metric-value.positive { color: var(--gain); }
.advice-result__metric-value.negative { color: var(--loss); }
.advice-result__metric-value.neutral  { color: var(--text-1); }

.advice-result__metric-label {
  font-size: 10px;
  color: var(--text-2);
  margin-top: 2px;
  display: block;
}

/* Motivering */
.advice-result__reasoning {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: var(--s-4);
  margin-bottom: var(--s-4);
  border: 1px solid var(--border);
}

.advice-result__reasoning-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: var(--s-2);
}

.advice-result__reasoning-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

/* Caveat / risknotering */
.advice-result__caveat {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  background: var(--accent-subtle);
  border-radius: var(--r-sm);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.advice-result__caveat i {
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 1px;
}

/* Actions */
.advice-result__actions {
  display: flex;
  gap: var(--s-2);
}

.advice-result__action-primary {
  flex: 1;
  padding: var(--s-3) var(--s-4);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 150ms;
}

.advice-result__action-secondary {
  flex: 1;
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
}

/* Fallback: raw text när JSON-parse misslyckas */
.advice-result__raw {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: var(--s-4);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  white-space: pre-wrap;
  border: 1px solid var(--border);
  margin-bottom: var(--s-4);
}

/* Laddningsindikator */
.advice-result__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-10) var(--s-4);
  gap: var(--s-3);
  color: var(--text-2);
  font-size: 13px;
}

.advice-result__loading i {
  font-size: 28px;
  color: var(--accent);
  animation: spin 1.2s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
