/* === LOKLU Score & Badge Components v2.0 === */

/* Score color utility classes */
.score-excellent { color: #D4FF00; }
.score-good { color: #ff7828; }
.score-fair { color: #F59E0B; }
.score-poor { color: #FF4D00; }

.score-bg-excellent { background: #D4FF00; }
.score-bg-good { background: #ff7828; }
.score-bg-fair { background: #F59E0B; }
.score-bg-poor { background: #FF4D00; }

/* Score Ring — circular SVG gauge */
.score-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.score-ring svg { transform: rotate(-90deg); }
.score-ring__track {
  fill: none;
  stroke: rgba(255,255,255,0.08);
}
.score-ring__fill {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.score-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-ring__value {
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  line-height: 1;
}
.score-ring__grade {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.4em;
  opacity: 0.7;
  margin-top: 2px;
}
/* Sizes */
.score-ring--sm { width: 72px; height: 72px; }
.score-ring--sm .score-ring__value { font-size: 24px; }
.score-ring--md { width: 120px; height: 120px; }
.score-ring--md .score-ring__value { font-size: 36px; }
.score-ring--lg { width: 160px; height: 160px; }
.score-ring--lg .score-ring__value { font-size: 48px; }
.score-ring--xl { width: 200px; height: 200px; }
.score-ring--xl .score-ring__value { font-size: 56px; }

/* Dimension Bar */
.dim-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.dim-bar__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--orange-500, #ff7828);
}
.dim-bar__label {
  flex: 1;
  font-size: 14px;
  color: #E8E4DE;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dim-bar__track {
  width: 120px;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.dim-bar__fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}
.dim-bar__score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  min-width: 32px;
  text-align: right;
}

/* Score Breakdown (stacked dim bars) */
.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.score-breakdown--collapsible .score-breakdown__items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.score-breakdown--collapsible.is-open .score-breakdown__items {
  max-height: 2000px;
}
.score-breakdown__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  cursor: pointer;
  color: #E8E4DE;
  font-size: 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  transition: background 0.2s;
}
.score-breakdown__toggle:hover { background: rgba(255,255,255,0.06); }
.score-breakdown__toggle svg {
  transition: transform 0.3s;
}
.score-breakdown--collapsible.is-open .score-breakdown__toggle svg {
  transform: rotate(180deg);
}

/* Pill Meter (vertical thermometer) */
.pill-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.pill-meter__bar {
  width: 32px;
  height: 200px;
  border-radius: 16px;
  background: linear-gradient(to top, #FF4D00 0%, #F59E0B 33%, #ff7828 66%, #D4FF00 100%);
  position: relative;
  overflow: visible;
}
.pill-meter__indicator {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 4px;
  background: #E8E4DE;
  border-radius: 2px;
  transition: bottom 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(232,228,222,0.5);
}
.pill-meter__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: #E8E4DE;
}

/* === Grade Badges === */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 16px;
  border: 2px solid;
}
.grade-badge--aplus { background: rgba(212,255,0,0.15); border-color: #D4FF00; color: #D4FF00; }
.grade-badge--a { background: rgba(212,255,0,0.12); border-color: #D4FF00; color: #D4FF00; }
.grade-badge--b { background: rgba(255,120,40,0.12); border-color: #ff7828; color: #ff7828; }
.grade-badge--c { background: rgba(245,158,11,0.12); border-color: #F59E0B; color: #F59E0B; }
.grade-badge--d { background: rgba(255,77,0,0.12); border-color: #FF4D00; color: #FF4D00; }
.grade-badge--f { background: rgba(255,77,0,0.15); border-color: #FF4D00; color: #FF4D00; }

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid;
}
.status-badge--excellent { background: rgba(212,255,0,0.1); border-color: rgba(212,255,0,0.3); color: #D4FF00; }
.status-badge--good { background: rgba(255,120,40,0.1); border-color: rgba(255,120,40,0.3); color: #ff7828; }
.status-badge--attention { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: #F59E0B; }
.status-badge--critical { background: rgba(255,77,0,0.1); border-color: rgba(255,77,0,0.3); color: #FF4D00; }
.status-badge--info { background: rgba(96,165,250,0.1); border-color: rgba(96,165,250,0.3); color: #60A5FA; }

/* Trend Badges */
.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
}
.trend-badge--rising { background: rgba(212,255,0,0.1); color: #D4FF00; }
.trend-badge--stable { background: rgba(255,120,40,0.1); color: #ff7828; }
.trend-badge--declining { background: rgba(255,77,0,0.1); color: #FF4D00; }
.trend-badge--top-pick { background: rgba(212,255,0,0.15); color: #D4FF00; }

/* Stat Pill */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  color: #E8E4DE;
}
.stat-pill__value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #ff7828;
}
