/* ---- Buttons ---- */

.btn {
    padding: 10px 20px;
    font-size: 14px;
    font-family: var(--kw-font);
    font-weight: 500;
    border-radius: var(--kw-radius-md);
    cursor: pointer;
    border: 1px solid var(--kw-border);
    background: var(--kw-surface-2);
    color: var(--kw-text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    text-decoration: none;
}

    .btn:hover {
        border-color: var(--kw-border-strong);
        text-decoration: none;
    }

    .btn:disabled,
    .btn[disabled] {
        opacity: 0.45;
        cursor: not-allowed;
        pointer-events: none;
    }

.btn--primary {
    background: var(--kw-brand-light);
    color: var(--kw-brand);
    border-color: transparent;
}

    .btn--primary:hover {
        opacity: 0.85;
    }

.btn--danger {
    background: var(--kw-danger, #e74c3c);
    color: var(--kw-text-on-accent);
    border-color: transparent;
}

    .btn--danger:hover {
        opacity: 0.85;
    }

.btn--sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
}

.btn--compact {
    padding: 6px 14px;
    font-size: var(--kw-font-size-sm);
}

.is-hidden {
    display: none;
}

.form-inline {
    display: inline;
}

.form-reset {
    margin: 0;
}

.form-full {
    width: 100%;
}

.empty-state {
    padding: 40px 20px;
    color: var(--kw-text-muted);
    text-align: center;
}

.empty-state__icon {
    margin-bottom: 8px;
    font-size: 32px;
}

.empty-state__title {
    margin-bottom: 4px;
    font-size: var(--kw-font-size-body);
}

.empty-state__text {
    font-size: var(--kw-font-size-sm);
}

/* ---- Topic chips ---- */

.topic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--kw-surface-2);
    border: 1px solid var(--kw-border);
    border-radius: var(--kw-radius-pill);
    font-size: 12px;
    color: var(--kw-text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}

    .topic-chip:hover {
        border-color: var(--kw-border-strong);
        text-decoration: none;
    }

    .topic-chip.active {
        background: var(--kw-brand-light);
        color: var(--kw-brand);
        border-color: transparent;
    }

.topic-chip-count {
    font-size: 11px;
    color: var(--kw-text-muted);
    font-variant-numeric: tabular-nums;
}

/* ---- Search ---- */

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--kw-surface-1);
    border: 1px solid var(--kw-border);
    border-radius: var(--kw-radius-md);
    margin-bottom: 20px;
}

    .search-box input {
        flex: 1;
        border: none;
        background: transparent;
        font-family: var(--kw-font);
        font-size: 14px;
        color: var(--kw-text);
        outline: none;
    }

        .search-box input::placeholder {
            color: var(--kw-text-muted);
        }

/* Admin pages wrap the search box in .admin-filter-form / .admin-search-form, which already
   provide the spacing, so the default bottom margin is dropped there. */
.app-body--admin .search-box {
    margin-bottom: 0;
}


/* ---- Pagination ---- */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
    padding: 16px 0;
}

    .pagination a,
    .pagination span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
        font-variant-numeric: tabular-nums;
        border-radius: var(--kw-radius-sm);
        text-decoration: none;
        color: var(--kw-text-secondary);
        transition: all 0.15s;
    }

        .pagination a:hover {
            background: var(--kw-surface-1);
            text-decoration: none;
        }

    .pagination .active {
        background: var(--kw-brand-light);
        color: var(--kw-brand);
        font-weight: 500;
    }

    .pagination .disabled {
        color: var(--kw-text-muted);
        pointer-events: none;
    }

    .pagination .ellipsis {
        color: var(--kw-text-muted);
        pointer-events: none;
    }


/* ---- Ad banner ---- */

.ad-banner {
    background: var(--kw-surface-1);
    border: 1px dashed var(--kw-border);
    border-radius: var(--kw-radius-md);
    padding: 14px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 11px;
    color: var(--kw-text-muted);
}


/* Report error FAB + dialog */

.report-error-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--kw-brand);
    color: var(--kw-text-on-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--kw-shadow-md);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .report-error-fab:hover {
        transform: scale(1.08);
        box-shadow: var(--kw-shadow-lg);
    }

    .report-error-fab:active {
        transform: scale(0.96);
    }

    .report-error-fab svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.report-error-dialog {
    border: none;
    border-radius: var(--kw-radius-lg);
    background: var(--kw-bg);
    color: var(--kw-text);
    padding: 0;
    max-width: 520px;
    width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    margin: auto;
    position: fixed;
    inset: 0;
    height: fit-content;
}

    .report-error-dialog::backdrop {
        background: rgba(0, 0, 0, 0.45);
    }

.report-error-context {
    background: var(--kw-surface-2);
    border-radius: var(--kw-radius-sm);
    padding: 8px 12px;
    font-size: var(--kw-font-size-xs);
    color: var(--kw-text-secondary);
    margin-bottom: 12px;
}

    .report-error-context:empty {
        display: none;
    }

.report-error-selected-text {
    background: var(--kw-surface-2);
    border: 1px solid var(--kw-border);
    border-radius: var(--kw-radius-sm);
    padding: 10px 12px;
    font-size: var(--kw-font-size-sm);
    color: var(--kw-text);
    margin-bottom: 12px;
    max-height: 100px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.report-error-char-count {
    text-align: right;
    font-size: var(--kw-font-size-xs);
    color: var(--kw-text-muted);
    margin-top: 4px;
}

.report-error-success {
    text-align: center;
    padding: 32px 24px;
}

.report-error-success-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--kw-success-light);
    color: var(--kw-success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

    .report-error-success-icon svg {
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.5;
    }

.report-error-success-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.report-error-success-text {
    font-size: var(--kw-font-size-sm);
    color: var(--kw-text-secondary);
    margin-bottom: 20px;
}

@media (max-width: 767px) {
    .report-error-fab {
        width: 44px;
        height: 44px;
        bottom: 16px;
        right: 16px;
    }

        .report-error-fab svg {
            width: 20px;
            height: 20px;
        }
}

/* Ad Slot */
.ad-slot-container {
    background: var(--kw-surface-1);
    border: 1px solid var(--kw-border);
    border-radius: var(--kw-radius-lg);
    padding: 16px;
    margin-bottom: 24px;
}

.ad-slot-box {
    width: 100%;
    min-height: 160px;
    background: var(--kw-surface-2);
    border: 1px dashed var(--kw-border-strong);
    border-radius: var(--kw-radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--kw-text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

.ad-slot-icon {
    font-size: 28px;
    color: var(--kw-text-muted);
    opacity: 0.7;
}

