/**
 * Word Counter — word-counter.css
 * Accent: #6366F1 (indigo) | RGB: 99, 102, 241
 * Unique: live char counter, top words list, bigger textarea, word goal progress.
 * All common styles from tool-base.css
 */

.wc-section {
    --tool-accent: #6366F1;
    --tool-accent-rgb: 99, 102, 241;
}

/* Textarea wrapper — positioned for live counter overlay */
.wc-input-wrap {
    position: relative;
}

.wc-textarea {
    min-height: 320px;
    resize: vertical;
    padding-bottom: 36px;
    /* room for live counter */
}

/* Live word count shown inside bottom-right of textarea */
.wc-char-live {
    position: absolute;
    bottom: 10px;
    right: 14px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s;
}

.wc-char-live.wc-char-live--active {
    color: #6366F1;
}

/* Action bar padding inside card */
.wc-action-bar {
    padding: 12px 16px;
    border-top: 1px solid rgba(100, 116, 139, 0.1);
}

/* Stats grid — wider on word-counter (14 cards) */
.wc-stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    margin-top: 24px;
}

/* Highlight words + chars cards slightly */
#wc-stat-words,
#wc-stat-chars {
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.04);
}

/* Time cards */
.wc-stat--time .tool-stat-value {
    font-size: 1.25rem;
}

/* Top words section */
.wc-top-words {
    margin-top: 24px;
    background: #FFFFFF;
    border: 1px solid rgba(100, 116, 139, 0.14);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.wc-top-words-title {
    font-size: 0.9375rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin: 0 0 14px;
}

.wc-top-words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wc-word-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.wc-word-chip-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6366F1;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 999px;
    padding: 1px 7px;
    white-space: nowrap;
}

/* Word goal input */
.wc-goal-input {
    width: 90px;
    padding: 5px 10px;
    font-size: 0.8125rem;
}

/* Goal progress bar */
.wc-goal-bar {
    padding: 10px 16px 12px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.1);
    background: rgba(99, 102, 241, 0.02);
}

.wc-goal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.wc-goal-pct {
    color: var(--tool-accent);
    font-weight: 700;
}

.wc-goal-track {
    height: 6px;
    background: rgba(99, 102, 241, 0.12);
    border-radius: 3px;
    overflow: hidden;
}

.wc-goal-fill {
    height: 100%;
    background: #6366F1;
    border-radius: 3px;
    transition: width 0.3s ease, background 0.3s;
    width: 0%;
}

.wc-goal-fill--near {
    background: #F59E0B;
}

.wc-goal-fill--done {
    background: #10B981;
}

/* Longest word — truncate if very long */
.wc-longest-val {
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Mobile */
@media (max-width: 640px) {
    .wc-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}