/* ---------------------------
 * Image Analyzer – główny wrapper
 * -------------------------- */

.imagecheck-wrapper {
    box-sizing: border-box;
    margin: 0 auto 2rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ---------------------------
 * Pola i etykiety
 * -------------------------- */

.imagecheck-wrapper label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.imagecheck-help {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.imagecheck-field {
    width: 100%;
}

/* pola liniowe (topic + url obok siebie na desktopie) */
.imagecheck-field-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.imagecheck-field-inline-item {
    flex: 1 1 260px;
}

/* ---------------------------
 * Pola input / textarea
 * -------------------------- */

.imagecheck-wrapper input[type="text"],
.imagecheck-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.4;
    resize: vertical;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.imagecheck-wrapper textarea {
    min-height: 160px;
}

.imagecheck-wrapper input[type="text"]:focus,
.imagecheck-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
 * -------------------------- */

.imagecheck-actions {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.imagecheck-button-primary,
.imagecheck-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 */
.imagecheck-button-primary {
    flex: 2 1 220px;
}

.imagecheck-button-secondary {
    flex: 1 1 140px;
}

/* przycisk „Wyczyść” – analogicznie do metacheck */
.imagecheck-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);
}

.imagecheck-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
 * -------------------------- */

.imagecheck-results {
    margin-top: 0.75rem;
}

/* ---------------------------
 * Podsumowanie ogólne + status
 * -------------------------- */

.imagecheck-summary {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 2fr);
    gap: 1rem;
    border-radius: 6px;
    border: 1px solid var(--e-global-color-uicore_light, #e5e7eb);
    background: var(--e-global-color-uicore_white, #ffffff);
    padding: 0.85rem 0.95rem 1rem;
    font-size: 0.9rem;
}

.imagecheck-summary-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.imagecheck-summary-messages {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.imagecheck-summary-heading {
    margin: 0 0 0.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

.imagecheck-subheading {
    margin: 0.35rem 0 0.3rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #111827;
}

/* status ogólny – ramka */
.imagecheck-summary.imagecheck-overall--good {
    border-color: #18b600;
}

.imagecheck-summary.imagecheck-overall--warn {
    border-color: #f59e0b;
}

.imagecheck-summary.imagecheck-overall--bad {
    border-color: #e30000;
}

/* ---------------------------
 * Informacje o URL i temacie
 * -------------------------- */

.imagecheck-url-info {
    margin: 0.15rem 0;
    font-size: 0.86rem;
    color: #4b5563;
}

.imagecheck-url-info span {
    font-weight: 500;
}

.imagecheck-url-info--muted {
    color: #9ca3af;
}

.imagecheck-topic-info {
    margin: 0.2rem 0;
    font-size: 0.86rem;
}

.imagecheck-topic-info--set {
    color: #047857;
}

/* ---------------------------
 * Szybkie podsumowanie liczb
 * -------------------------- */

.imagecheck-counts-wrapper {
    margin-top: 0.3rem;
}

.imagecheck-counts {
    list-style: none;
    margin: 0.1rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    font-size: 0.84rem;
}

.imagecheck-count-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: #f3f4f6;
}

.imagecheck-count-label {
    font-weight: 600;
    color: #111827;
}

.imagecheck-count-value {
    font-weight: 500;
    color: #4b5563;
}

/* ---------------------------
 * Alerty / rekomendacje
 * -------------------------- */

.imagecheck-alert-list {
    list-style: none;
    margin: 0.15rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.imagecheck-alert {
    position: relative;
    padding: 0.4rem 0.55rem 0.4rem 1.9rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.imagecheck-alert::before {
    content: "";
    position: absolute;
    left: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
}

/* sukces */
.imagecheck-alert--success {
    background: #ecfdf3;
    color: #166534;
}

.imagecheck-alert--success::before {
    background: #16a34a;
}

/* ostrzeżenie */
.imagecheck-alert--warning {
    background: #fffbeb;
    color: #92400e;
}

.imagecheck-alert--warning::before {
    background: #f59e0b;
}

/* błąd */
.imagecheck-alert--error {
    background: #fef2f2;
    color: #b91c1c;
}

.imagecheck-alert--error::before {
    background: #ef4444;
}

/* info */
.imagecheck-alert--info {
    background: #eff6ff;
    color: #1d4ed8;
}

.imagecheck-alert--info::before {
    background: #3b82f6;
}

.imagecheck-alert-text {
    display: block;
}

/* ---------------------------
 * Panele: lista obrazków
 * -------------------------- */

.imagecheck-panel {
    margin-top: 0.9rem;
    padding: 0.85rem 0.95rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: 0.9rem;
}

.imagecheck-panel-heading {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

/* ---------------------------
 * Tabela obrazków
 * -------------------------- */

.imagecheck-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.imagecheck-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.imagecheck-table thead {
    background: #f9fafb;
}

.imagecheck-table th,
.imagecheck-table td {
    padding: 0.4rem 0.55rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
    text-align: left;
}

.imagecheck-table th {
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}

.imagecheck-col-index {
    width: 2.5rem;
    white-space: nowrap;
}

.imagecheck-col-src {
    min-width: 200px;
}

.imagecheck-src-main {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.78rem;
    color: #374151;
    word-break: break-all;
}

.imagecheck-src-file {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.76rem;
    color: #6b7280;
}

/* ALT – wyróżnienia */
.imagecheck-col-alt {
    min-width: 160px;
}

.imagecheck-alt-missing {
    color: #b91c1c;
    font-style: italic;
}

.imagecheck-suggestion-empty {
    color: #9ca3af;
    font-style: italic;
}

.imagecheck-alt--missing {
    background: #fef2f2;
}

.imagecheck-alt--generic {
    background: #fffbeb;
}

/* size – wyróżnienia */
.imagecheck-col-size {
    white-space: nowrap;
}

.imagecheck-size--missing {
    background: #fffbeb;
}

/* loading – wyróżnienia */
.imagecheck-loading--lazy {
    color: #047857;
    font-weight: 500;
}

.imagecheck-loading--no-lazy {
    color: #92400e;
}

/* kolumna z problemami i sugestiami */
.imagecheck-col-issues {
    min-width: 200px;
}

.imagecheck-col-suggestion {
    min-width: 180px;
}

/* małe notki informacyjne */
.imagecheck-note {
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: #6b7280;
}

/* ---------------------------
 * Komunikaty o błędach globalnych
 * -------------------------- */

.imagecheck-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;
}

.imagecheck-message-error {
    background: #e30000;
}

/* ---------------------------
 * Responsywność
 * -------------------------- */

@media (max-width: 768px) {
    .imagecheck-wrapper {
        padding: 1rem;
    }

    .imagecheck-summary {
        grid-template-columns: 1fr;
    }

    .imagecheck-button-primary,
    .imagecheck-button-secondary {
        flex: 1 1 100%;
    }
}

@media (max-width: 640px) {
    .imagecheck-field-inline {
        flex-direction: column;
    }
}