/* =========================================================
   143TOOL - Word Counter Styles
   Version: 1.0.0
   ========================================================= */

.wc-card {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
}

/* ---------- STATS GRID ---------- */
.wc-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.wc-stat {
    padding: 14px 12px;
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: transform .15s ease, border-color .2s ease;
}

.wc-stat:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}

.wc-stat-primary {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--primary) 10%, var(--surface)),
        color-mix(in srgb, var(--secondary) 8%, var(--surface)));
    border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}

.wc-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    word-break: break-all;
}

.wc-stat-primary .wc-stat-value {
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.wc-stat-label {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
}

/* ---------- TEXTAREA ---------- */
.wc-input-wrap {
    position: relative;
    margin-bottom: 20px;
}

.wc-textarea {
    width: 100%;
    min-height: 260px;
    padding: 18px 18px 50px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--body-bg);
    color: var(--text);
    font-size: 15px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    line-height: 1.7;
    resize: vertical;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.wc-textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.wc-textarea::placeholder {
    color: var(--text-muted);
    opacity: .7;
}

/* ---------- TOOLBAR ---------- */
.wc-toolbar {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    padding: 4px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.wc-tool-btn {
    padding: 7px 12px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-weight: 600;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
    font-family: inherit;
}

.wc-tool-btn:hover {
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--primary);
}

.wc-tool-danger:hover {
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
}

/* ---------- TIME ESTIMATES ---------- */
.wc-times {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.wc-time-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.wc-time-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.wc-time-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.wc-time-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

/* ---------- DENSITY ---------- */
.wc-density {
    padding: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 4px;
}

.wc-density-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.wc-density-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.wc-density-sub {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
}

.wc-density-list {
    display: grid;
    gap: 6px;
}

.wc-density-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    transition: transform .15s ease;
}

.wc-density-item:hover {
    transform: translateX(3px);
}

.wc-density-word {
    flex: 1;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wc-density-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    flex-shrink: 0;
}

.wc-density-bar {
    width: 80px;
    height: 8px;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
}

.wc-density-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 999px;
    transition: width .4s ease;
}

.wc-density-pct {
    min-width: 44px;
    font-size: 12px;
    font-weight: 800;
    color: var(--primary);
    text-align: right;
    flex-shrink: 0;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .wc-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    .wc-stat-primary {
        grid-column: span 3;
    }
    .wc-stat-primary .wc-stat-value {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .wc-card {
        padding: 16px;
    }
    .wc-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .wc-stat-primary {
        grid-column: span 2;
    }
    .wc-stat-value {
        font-size: 20px;
    }
    .wc-times {
        grid-template-columns: 1fr;
    }
    .wc-textarea {
        min-height: 200px;
        padding: 14px 14px 60px;
        font-size: 14px;
    }
    .wc-toolbar {
        bottom: 8px;
        right: 8px;
        left: 8px;
        justify-content: space-between;
    }
    .wc-tool-btn {
        flex: 1;
        text-align: center;
        padding: 8px 6px;
        font-size: 11px;
    }
    .wc-density-bar {
        width: 50px;
    }
}

/* =========================================================
   SEO ARTICLE / ADSENSE CONTENT
   ========================================================= */

.tool-article {
    max-width: 800px;
    margin: 60px auto 40px;
    padding: 30px 0;
    border-top: 1px solid var(--border);
}

.tool-article h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin: 36px 0 14px;
    line-height: 1.3;
    letter-spacing: -.4px;
}

.tool-article h2:first-child {
    margin-top: 0;
}

.tool-article h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 24px 0 10px;
    line-height: 1.4;
}

.tool-article p {
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-muted);
    margin: 0 0 16px;
}

.tool-article ul,
.tool-article ol {
    padding-left: 22px;
    margin: 0 0 18px;
}

.tool-article li {
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.tool-article strong {
    color: var(--text);
    font-weight: 700;
}

.tool-article a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: color .15s ease;
}

.tool-article a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

@media (max-width: 620px) {
    .tool-article {
        padding: 20px 0;
        margin: 40px auto 20px;
    }
    .tool-article h2 {
        font-size: 20px;
        margin: 28px 0 12px;
    }
    .tool-article h3 {
        font-size: 16px;
        margin: 20px 0 8px;
    }
    .tool-article p,
    .tool-article li {
        font-size: 15px;
        line-height: 1.7;
    }
}