/* All selectors are scoped so the module can coexist with DNN skins and multiple instances. */
.wmsearch-admin,
.wmsearch-input {
    --wmsearch-primary: #1e526e;
    --wmsearch-primary-dark: #12384d;
    --wmsearch-accent: #e36b18;
    --wmsearch-danger: #a61b1b;
    --wmsearch-surface: #fff;
    --wmsearch-canvas: #f5f8fa;
    --wmsearch-border: #d8e1e7;
    --wmsearch-text: #18242c;
    --wmsearch-muted: #526875;
    color: var(--wmsearch-text);
    font: 16px/1.5 Arial, Helvetica, sans-serif;
}

.wmsearch-admin {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
    background: var(--wmsearch-canvas);
    border-radius: 12px;
}

    .wmsearch-admin > .wmsearch-admin__header {
        position: static !important;
        inset: auto !important;
        display: flex;
        justify-content: space-between;
        gap: 24px;
        align-items: flex-start;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 0 20px;
        padding: 0 !important;
        color: var(--wmsearch-text);
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .wmsearch-admin h1, .wmsearch-admin h2, .wmsearch-admin h3 {
        color: var(--wmsearch-primary-dark);
        line-height: 1.2;
        margin: 0;
    }

    .wmsearch-admin h1 {
        font-size: clamp(1.6rem, 3vw, 2.25rem);
    }

    .wmsearch-admin h2 {
        font-size: 1.2rem;
    }

    .wmsearch-admin h3 {
        font-size: 1.05rem;
    }

.wmsearch-admin__eyebrow, .wmsearch-card__kicker {
    margin: 0 0 4px;
    color: var(--wmsearch-primary);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.wmsearch-admin__intro {
    max-width: 700px;
    margin: 8px 0 0;
    color: var(--wmsearch-muted);
}

.wmsearch-admin__scope {
    min-width: 88px;
    padding: 10px 14px;
    border: 1px solid var(--wmsearch-border);
    border-radius: 8px;
    background: var(--wmsearch-surface);
    text-align: center;
}

    .wmsearch-admin__scope span {
        display: block;
        color: var(--wmsearch-muted);
        font-size: .75rem;
        text-transform: uppercase;
    }

    .wmsearch-admin__scope strong {
        color: var(--wmsearch-primary-dark);
        font-size: 1.25rem;
    }

.wmsearch-notice {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-left: 4px solid;
    border-radius: 6px;
    font-weight: 600;
}

.wmsearch-notice--success {
    color: #145b2a;
    border-color: #258243;
    background: #e9f8ee;
}

.wmsearch-notice--error {
    color: #791414;
    border-color: var(--wmsearch-danger);
    background: #fff0f0;
}

.wmsearch-admin__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

    .wmsearch-admin__actions form, .wmsearch-rules__actions form {
        margin: 0;
    }

.wmsearch-button {
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

    .wmsearch-button:focus-visible, .wmsearch-admin input:focus-visible, .wmsearch-admin select:focus-visible, .wmsearch-admin textarea:focus-visible, .wmsearch-tree__toggle:focus-visible {
        outline: 3px solid #f2a25f;
        outline-offset: 2px;
    }

.wmsearch-button--primary {
    color: #fff;
    background: var(--wmsearch-primary);
}

    .wmsearch-button--primary:hover {
        background: var(--wmsearch-primary-dark);
    }

.wmsearch-button--secondary {
    color: #fff;
    background: var(--wmsearch-primary);
}

.wmsearch-button--danger {
    color: #7c1111;
    border-color: #dd9a9a;
    background: #fff;
}

    .wmsearch-button--danger:hover, .wmsearch-button--quiet-danger:hover {
        color: #fff;
        background: var(--wmsearch-danger);
    }

.wmsearch-button--quiet, .wmsearch-button--quiet-danger {
    min-height: 32px;
    padding: 5px 8px;
    background: transparent;
}

.wmsearch-button--quiet {
    color: var(--wmsearch-primary);
    border-color: #a9c2d0;
}

.wmsearch-button--quiet-danger {
    color: #8b1717;
    border-color: #e5bbbb;
}

.wmsearch-admin__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.wmsearch-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--wmsearch-border);
    border-radius: 10px;
    background: var(--wmsearch-surface);
    box-shadow: 0 2px 5px rgba(15, 49, 68, .05);
}

.wmsearch-card--rules {
    margin-top: 20px;
}

.wmsearch-card__heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--wmsearch-border);
}

    .wmsearch-card__heading > p {
        max-width: 310px;
        margin: 0;
        color: var(--wmsearch-muted);
        font-size: .9rem;
        text-align: right;
    }

.wmsearch-form {
    display: grid;
    gap: 16px;
}

.wmsearch-form__columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.wmsearch-field label {
    display: grid;
    gap: 6px;
    color: #243945;
    font-weight: 700;
}

.wmsearch-admin input, .wmsearch-admin select, .wmsearch-admin textarea {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid #aebfc9;
    border-radius: 5px;
    padding: 9px 10px;
    color: var(--wmsearch-text);
    background: #fff;
    font: inherit;
}

.wmsearch-admin textarea {
    resize: vertical;
    font-family: Consolas, Monaco, monospace;
    font-size: .875rem;
}

.wmsearch-field__hint, .wmsearch-rule-create > p {
    margin: 5px 0 0;
    color: var(--wmsearch-muted);
    font-size: .84rem;
}

.wmsearch-inline-action {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.wmsearch-field-status {
    color: var(--wmsearch-muted);
    font-size: .84rem;
}

.wmsearch-tree {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .wmsearch-tree ul {
        margin: 3px 0 3px 21px;
        padding: 0;
        list-style: none;
    }

.wmsearch-tree__item {
    display: flex;
    align-items: center;
    min-height: 32px;
    gap: 4px;
    border-radius: 5px;
    transition: background-color .15s ease, box-shadow .15s ease;
}

    .wmsearch-tree__item label {
        cursor: pointer;
    }

    .wmsearch-tree__item input {
        width: auto;
        margin: 0 5px 0 0;
    }

.wmsearch-tree__item--partial {
    padding: 2px 5px 2px 2px;
    box-shadow: inset 3px 0 0 #d87919;
    background: #fff5e6;
}

    .wmsearch-tree__item--partial::after {
        content: attr(data-selection-state);
        margin-left: 6px;
        color: #87500d;
        font-size: .75rem;
        font-weight: 700;
    }

.wmsearch-tree__toggle, .wmsearch-tree__spacer {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
}

.wmsearch-tree__toggle {
    border: 0;
    border-radius: 4px;
    color: var(--wmsearch-primary);
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
}

    .wmsearch-tree__toggle:hover {
        background: #e8f0f4;
    }

.wmsearch-tree__unregistered {
    color: #6b6b6b;
}

    .wmsearch-tree__unregistered em {
        font-size: .78rem;
        font-style: normal;
        color: #8a5a1f;
    }

.wmsearch-rules__table-wrap {
    overflow-x: auto;
}

.wmsearch-rules table {
    width: 100%;
    border-collapse: collapse;
}

.wmsearch-rules th, .wmsearch-rules td {
    padding: 12px;
    border-bottom: 1px solid var(--wmsearch-border);
    text-align: left;
    vertical-align: top;
}

.wmsearch-rules th {
    color: var(--wmsearch-muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.wmsearch-rules td strong, .wmsearch-rules td small, .wmsearch-rules td span {
    display: block;
}

.wmsearch-rules td small, .wmsearch-rules td span {
    color: var(--wmsearch-muted);
    font-size: .85rem;
}

.wmsearch-rules__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.wmsearch-empty {
    margin: 0;
    padding: 14px;
    border: 1px dashed #b7c8d2;
    border-radius: 6px;
    color: var(--wmsearch-muted);
}

.wmsearch-rule-editor {
    margin: 20px 0;
    padding: 18px;
    border: 2px solid #8db2c5;
    border-radius: 8px;
    background: #f5fbfd;
}

.wmsearch-rule-editor__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.wmsearch-rule-create {
    margin-top: 20px;
    border-top: 1px solid var(--wmsearch-border);
    padding-top: 16px;
}

    .wmsearch-rule-create summary {
        cursor: pointer;
        color: var(--wmsearch-primary);
        font-weight: 700;
    }

    .wmsearch-rule-create .wmsearch-form {
        margin-top: 16px;
    }

.wmsearch-admin .wmsearch-sr-only, .wmsearch-input .wmsearch-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.wmsearch-input {
    display: block;
}

    .wmsearch-input form {
        display: flex;
        gap: 8px;
        align-items: stretch;
    }

    .wmsearch-input input[type="text"], .wmsearch-input input[type="search"] {
        min-width: 0;
        border: 2px solid #aebfc9;
        border-radius: 5px;
        padding: 9px 10px;
        font: inherit;
        color: #FFF;
    }

    .wmsearch-input .btn-search {
        border: 1px solid var(--wmsearch-primary);
        border-radius: 5px;
        padding: 8px 12px;
        color: #fff;
        background: var(--wmsearch-primary);
        cursor: pointer;
    }

.dnnSearchBox_advanced, .dnnSearchResultPanel {
    display: none;
}

.wm-search-admin,
.wm-search-admin * {
    box-sizing: border-box;
}

.wm-search-admin {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px;
    color: #263746;
    background: #f4f7f9;
    border-radius: 16px;
}

    /* Override global theme header rules */
    .wm-search-admin > header {
        position: static !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 0 24px;
        padding: 24px 30px;
        color: #fff;
        background: #123f57;
        border-radius: 10px;
    }

    .wm-search-admin header h1,
    .wm-search-admin header h2,
    .wm-search-admin header p {
        position: static !important;
        margin: 0;
        color: inherit;
    }

    .wm-search-admin header h1 {
        font-size: clamp(2rem, 4vw, 3.25rem);
        line-height: 1.15;
    }

    .wm-search-admin .admin-description {
        max-width: 760px;
        margin: 0 0 20px;
        line-height: 1.55;
    }

    /* Reindex and clear buttons */
    .wm-search-admin .admin-actions {
        position: static !important;
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin: 0 0 28px;
    }

        .wm-search-admin .admin-actions .btn {
            position: static !important;
            min-height: 44px;
            margin: 0;
            padding: 10px 20px;
        }

    /* Settings panels */
    .wm-search-admin .admin-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px;
    }

    .wm-search-admin .admin-card {
        min-width: 0;
        padding: 30px;
        background: #fff;
        border: 1px solid #dce4e8;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgb(20 50 70 / 8%);
    }

    .wm-search-admin input,
    .wm-search-admin select,
    .wm-search-admin textarea {
        width: 100%;
        max-width: 100%;
    }

@media (max-width: 900px) {
    .wm-search-admin {
        padding: 20px;
    }

        .wm-search-admin > header {
            align-items: flex-start;
            flex-direction: column;
            gap: 18px;
        }

        .wm-search-admin .admin-grid {
            grid-template-columns: 1fr;
        }
}

@media (max-width: 1000px) {
    .wmsearch-admin__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .wmsearch-admin {
        padding: 16px;
        border-radius: 0;
    }

        .wmsearch-admin > .wmsearch-admin__header, .wmsearch-card__heading {
            display: block;
        }

    .wmsearch-admin__scope {
        display: inline-block;
        margin-top: 14px;
        text-align: left;
    }

    .wmsearch-card__heading > p {
        margin-top: 8px;
        text-align: left;
    }

    .wmsearch-form__columns {
        grid-template-columns: 1fr;
    }

    .wmsearch-rules__actions {
        justify-content: flex-start;
    }

    .wmsearch-admin__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

        .wmsearch-admin__actions .wmsearch-button {
            width: 100%;
        }
}
