/* Stats Panel Styles - İstatistik paneli */

.freq-chart {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.freq-bar-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.freq-bar-bg {
  flex: 1;
  height: 12px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}

.freq-bar-fill {
  height: 100%;
  background: var(--chart-bar);
  border-radius: 99px;
  transition: width 0.3s var(--ease);
}

.freq-label {
  width: 80px;
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.freq-count {
  font-size: 0.7rem;
  color: var(--muted);
  width: 40px;
  text-align: right;
}

.stats-viz-select {
  width: 100%;
  padding: 0.5rem;
  background: var(--surface2);
  border: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  margin-bottom: var(--space-md);
  cursor: pointer;
  outline: none;
}

.stats-viz-select optgroup {
  font-style: normal;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  text-transform: uppercase;
  font-size: 0.6rem;
  letter-spacing: 0.02rem;
  padding-top: 5px;
}

.stats-viz-select option {
  padding: 4px;
  background: var(--surface2);
  color: var(--text);
  font-weight: normal;
  text-transform: none;
}

.freq-filter {
  padding: 1.25rem var(--space-md);
  background: var(--surface);
  border-bottom: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stats-view {
  display: none;
  padding: 0 var(--space-md) var(--space-md) var(--space-md);
}

.freq-filter-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.freq-filter-row>span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 120px;
}

.freq-filter-row label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.freq-filter input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  width: 100%;
  min-width: 60px;
}

.freq-filter input:focus {
  border-color: var(--accent);
  outline: none;
}

.hide-words-input {
  flex: 1;
  min-width: 150px;
}

.quality-form-row input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.ngram-item {
  padding: 0.5rem;
  border-bottom: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  font-size: var(--text-xs);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.ngram-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
}

.stats-section-title {
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  opacity: 0.75;
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Histogram & BySource Bars */
.histogram-bar-wrap,
.by-source-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.hist-label,
.src-label {
  width: 40px;
  font-size: var(--text-xs);
  color: var(--white-muted);
  flex-shrink: 0;
}

.src-label {
  width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hist-bar,
.src-bar {
  flex: 1;
  height: 8px;
  background: var(--surface2);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.histogram-bar-fill {
  height: 100%;
  background: var(--chart-bar);
  border-radius: var(--radius-xs);
  transition: width 0.4s var(--ease);
}

.src-num {
  font-size: var(--text-xs);
  color: var(--muted);
  width: 60px;
  text-align: right;
}

/* Lexical & Readability Enhancements */
.lexical-score-block {
  padding: var(--space-lg);
  background: var(--surface2);
  border-radius: var(--radius-md);
  border: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  text-align: center;
}

.lexical-score-value {
  font-size: 2.5rem;
  display: block;
  color: var(--turkuaz);
  margin: 0.5rem 0;
}

.quality-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.quality-tag-ok {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.quality-tag-warn {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.quality-tag-error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.quality-table td {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

.quality-table tr:last-child td {
  border-bottom: none;
}