/* ============================================
   Brand Guardian — Modern Component Styles
   ============================================ */

/* ==================== BUTTONS ==================== */
.bg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  white-space: nowrap;
}

.bg-btn:active { transform: scale(0.98); }
.bg-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.bg-btn--primary {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.3);
}
.bg-btn--primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
  box-shadow: 0 6px 16px -2px rgba(79, 70, 229, 0.4);
  transform: translateY(-1px);
}

.bg-btn--secondary {
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}
.bg-btn--secondary:hover:not(:disabled) {
  background: var(--color-bg-hover);
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.bg-btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  padding: 8px 16px;
}
.bg-btn--ghost:hover:not(:disabled) {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.bg-btn--sm {
  padding: 8px 16px;
  font-size: var(--text-xs);
}

.bg-btn--block { width: 100%; }

/* ==================== MODEL PILLS ==================== */
.bg-model-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.bg-model-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.bg-model-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
}

.bg-model-pill__dot--loaded {
  background: var(--color-success);
  box-shadow: 0 0 0 3px var(--color-success-bg);
}

/* ==================== GAUGE & STATS ==================== */
.bg-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: fadeSlideUp 400ms ease both;
}

.bg-gauge-container__canvas-wrap {
  position: relative;
  width: 160px;
  height: 160px;
}

.bg-gauge-container__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.bg-gauge-container__score {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  letter-spacing: -0.04em;
  color: var(--color-text);
}

.bg-gauge-container__scale {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: var(--font-medium);
}

.bg-gauge-container__label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-semibold);
}

/* ==================== DIMENSION BRIEF ==================== */
.bg-dim-brief {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
}

.bg-dim-brief__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bg-dim-brief__label {
  width: 110px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bg-dim-brief__bar-track {
  flex: 1;
  height: 8px;
  background: var(--color-bg-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bg-dim-brief__bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bg-dim-brief__value {
  width: 48px;
  text-align: right;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  font-variant-numeric: tabular-nums;
}

/* ==================== INPUT AREA ==================== */
.bg-input-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bg-textarea {
  width: 100%;
  min-height: 200px;
  padding: 20px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg-card);
  resize: vertical;
  transition: all var(--transition-base);
  outline: none;
  box-shadow: var(--shadow-inner);
}

.bg-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow), var(--shadow-inner);
}

.bg-textarea::placeholder { color: var(--color-text-placeholder); }

.bg-char-count {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  text-align: right;
  margin-top: -8px;
}

.bg-input-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* ==================== RESULTS EMPTY STATE ==================== */
.bg-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  color: var(--color-text-muted);
  text-align: center;
}

.bg-empty-state__icon {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  opacity: 0.2;
}

.bg-empty-state__text {
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
  max-width: 320px;
}

/* ==================== OVERALL SCORE CARD ==================== */
.bg-overall-score {
  padding: 32px;
  background: var(--color-primary-light);
  border-radius: var(--radius-xl);
  margin-bottom: 32px;
  border: 1px solid rgba(79, 70, 229, 0.1);
}

.bg-overall-score__score {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

.bg-overall-score__label {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-text);
  margin-bottom: 24px;
}

.bg-overall-score__stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.bg-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
}

.bg-stat__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.bg-stat__count {
  font-weight: var(--font-bold);
  color: var(--color-text);
  margin-left: 4px;
}

/* ==================== DIMENSION CARDS ==================== */
.bg-dim-scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.bg-dim-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.bg-dim-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
}

.bg-dim-card__name {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  margin-bottom: 16px;
  color: var(--color-text);
}

.bg-dim-card__canvas-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 16px;
}

.bg-dim-card__score {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: 8px;
}

.bg-dim-card__desc {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ==================== FEATURE DETAILS ==================== */
.bg-features {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.bg-feature-group__title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text);
}

.bg-feature-group__title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border-light);
}

.bg-feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.bg-feature-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.bg-feature-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border);
}

.bg-feature-card__name {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  margin-bottom: 16px;
  color: var(--color-text);
}

.bg-feature-card__row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.bg-feature-card__label {
  width: 120px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bg-feature-card__bar-track {
  flex: 1;
  height: 6px;
  background: var(--color-bg-hover);
  border-radius: var(--radius-full);
}

.bg-feature-card__bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

.bg-feature-card__value {
  width: 40px;
  text-align: right;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  font-variant-numeric: tabular-nums;
}

.bg-feature-card__top-class {
  color: var(--color-text);
  font-weight: var(--font-bold);
}

/* ==================== INSIGHTS & IMPROVED TEXTS ==================== */
.bg-insights, .bg-improved-texts {
  margin-top: 32px;
  padding: 32px;
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--color-border-light);
  box-shadow: var(--shadow-lg);
  animation: fadeSlideUp 500ms ease both;
}

.bg-insights__tldr {
  padding: 24px;
  background: var(--color-info-bg);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  font-size: var(--text-base);
  line-height: 1.6;
  margin-bottom: 32px;
  border: 1px solid var(--color-info-light);
}

.bg-insights__section-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin-bottom: 24px;
}

.bg-markdown h2 { font-size: var(--text-lg); margin: 24px 0 12px; }
.bg-markdown p { margin-bottom: 12px; }
.bg-markdown ul { padding-left: 24px; margin-bottom: 16px; }
.bg-markdown li { margin-bottom: 8px; }

.bg-improved-texts__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: 24px;
  color: var(--color-text);
}

.bg-improved-texts__proposals {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bg-improved-texts__proposal {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

.bg-improved-texts__proposal:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

.bg-improved-texts__proposal-header {
  padding: 20px 24px;
  background: var(--color-bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.bg-improved-texts__proposal-name {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  display: flex;
  align-items: center;
  gap: 12px;
}

.bg-proposals__badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
}

.bg-proposals__badge--good { background: var(--color-success-bg); color: var(--color-success); }
.bg-proposals__badge--mid { background: var(--color-warning-bg); color: var(--color-warning); }
.bg-proposals__badge--low { background: var(--color-danger-bg); color: var(--color-danger); }

.bg-improved-texts__proposal-body {
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: all var(--transition-slow);
  background: var(--color-bg);
}

.bg-improved-texts__proposal--expanded .bg-improved-texts__proposal-body {
  padding: 24px;
  max-height: 2000px;
  border-top: 1px solid var(--color-border-light);
}

/* ==================== DIFF HIGHLIGHTS ==================== */
.diff-add {
  background-color: var(--color-success-light);
  color: var(--color-success);
  text-decoration: none;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: var(--font-semibold);
}

.diff-remove {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  text-decoration: line-through;
  padding: 0 2px;
  border-radius: 2px;
  opacity: 0.8;
}

/* ==================== UTILS & ANIMATIONS ==================== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.bg-skeleton {
  background: linear-gradient(90deg, var(--color-bg-hover) 25%, var(--color-border-light) 50%, var(--color-bg-hover) 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }
