/* ---------------------------
 * Analizator HTML/Treść – główny wrapper
 * -------------------------- */

.htmlratio-wrapper {
    /* układ i tło jak w slugify */
    box-sizing: border-box;
    margin: 0 auto 2rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ---------------------------
 * Tekst i etykiety
 * -------------------------- */

.htmlratio-wrapper label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
    font-weight: 500;
}

/* mała pomocnicza notka pod polem */
.htmlratio-wrapper .htmlratio-help {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: #6b7280;
}

/* ---------------------------
 * Pole textarea (kod HTML)
 * -------------------------- */

.htmlratio-wrapper textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 220px;
    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);
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.htmlratio-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
 * -------------------------- */

.htmlratio-wrapper .htmlratio-actions {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

/* przyciski – spójne ze slugify */
.htmlratio-wrapper .htmlratio-button-primary,
.htmlratio-wrapper .htmlratio-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 – główny vs dodatkowy */
.htmlratio-wrapper .htmlratio-button-primary {
    flex: 2 1 220px;
}

.htmlratio-wrapper .htmlratio-button-secondary {
    flex: 1 1 140px;
}

/* przycisk „Wyczyść” – styl jak slugify #slugify-clear */
.htmlratio-wrapper .htmlratio-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);
}

.htmlratio-wrapper .htmlratio-button-secondary:hover {
    background-color: var(--e-global-color-uicore_primary, #2563eb);
    color: var(--e-global-color-uicore_white);
}

/* ---------------------------
 * Wyniki analizy
 * -------------------------- */

.htmlratio-wrapper .htmlratio-results {
    margin-top: 0;
}

/* podsumowanie liczbowe – prosty box */
.htmlratio-wrapper .htmlratio-summary {
    border-radius: 6px;
    border: 1px solid var(--e-global-color-uicore_light);
    background: var(--e-global-color-uicore_white);
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.htmlratio-wrapper .htmlratio-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.htmlratio-wrapper .htmlratio-summary-row:last-child {
    margin-bottom: 0;
}

.htmlratio-wrapper .htmlratio-summary-row span {
    color: #374151;
}

.htmlratio-wrapper .htmlratio-summary-row strong {
    white-space: nowrap;
}

/* paski proporcji – treść vs HTML */
.htmlratio-wrapper .htmlratio-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.htmlratio-wrapper .htmlratio-bar {
    position: relative;
    height: 22px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    font-size: 0.8rem;
}

.htmlratio-wrapper .htmlratio-bar-inner {
    height: 100%;
    width: 0;
    border-radius: inherit;
    transition: width 0.3s ease;
}

/* Treść – zielony (analogicznie do slugify toast-success) */
.htmlratio-wrapper .htmlratio-bar-text .htmlratio-bar-inner {
    background: #18b600;
}

/* HTML – niebieski (spójny z primary) */
.htmlratio-wrapper .htmlratio-bar-html .htmlratio-bar-inner {
    background: var(--e-global-color-uicore_primary);
}

.htmlratio-wrapper .htmlratio-bar-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--e-global-color-uicore_white);
    font-weight: 600;
}

/* ---------------------------
 * Komunikaty o błędach / info
 * -------------------------- */

.htmlratio-wrapper .htmlratio-message {
    position: relative;
    margin-top: 0;
    padding: 0.65rem 1rem;
    border-radius: 6px;

    width: 100%;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;

    color: var(--e-global-color-uicore_light);

    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease;
}

.htmlratio-wrapper .htmlratio-message-error {
    background: #e30000;
}

/* mała notka informacyjna pod wynikami */
.htmlratio-wrapper .htmlratio-note {
    font-size: 0.82rem;
    color: #6b7280;
}

/* ---------------------------
 * Responsywność – jak w slugify
 * -------------------------- */

@media (max-width: 640px) {
    .htmlratio-wrapper {
        padding: 1rem;
    }

    .htmlratio-wrapper .htmlratio-summary-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .htmlratio-wrapper .htmlratio-summary-row strong {
        white-space: normal;
    }

    .htmlratio-wrapper .htmlratio-button-primary,
    .htmlratio-wrapper .htmlratio-button-secondary {
        flex: 1 1 100%;
    }
}