/* ---------------------------
 * Text Counter – główny wrapper
 * -------------------------- */

.textcounter-wrapper {
    box-sizing: border-box;
    margin: 0 auto 2rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ---------------------------
 * Pola i etykiety
 * -------------------------- */

.textcounter-wrapper label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.textcounter-help {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.textcounter-field {
    width: 100%;
}

/* ---------------------------
 * Pola textarea
 * -------------------------- */

.textcounter-wrapper textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--e-global-color-uicore_body, #d1d5db);
    background: var(--e-global-color-uicore_white, #ffffff);
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 200px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.textcounter-wrapper textarea:focus {
    outline: none;
    border-color: var(--e-global-color-uicore_primary, #2563eb);
    box-shadow: 0 0 0 1px var(--e-global-color-uicore_primary, #2563eb);
}

/* ---------------------------
 * Sekcja przycisków
 * -------------------------- */

.textcounter-actions {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.textcounter-button-primary,
.textcounter-button-secondary {
    min-width: 180px;
    padding-inline: 1.5rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    cursor: pointer;
}

/* proporcje jak w slugify / metacheck / headingcheck */
.textcounter-button-primary {
    flex: 2 1 220px;
}

.textcounter-button-secondary {
    flex: 1 1 140px;
}

/* przycisk „Wyczyść” – spójnie z headingcheck */
.textcounter-button-secondary {
    background-color: var(--e-global-color-uicore_light, #f9fafb);
    color: var(--e-global-color-uicore_primary, #2563eb);
    border: 1px solid var(--e-global-color-uicore_primary, #2563eb);
}

.textcounter-button-secondary:hover {
    background-color: var(--e-global-color-uicore_primary, #2563eb);
    color: var(--e-global-color-uicore_white, #ffffff);
}

/* ---------------------------
 * Wyniki analizy – obszar wyników
 * -------------------------- */

.textcounter-results {
    margin-top: 0.75rem;
}

/* ---------------------------
 * Podsumowanie + metryki
 * -------------------------- */

.textcounter-summary {
    border-radius: 6px;
    border: 1px solid var(--e-global-color-uicore_light, #e5e7eb);
    background: var(--e-global-color-uicore_white, #ffffff);
    padding: 0.9rem 1rem 1.1rem;
    font-size: 0.9rem;
}

.textcounter-summary-heading {
    margin: 0 0 0.5rem;
    font-size: 0.98rem;
    font-weight: 600;
    color: #111827;
}

/* kratka metryk – licznik znaków, słów, zdań itd. */
.textcounter-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem 0.9rem;
    margin-top: 0.35rem;
}

.textcounter-metric {
    padding: 0.55rem 0.6rem;
    border-radius: 6px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.textcounter-metric-label {
    font-size: 0.82rem;
    color: #4b5563;
}

.textcounter-metric-value {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

/* ---------------------------
 * Notka informacyjna pod wynikami
 * -------------------------- */

.textcounter-note {
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: #6b7280;
}

/* ---------------------------
 * Komunikaty o błędach globalnych
 * -------------------------- */

.textcounter-message {
    position: relative;
    margin-top: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    width: 100%;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: #f9fafb;
}

.textcounter-message-error {
    background: #e30000;
}

/* ---------------------------
 * Responsywność
 * -------------------------- */

@media (max-width: 768px) {
    .textcounter-wrapper {
        padding: 1rem;
    }

    .textcounter-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .textcounter-button-primary,
    .textcounter-button-secondary {
        flex: 1 1 100%;
    }
}

@media (max-width: 480px) {
    .textcounter-metrics-grid {
        grid-template-columns: 1fr;
    }
}