/* ============================================
   WORD COUNTER — additions
      All classes namespaced .wc-*.
   ============================================ */

.word-counter {
  max-width: 980px;
  margin: 0 auto;
}

/* ===== Editor + toolbar ===== */
.wc-editor {
  margin-bottom: 1.5rem;
}

.wc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.wc-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wc-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wc-lang-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wc-lang-select {
  padding: 0.4rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  min-height: 36px;
}

.wc-textarea {
  width: 100%;
  min-height: 220px;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  transition: var(--transition);
}

.wc-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg);
}

.wc-info-bar {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.wc-info-sep {
  color: var(--border);
}

/* ===== Stat cards ===== */
.wc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.wc-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  transition: var(--transition);
}

.wc-stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.wc-stat-highlight {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent;
}

.wc-stat-highlight .wc-stat-value,
.wc-stat-highlight .wc-stat-label,
.wc-stat-highlight .wc-stat-icon { color: var(--on-primary); }

.wc-stat-icon {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.wc-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.wc-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.wc-stat-label small { font-weight: 400; opacity: 0.85; }

/* ===== Readability ===== */
.wc-readability {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.wc-readability h3,
.wc-times h3,
.wc-platforms-header h3,
.wc-transform-header h3,
.wc-keywords h3 {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
  color: var(--text);
}

.wc-readability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.wc-read-card {
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.wc-read-flesch { grid-column: span 2; }
@media (max-width: 700px) { .wc-read-flesch { grid-column: span 1; } }

.wc-read-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.wc-read-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.wc-read-value small {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 0.2rem;
}

.wc-read-tier {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-weight: 500;
}

.wc-read-bar {
  margin-top: 0.5rem;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.wc-read-fill {
  height: 100%;
  border-radius: 999px;
  width: 0;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
}

/* ===== Time estimates ===== */
.wc-times {
  margin-bottom: 1.5rem;
}

.wc-times-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
}

.wc-time-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  text-align: center;
}

.wc-time-icon { font-size: 1.2rem; margin-bottom: 0.2rem; }

.wc-time-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.wc-time-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.wc-time-label small {
  display: block;
  font-size: 0.65rem;
  opacity: 0.8;
}

/* ===== Platform chips + bars ===== */
.wc-platforms {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.wc-platforms-help {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.wc-platforms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.wc-platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  min-height: 40px;
  user-select: none;
}

.wc-platform-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.wc-platform-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.25);
}

.wc-platform-icon { font-size: 1rem; line-height: 1; }

/* Bars grouped by platform */
.wc-bars-grid {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.wc-bars-empty {
  margin: 0;
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.wc-bars-group {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

.wc-bars-group:first-child { border-top: none; padding-top: 0; }

.wc-bars-group-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.wc-bar-card {
  margin-bottom: 0.5rem;
}

.wc-bar-card:last-child { margin-bottom: 0; }

.wc-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
}

.wc-bar-label {
  color: var(--text);
  font-weight: 500;
}

.wc-bar-count {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
}

.wc-bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.wc-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease, background 0.2s ease;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.wc-bar-tight .wc-bar-fill { background: var(--warning); }
.wc-bar-tight .wc-bar-count { color: var(--warning); font-weight: 600; }

.wc-bar-over .wc-bar-fill { background: var(--danger); }
.wc-bar-over .wc-bar-count { color: var(--danger); font-weight: 700; }

/* ===== Transform (case converter) ===== */
.wc-transform {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.wc-transform-help {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.wc-transform-help #wc-transform-target {
  color: var(--primary);
  font-weight: 600;
}

.wc-transform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.wc-transform-btn {
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
  text-align: center;
}

.wc-transform-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.06);
  transform: translateY(-1px);
}

.wc-transform-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wc-transform-undo {
  background: var(--surface);
  font-weight: 600;
}

.wc-transform-undo:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== Keywords ===== */
.wc-keywords {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.wc-keywords h3 small {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.4rem;
}

.wc-keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wc-kw-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text);
  transition: var(--transition);
}

.wc-kw-tag:hover { border-color: var(--primary); }

.wc-kw-tag strong { color: var(--primary); }
.wc-kw-tag small { color: var(--text-muted); margin-left: 0.3rem; font-size: 0.75rem; }

/* ===== Action buttons ===== */
.wc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.wc-actions .btn {
  min-height: 44px;
  flex: 1 1 auto;
  min-width: 160px;
}

/* ===== Mobile (< 600px) ===== */
@media (max-width: 600px) {
  .wc-toolbar { flex-direction: column; align-items: stretch; }
  .wc-toolbar-right { justify-content: space-between; }
  .wc-stats { grid-template-columns: repeat(2, 1fr); }
  .wc-readability-grid { grid-template-columns: 1fr; }
  .wc-times-grid { grid-template-columns: repeat(2, 1fr); }
  .wc-transform-grid { grid-template-columns: repeat(2, 1fr); }
  .wc-actions .btn { flex: 1 1 100%; }
  .wc-textarea { font-size: 1rem; min-height: 180px; }
}

