/* 
 * MxChat Knowledge Base Styles
 * Consolidated stylesheet for the Knowledge Base Manager
 */

#wpcontent, .auto-fold #wpcontent {
    padding: 0px;
}
.mxchat-kb-header-note {
    font-size: 12px;
    font-weight: normal;
    color: #666;
    font-style: italic;
}
/* ===== Core Layout ===== */
.mxchat-wrapper, .mxchat-admin-activation {
    width: 100%;
    margin: 0px;
    padding: 0;
    background-color: #f8f9ff;
    min-height: 100vh;
}

/* ===== Hero Section ===== */
.mxchat-hero {
    text-align: center;
    padding: 3.5rem 2rem;
    position: relative;
    background: #212121;
    border-bottom: 4px solid transparent;
    border-image: linear-gradient(135deg, #fa73e6, #7873f5, #3ac9d1);
    border-image-slice: 1;
}

.mxchat-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at center,
        rgba(250, 115, 230, 0.08) 0%,
        rgba(120, 115, 245, 0.08) 50%,
        rgba(58, 201, 209, 0.08) 100%
    );
    z-index: 1;
}

div.mxchat-hero h1.mxchat-main-title {
    font-size: 3.5rem;
    margin: 0 0 1.5rem;
    line-height: 1.2;
    color: white;
    position: relative;
    z-index: 2;
}

.mxchat-gradient-text {
    background: linear-gradient(135deg, #fa73e6, #7873f5, #3ac9d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    font-weight: 700;
}

.mxchat-hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    line-height: 1.6;
}

/* ===== Content Area ===== */
.mxchat-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* ===== Card Styles ===== */
.mxchat-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(120, 115, 245, 0.08);
    padding: 30px;
    margin: 30px auto;
    transition: all 0.3s ease;
}

.mxchat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(120, 115, 245, 0.12);
}

.mxchat-card h2 {
    margin: 0 0 1.5rem;
    color: #333;
    font-size: 1.5rem;
}

.mxchat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mxchat-header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* ===== Knowledge Warning ===== */
.mxchat-knowledge-warning {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.mxchat-knowledge-warning.success {
    background-color: #eefbe8;
    border-left: 4px solid #4caf50;
}

.mxchat-knowledge-warning.warning {
    background-color: #fff9e6;
    border-left: 4px solid #ff9800;
}

.mxchat-knowledge-warning p {
    align-items: center;
    margin: 0;
    color: #333;
}

.mxchat-knowledge-warning .dashicons {
    margin-right: 10px;
    font-size: 20px;
}

.mxchat-knowledge-warning .dashicons-yes-alt {
    color: #4caf50;
}

.mxchat-knowledge-warning .dashicons-warning {
    color: #ff9800;
}

/* ===== Import Section ===== */
.mxchat-import-section {
    margin-top: 30px;
}

.mxchat-import-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
}

/* Import Options */
.mxchat-import-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* Import Box Styling */
.mxchat-import-box {
    display: flex;
    align-items: flex-start;
    padding: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    text-align: left;
    width: 100%;
}

.mxchat-import-box:hover {
    border-color: #7873f5;
    box-shadow: 0 4px 12px rgba(120, 115, 245, 0.1);
    transform: translateY(-4px);
}

.mxchat-import-box.active {
    border-color: #7873f5;
    box-shadow: 0 4px 12px rgba(120, 115, 245, 0.1);
    transform: translateY(-4px);
}

.mxchat-import-wordpress {
    border: 2px solid #7873f5;
    background-color: #f8f9ff;
}

.mxchat-import-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    border-radius: 8px;
    margin: 16px;
    flex-shrink: 0;
}

.mxchat-import-wordpress .mxchat-import-icon {
    background-color: #f0e6ff;
}

.mxchat-import-icon .dashicons {
    font-size: 24px;
    color: #7873f5;
}

.mxchat-import-content {
    flex: 1;
    padding: 18px 18px 18px 0;
}

.mxchat-import-content h4 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #333;
}

.mxchat-import-content p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.mxchat-recommended-tag {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #7873f5;
    color: white;
    padding: 4px 10px;
    font-size: 10px;
    border-bottom-left-radius: 8px;
}

/* Import Input Areas */
.mxchat-import-input-area {
    background-color: #f9f9fd;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e5e5e5;
    text-align: center;
}

/* PDF Upload Area */
#mxchat-pdf-upload-area input[type="file"] {
    margin-bottom: 12px;
}

.mxchat-url-input-group {
    display: flex;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.mxchat-url-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.mxchat-url-input-group input:focus {
    border-color: #7873f5;
    box-shadow: 0 0 0 2px rgba(120, 115, 245, 0.1);
    outline: none;
}

.mxchat-url-description {
    font-size: 14px;
    color: #666;
    margin-top: 16px;
    font-style: italic;
}

.mxchat-content-input-group {
    max-width: 800px;
    margin: 0 auto;
}

.mxchat-content-input-group textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    resize: vertical;
}

.mxchat-content-input-group textarea:focus {
    border-color: #7873f5;
    box-shadow: 0 0 0 2px rgba(120, 115, 245, 0.1);
    outline: none;
}

/* Primary Import Card */
.mxchat-primary-import-card {
    background-color: #fff;
    border: 2px solid #7873f5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(120, 115, 245, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mxchat-primary-import-card:hover {
    box-shadow: 0 6px 16px rgba(120, 115, 245, 0.2);
    transform: translateY(-2px);
}

.mxchat-card-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2d9ff;
}

.mxchat-card-header h3 {
    margin: 0;
    color: #7873f5;
    font-size: 18px;
    font-weight: 600;
}

.mxchat-recommended-badge {
    background-color: #7873f5;
    color: white;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.mxchat-card-content {
    padding: 20px;
}

.mxchat-method-description {
    font-size: 15px;
    line-height: 1.5;
    color: #555;
    margin-bottom: 20px;
}

.mxchat-card-actions {
    text-align: center;
}

.mxchat-featured-button {
    background: linear-gradient(135deg, #fa73e6, #7873f5) !important;
    color: white !important;
    font-size: 15px !important;
    padding: 10px 20px !important;
    border: none !important;
    box-shadow: 0 4px 8px rgba(120, 115, 245, 0.2) !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.mxchat-featured-button:hover {
    background: linear-gradient(135deg, #e56dd6, #6b67db) !important;
    box-shadow: 0 6px 12px rgba(120, 115, 245, 0.3) !important;
    transform: translateY(-2px) !important;
}

/* Alternative Import Methods */
.mxchat-alternative-imports {
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mxchat-alt-header {
    font-size: 16px;
    color: #666;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.mxchat-import-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* ===== Import Methods ===== */
.mxchat-import-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.mxchat-method-card {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s ease;
    height: 100%;
}

.mxchat-method-card:hover {
    background-color: #f5f5f5;
    border-color: #ddd;
}

.mxchat-method-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.mxchat-method-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #666;
}

.mxchat-method-card h4, 
.mxchat-method-card h5 {
    margin: 0 0 10px 0;
    font-size: 15px;
    text-align: center;
    color: #444;
}

.mxchat-method-card p {
    margin: 0;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.mxchat-note,
.red-warning {
    color: #ff5722;
    font-weight: 500;
}

/* Legacy Import Form */
.mxchat-legacy-import-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #ddd;
}

/* ===== Settings Section ===== */
.mxchat-settings-section {
    margin-bottom: 30px;
}

.mxchat-settings-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #333;
    font-size: 1.3rem;
}

.mxchat-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.mxchat-section-content {
    margin-top: 15px;
}

/* ===== Tabs ===== */
.mxchat-tabs {
    border-bottom: 1px solid rgba(120, 115, 245, 0.1);
    margin-bottom: 20px;
    display: flex;
    gap: 2px;
}

.mxchat-tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.mxchat-tab-button:hover {
    color: #7873f5;
}

.mxchat-tab-button.active {
    color: #7873f5;
    border-bottom-color: #7873f5;
}

.mxchat-tab-contents {
    margin-top: 20px;
}

.mxchat-tab-content {
    display: none;
}

.mxchat-tab-content.active {
    display: block;
}

/* ===== Toggle Switches ===== */
.mxchat-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.mxchat-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mxchat-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.mxchat-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mxchat-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.mxchat-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .mxchat-toggle-slider {
    background: linear-gradient(135deg, #fa73e6, #7873f5);
}

input:checked + .mxchat-toggle-slider:before {
    transform: translateX(26px);
}

.mxchat-toggle-label {
    font-size: 14px;
    color: #333;
}

/* ===== Custom Post Types ===== */
.mxchat-custom-post-types-header {
    margin-top: 20px;
}

.mxchat-custom-post-types-container {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9ff;
    border-radius: 8px;
    border: 1px solid rgba(120, 115, 245, 0.1);
}

.mxchat-toggle-icon {
    margin-left: 5px;
    font-size: 12px;
}

/* ===== Form Elements ===== */
.mxchat-form-group {
    margin-bottom: 20px;
}

.mxchat-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.mxchat-form-group input[type="text"],
.mxchat-form-group input[type="url"],
.mxchat-form-group input[type="search"],
.mxchat-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(120, 115, 245, 0.2);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.mxchat-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.mxchat-form-group input:focus,
.mxchat-form-group textarea:focus {
    border-color: #7873f5;
    box-shadow: 0 0 0 3px rgba(120, 115, 245, 0.1);
    outline: none;
}

/* ===== Search ===== */
.mxchat-search-form {
    display: flex;
}

.mxchat-search-group {
    position: relative;
    display: flex;
    align-items: center;
}

.mxchat-search-group .dashicons {
    position: absolute;
    left: 12px;
    color: #666;
}

.mxchat-search-group input {
    padding-left: 40px;
    width: 300px;
}

/* ADDED 2.5.6: Content Type Filter Styles */
.mxchat-filter-group {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 12px;
}

.mxchat-filter-group select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.mxchat-filter-group select:hover {
    border-color: #7873f5;
    box-shadow: 0 2px 8px rgba(120, 115, 245, 0.1);
}

.mxchat-filter-group select:focus {
    outline: none;
    border-color: #7873f5;
    box-shadow: 0 0 0 3px rgba(120, 115, 245, 0.1);
}

/* ===== Buttons ===== */
.mxchat-button-primary {
    background: linear-gradient(135deg, #fa73e6, #7873f5);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mxchat-button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(120, 115, 245, 0.2);
}

.mxchat-button-primary:disabled {
    background: #a7a7a7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mxchat-button-secondary {
    background: #f8f9ff;
    border: 1px solid rgba(120, 115, 245, 0.2);
    color: #666;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mxchat-button-secondary:hover {
    background: #eef0ff;
}

.mxchat-button-danger {
    color: #ff4d4d;
    background: transparent;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mxchat-button-danger:hover {
    background: #fff5f5;
}

.mxchat-button-icon {
    padding: 8px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.mxchat-button-icon:hover {
    background: #f8f9ff;
    color: #7873f5;
}

/* ===== Status Cards ===== */
.mxchat-status-card {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid rgba(120, 115, 245, 0.1);
}

.mxchat-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.mxchat-status-details {
    margin-top: 10px;
    color: #666;
}

.mxchat-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    margin-left: 10px;
}

.mxchat-status-failed {
    background-color: #f44336;
    color: white;
}

.mxchat-status-success {
    background-color: #4caf50;
    color: white;
}

.mxchat-error-notice {
    margin-top: 15px;
    padding: 10px;
    background-color: #fff5f5;
    border-left: 3px solid #f44336;
    color: #d32f2f;
    border-radius: 4px;
}

.mxchat-failed-urls {
    margin-top: 15px;
}

.mxchat-failed-urls h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.mxchat-failed-urls-list {
    max-height: 200px;
    overflow-y: auto;
}

/* ===== Progress Bar ===== */
.mxchat-progress-bar {
    height: 8px;
    background: rgba(120, 115, 245, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 15px 0;
}

.mxchat-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #fa73e6, #7873f5);
    transition: width 0.3s ease;
}

/* ===== Table Styles ===== */
.mxchat-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

.mxchat-records-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.mxchat-records-table th {
    background: #f8f9ff;
    padding: 15px;
    font-weight: 600;
    color: #333;
    text-align: left;
    border-bottom: 2px solid rgba(120, 115, 245, 0.1);
}

/* Hide ID column (now second column, after checkbox column) */
.mxchat-records-table th:nth-child(2),
.mxchat-records-table td:nth-child(2) {
    display: none;
}

.mxchat-records-table td {
    padding: 15px;
    border-top: 1px solid rgba(120, 115, 245, 0.1);
    vertical-align: top;
}

.mxchat-records-table tr:hover {
    background: rgba(120, 115, 245, 0.03);
}

.mxchat-content-cell {
    max-width: 600px;
}

/* ===== Accordion Styles ===== */
.mxchat-accordion-wrapper {
    width: 100%;
}

.mxchat-content-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

/* Only make it look clickable if there's an expand button */
.mxchat-content-preview:has(.mxchat-expand-toggle) {
    cursor: pointer;
}

.mxchat-content-preview:has(.mxchat-expand-toggle):hover {
    background: rgba(120, 115, 245, 0.04);
}

.mxchat-content-preview .preview-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    overflow: hidden;
}

.mxchat-expand-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: linear-gradient(135deg, rgba(250, 115, 230, 0.1), rgba(120, 115, 245, 0.1));
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.mxchat-expand-toggle:hover {
    background: linear-gradient(135deg, rgba(250, 115, 230, 0.2), rgba(120, 115, 245, 0.2));
    transform: scale(1.05);
}

.mxchat-expand-toggle .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #7873f5;
    transition: transform 0.3s ease;
}

.mxchat-expand-toggle.expanded .dashicons {
    transform: rotate(180deg);
}

.mxchat-content-full {
    margin-top: 12px;
    padding: 16px;
    background: rgba(120, 115, 245, 0.03);
    border-radius: 8px;
    border-left: 3px solid #7873f5;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
    }
}

.mxchat-content-full .content-view {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.mxchat-content-full .content-view p {
    margin: 0 0 12px 0;
}

.mxchat-content-full .content-view p:last-child {
    margin-bottom: 0;
}

.mxchat-url-cell a {
    color: #7873f5;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mxchat-url-cell a:hover {
    color: #fa73e6;
}

.mxchat-actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 8px;
}

/* Legacy content-view styling (now within accordion) */
.content-edit {
    width: 100%;
    min-height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.url-view a {
    color: #7873f5;
    text-decoration: none;
}

.url-edit {
    width: 100%;
}

/* ===== Pagination ===== */
.mxchat-pagination {
    margin-top: 20px;
    padding-top: 20px;
    text-align: center;
    border-top: 1px solid rgba(120, 115, 245, 0.1);
}

.mxchat-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    margin: 0 4px;
    border-radius: 6px;
    background: white;
    border: 1px solid rgba(120, 115, 245, 0.2);
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mxchat-pagination .page-numbers.current {
    background: linear-gradient(135deg, #fa73e6, #7873f5);
    color: white;
    border: none;
}

/* ===== Notifications ===== */
.mxchat-notification {
    margin: 15px 20px 0;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
}

.mxchat-notification.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mxchat-notification.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .mxchat-hero h1.mxchat-main-title {
        font-size: 2.5rem;
    }
    
    .mxchat-card {
        padding: 20px;
    }
    
    .mxchat-import-options {
        grid-template-columns: 1fr;
    }
    
    .mxchat-url-input-group {
        flex-direction: column;
    }
    
    .mxchat-url-input-group input,
    .mxchat-url-input-group button {
        width: 100%;
    }
    
    .mxchat-content-input-group textarea {
        min-height: 120px;
    }
    
    .mxchat-status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .mxchat-records-table {
        display: block;
        overflow-x: auto;
    }
    
    .mxchat-stop-form button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .mxchat-card {
        padding: 15px;
    }
    
    .mxchat-import-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .mxchat-import-icon {
        margin: 16px 16px 0 16px;
    }
    
    .mxchat-import-content {
        padding: 16px;
    }
    
    .mxchat-recommended-tag {
        border-radius: 0 0 0 8px;
    }
}

/* RTL Support */
.rtl .mxchat-knowledge-warning {
    border-left: none;
    border-right: 4px solid;
}

.rtl .mxchat-knowledge-warning .dashicons {
    margin-right: 0;
    margin-left: 10px;
}

.rtl .mxchat-import-box {
    flex-direction: row-reverse;
}

.rtl .mxchat-import-content {
    padding: 16px 0 16px 16px;
}

.rtl .mxchat-import-icon {
    margin: 16px;
}

.rtl .mxchat-recommended-tag {
   right: auto;
   left: 0;
   border-bottom-left-radius: 0;
   border-bottom-right-radius: 8px;
}

.rtl .mxchat-toggle-container {
   flex-direction: row-reverse;
}

.rtl .mxchat-toggle-slider:before {
   left: auto;
   right: 2px;
}

.rtl input:checked + .mxchat-toggle-slider:before {
   transform: translateX(-26px);
}

.rtl .mxchat-error-notice {
   border-left: none;
   border-right: 3px solid #f44336;
}

.rtl .mxchat-records-table th,
.rtl .mxchat-records-table td {
   text-align: right;
}

.rtl .mxchat-search-group .dashicons {
   left: auto;
   right: 12px;
}

.rtl .mxchat-search-group input {
   padding-left: 12px;
   padding-right: 40px;
}




























/* ===== Modal Styles ===== */
.mxchat-kb-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    overflow: auto;
    justify-content: center;
    align-items: center;
}

.mxchat-kb-modal.active {
    display: flex;
}

.mxchat-kb-modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: mxchat-kb-modal-appear 0.3s ease-out;
}

@keyframes mxchat-kb-modal-appear {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mxchat-kb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.mxchat-kb-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #23282d;
}

.mxchat-kb-modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    line-height: 1;
    transition: color 0.2s;
}

.mxchat-kb-modal-close:hover {
    color: #d63638;
}

.mxchat-kb-modal-filters {
    padding: 15px 20px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e5e5;
    flex-wrap: wrap;
    gap: 10px;
}

.mxchat-kb-search-group {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.mxchat-kb-search-group input {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 14px;
    transition: border-color 0.2s;
}

.mxchat-kb-search-group input:focus {
    border-color: #7873f5;
    outline: none;
    box-shadow: 0 0 0 1px #7873f5;
}

.mxchat-kb-search-group::before {
    content: "\f179";
    font-family: dashicons;
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.mxchat-kb-filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mxchat-kb-filter-group select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 14px;
    background-color: white;
    min-width: 150px;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.mxchat-kb-filter-group select:focus {
    border-color: #7873f5;
    outline: none;
    box-shadow: 0 0 0 1px #7873f5;
}

/* Special style for the "processed" filter */
#mxchat-kb-processed-filter {
    border-left: 3px solid #1e88e5;
}

.mxchat-kb-content-selection {
    overflow-y: auto;
    flex: 1;
    min-height: 300px;
    max-height: calc(85vh - 200px);
}

.mxchat-kb-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mxchat-kb-selection-header label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.mxchat-kb-selection-count {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.mxchat-kb-content-list {
    padding: 0;
}

.mxchat-kb-content-item {
    display: flex;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.mxchat-kb-content-item:hover {
    background-color: #f0f7ff;
}

/* Improved visibility for processed items */
.mxchat-kb-content-item.processed {
    background-color: #f0f8ff;
    border-left: 3px solid #1e88e5;
}

.mxchat-kb-content-item.processed:hover {
    background-color: #e3f2fd;
}

.mxchat-kb-content-checkbox {
    margin-right: 15px;
    display: flex;
    align-items: flex-start;
    padding-top: 3px;
}

.mxchat-kb-content-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    background: #fff;
    margin: 0;
}

.mxchat-kb-content-checkbox input[type="checkbox"]:checked {
    border-color: #7873f5;
}

.mxchat-kb-content-details {
    flex: 1;
}

.mxchat-kb-content-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.mxchat-kb-content-title a {
    color: #7873f5;
    text-decoration: none;
}

.mxchat-kb-content-title a:hover {
    color: #fa73e6;
    text-decoration: underline;
}

/* Style for processed badge */
.mxchat-kb-processed-badge {
    display: inline-block;
    background-color: #1e88e5;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: normal;
}

/* Style for unprocessed badge */
.mxchat-kb-unprocessed-badge {
    display: inline-block;
    background-color: #607d8b;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: normal;
}

/* Last updated timestamp */
.mxchat-kb-last-updated {
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-left: 8px;
}

.mxchat-kb-content-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}

.mxchat-kb-content-excerpt {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.mxchat-kb-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.mxchat-kb-modal-footer .mxchat-kb-pagination {
    flex: 1;
    margin: 0;
    padding: 0;
    text-align: left;
}

.mxchat-kb-footer-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.mxchat-kb-button-primary, 
.mxchat-kb-button-secondary {
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
}

.mxchat-kb-button-primary {
    background: linear-gradient(135deg, #fa73e6, #7873f5);
    color: white;
    border: none;
}

.mxchat-kb-button-primary:hover {
    background: linear-gradient(135deg, #e56dd6, #6b67db);
}

.mxchat-kb-button-primary:disabled {
    background-color: #a7a7a7;
    cursor: not-allowed;
}

/* Update mode for the process button */
#mxchat-kb-process-selected.update-mode {
    background-color: #ff9800;
}

#mxchat-kb-process-selected.update-mode:hover {
    background-color: #f57c00;
}

/* Mixed mode for the process button */
#mxchat-kb-process-selected.mixed-mode {
    background-color: #9c27b0;
}

#mxchat-kb-process-selected.mixed-mode:hover {
    background-color: #7b1fa2;
}

.mxchat-kb-button-secondary {
    background-color: #f6f7f7;
    color: #2c3338;
    border: 1px solid #ddd;
}

.mxchat-kb-button-secondary:hover {
    background-color: #f0f0f0;
    border-color: #c3c4c7;
}

.mxchat-kb-pagination {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.mxchat-kb-pagination-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.mxchat-kb-page-link {
    padding: 5px 10px;
    text-decoration: none;
    border: 1px solid #ddd;
    color: #7873f5;
    border-radius: 3px;
    transition: all 0.2s;
}

.mxchat-kb-page-link:hover {
    background-color: #f0f0f0;
    color: #fa73e6;
    border-color: #c3c4c7;
}

.mxchat-kb-page-current {
    padding: 5px 10px;
    background: linear-gradient(135deg, #fa73e6, #7873f5);
    color: white;
    border-radius: 3px;
    font-weight: 500;
}

/* ===== Loading and Error States ===== */
.mxchat-kb-no-results, 
.mxchat-kb-error {
    padding: 30px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.mxchat-kb-error {
    color: #d63638;
}

.mxchat-kb-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    color: #666;
}

.mxchat-kb-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #7873f5;
    border-radius: 50%;
    animation: mxchat-kb-spin 1s linear infinite;
    margin: 0 0 10px 0;
}

@keyframes mxchat-kb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mxchat-kb-progress-bar {
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin: 10px 0 15px;
    overflow: hidden;
}

.mxchat-kb-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #fa73e6, #7873f5);
    transition: width 0.3s ease;
}

.mxchat-kb-current-item {
    font-size: 14px;
    color: #555;
    margin: 10px 0 0;
    font-style: italic;
}

.mxchat-kb-results-details {
    margin-top: 15px;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border-radius: 4px;
}

.mxchat-kb-results-details h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #d63638;
}

.mxchat-kb-results-details ul {
    margin: 0;
    padding-left: 20px;
}

.mxchat-kb-results-details li {
    margin-bottom: 5px;
}

/* ===== Processing Overlay ===== */
.mxchat-kb-processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mxchat-kb-processing-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.mxchat-kb-processing-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    color: #7873f5;
}

.mxchat-kb-processing-status {
    color: #555;
    margin-bottom: 20px;
}

/* ===== Utility Classes ===== */
.mxchat-na {
    color: #999;
    font-style: italic;
}

.mxchat-no-records {
    text-align: center;
    color: #666;
    padding: 40px !important;
}

/* ===== Responsive Design ===== */
@media screen and (max-width: 782px) {
    /* Hero section */
    div.mxchat-hero h1.mxchat-main-title {
        font-size: 2.5rem;
    }
    
    .mxchat-content {
        padding: 1rem;
    }
    
    .mxchat-card {
        padding: 20px;
    }
    
    .mxchat-card-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .mxchat-header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .mxchat-search-group input {
        width: 100%;
    }

    /* ADDED 2.5.6: Responsive filter dropdown */
    .mxchat-filter-group {
        margin-left: 0;
        width: 100%;
    }

    .mxchat-filter-group select {
        width: 100%;
    }

    .mxchat-url-input-group {
        flex-direction: column;
    }
    
    .mxchat-records-table {
        display: block;
        overflow-x: auto;
    }

    .mxchat-content-cell {
        max-width: 200px;
    }

    /* Modal responsive adjustments */
    .mxchat-kb-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 20px auto;
    }
    
    .mxchat-kb-modal-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mxchat-kb-search-group {
        max-width: none;
    }
    
    .mxchat-kb-filter-group {
        flex-direction: column;
    }
    
    .mxchat-kb-content-selection {
        max-height: calc(90vh - 250px);
    }
    
    .mxchat-kb-selection-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .mxchat-kb-modal-footer {
        flex-direction: column;
        gap: 10px;
    }

    .mxchat-kb-modal-footer .mxchat-kb-pagination {
        width: 100%;
        text-align: center;
    }

    .mxchat-kb-footer-actions {
        width: 100%;
        flex-direction: column;
    }

    .mxchat-kb-button-primary,
    .mxchat-kb-button-secondary {
        width: 100%;
    }

    /* Import methods grid */
    .mxchat-import-methods-grid {
        grid-template-columns: 1fr;
    }

    /* Primary import card */
    .mxchat-featured-button {
        width: 100%;
    }
}

/* ===== Notification Styles ===== */

/* Base notification style */
.mxchat-kb-notification {
    margin: 15px 20px 15px;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid;
    position: relative;
    animation: mxchat-kb-notification-appear 0.3s ease-out;
}

@keyframes mxchat-kb-notification-appear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success notification */
.mxchat-kb-notification.success {
    background-color: #f0f9eb;
    border-color: #67c23a;
    color: #3c763d;
}

.mxchat-kb-notification.success h4 {
    color: #67c23a;
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 600;
}

.mxchat-kb-notification.success::before {
    content: "\f147";
    font-family: dashicons;
    position: absolute;
    right: 15px;
    top: 15px;
    color: #67c23a;
    font-size: 20px;
}

/* Error notification */
.mxchat-kb-notification.error {
    background-color: #fef0f0;
    border-color: #d63638;
    color: #a94442;
}

.mxchat-kb-notification.error h4 {
    color: #d63638;
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 600;
}

.mxchat-kb-notification.error::before {
    content: "\f335";
    font-family: dashicons;
    position: absolute;
    right: 15px;
    top: 15px;
    color: #d63638;
    font-size: 20px;
}

/* Warning notification */
.mxchat-kb-notification.warning {
    background-color: #fdf6ec;
    border-color: #ff9800;
    color: #8a6d3b;
}

.mxchat-kb-notification.warning h4 {
    color: #ff9800;
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 600;
}

.mxchat-kb-notification.warning::before {
    content: "\f534";
    font-family: dashicons;
    position: absolute;
    right: 15px;
    top: 15px;
    color: #ff9800;
    font-size: 20px;
}

/* Info notification */
.mxchat-kb-notification.info {
    background-color: #f4f4fd;
    border-color: #7873f5;
    color: #31708f;
}

.mxchat-kb-notification.info h4 {
    color: #7873f5;
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 600;
}

.mxchat-kb-notification.info::before {
    content: "\f348";
    font-family: dashicons;
    position: absolute;
    right: 15px;
    top: 15px;
    color: #7873f5;
    font-size: 20px;
}

/* Close button for notifications */
.mxchat-kb-notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    font-size: 16px;
    line-height: 1;
    transition: opacity 0.2s;
}

.mxchat-kb-notification-close:hover {
    opacity: 1;
}

/* Results details section */
.mxchat-kb-results-details {
    margin-top: 12px;
    padding: 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
}

.mxchat-kb-notification.success .mxchat-kb-results-details {
    background-color: rgba(103, 194, 58, 0.05);
    border: 1px solid rgba(103, 194, 58, 0.2);
}

.mxchat-kb-notification.error .mxchat-kb-results-details {

}

.mxchat-kb-notification.warning .mxchat-kb-results-details {
    background-color: rgba(255, 152, 0, 0.05);
    border: 1px solid rgba(255, 152, 0, 0.2);
}

.mxchat-kb-notification.info .mxchat-kb-results-details {
    background-color: rgba(120, 115, 245, 0.05);
    border: 1px solid rgba(120, 115, 245, 0.2);
}

/* Results details title */
.mxchat-kb-results-details h5 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
}

.mxchat-kb-notification.success .mxchat-kb-results-details h5 {
    color: #3c763d;
}

.mxchat-kb-notification.error .mxchat-kb-results-details h5 {
    color: #a94442;
}

.mxchat-kb-notification.warning .mxchat-kb-results-details h5 {
    color: #8a6d3b;
}

.mxchat-kb-notification.info .mxchat-kb-results-details h5 {
    color: #31708f;
}

/* List items in results details */
.mxchat-kb-results-details ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.mxchat-kb-results-details li {
    margin-bottom: 8px;
    padding-left: 3px;
}

.mxchat-kb-results-details li:last-child {
    margin-bottom: 0;
}

.mxchat-kb-results-details li strong {
    font-weight: 600;
}

/* Failed items specific styling */
.mxchat-kb-results-details li.failed-item {
    color: #d63638;
}

/* Success items specific styling */
.mxchat-kb-results-details li.success-item {
    color: #67c23a;
}

/* Updated items specific styling */
.mxchat-kb-results-details li.updated-item {
    color: #1e88e5;
}

/* Processing summary information */
.mxchat-kb-processing-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    font-size: 14px;
}

.mxchat-kb-summary-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mxchat-kb-summary-item .dashicons {
    font-size: 18px;
}

.mxchat-kb-summary-item.processed .dashicons {
    color: #67c23a;
}

.mxchat-kb-summary-item.updated .dashicons {
    color: #1e88e5;
}

.mxchat-kb-summary-item.failed .dashicons {
    color: #d63638;
}

/* Show more/less toggle for details */
.mxchat-kb-show-details {
    display: inline-block;
    margin-top: 8px;
    color: #7873f5;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.mxchat-kb-show-details:hover {
    text-decoration: underline;
}

.mxchat-kb-show-details .dashicons {
    font-size: 16px;
    vertical-align: middle;
    margin-right: 2px;
}

/* Collapsible details section */
.mxchat-kb-results-details.collapsed {
    display: none;
}

/* Responsive styles for notifications */
@media screen and (max-width: 782px) {
    .mxchat-kb-notification {
        margin: 10px 15px 0;
        padding: 12px;
    }
    
    .mxchat-kb-notification::before {
        display: none;
    }
    
    .mxchat-kb-processing-summary {
        flex-direction: column;
        gap: 8px;
    }
}





/* Tab Navigation */
.mxchat-kb-tabs-nav {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
}

.mxchat-kb-tab-button {
    padding: 10px 15px;
    background: #f1f1f1;
    border: 1px solid #ccc;
    border-bottom: none;
    margin-right: 5px;
    cursor: pointer;
    font-weight: 500;
    border-radius: 5px 5px 0 0;
}

.mxchat-kb-tab-button.active {
    background: #fff;
    border-bottom: 2px solid #fff;
    position: relative;
    bottom: -1px;
    color: #2271b1;
}

/* Tab Content */
.mxchat-kb-tab-content {
    display: none;
}

.mxchat-kb-tab-content.active {
    display: block;
}

/* Make the first card in tabs not have top margin */
.mxchat-kb-tab-content .mxchat-card:first-child {
    margin-top: 0;
}






/* Pinecone Settings Tab Styles */
.mxchat-pinecone-info-box {
    background: #f8f9ff;
    border: 1px solid rgba(120, 115, 245, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.mxchat-info-icon {
    flex-shrink: 0;
}

.mxchat-info-icon .dashicons {
    color: #7873f5;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.mxchat-info-content {
    flex: 1;
}

.mxchat-info-content h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.mxchat-info-content p {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.mxchat-info-content p:last-child {
    margin-bottom: 0;
}

.mxchat-info-content a {
    color: #7873f5;
    text-decoration: none;
    font-weight: 500;
}

.mxchat-info-content a:hover {
    text-decoration: underline;
}

/* Database Settings Form */
.mxchat-database-settings-form {
    margin-top: 25px;
}

/* Toggle Container */
.mxchat-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    padding: 15px 0;
    border-bottom: 1px solid rgba(120, 115, 245, 0.1);
}

.mxchat-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.mxchat-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mxchat-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ddd;
    transition: 0.3s;
    border-radius: 26px;
}

.mxchat-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .mxchat-toggle-slider {
    background: linear-gradient(135deg, #fa73e6, #7873f5);
}

input:checked + .mxchat-toggle-slider:before {
    transform: translateX(24px);
}

.mxchat-toggle-label {
    font-weight: 500;
    color: #333;
    font-size: 15px;
}

/* Pinecone Settings Section */
.mxchat-pinecone-settings {
    background: #f8f9ff;
    border: 1px solid rgba(120, 115, 245, 0.2);
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
}

/* Knowledge Warning (Success State) */
.mxchat-knowledge-warning.success {
    background: #edfaef;
    border-left: 4px solid #46b450;
    padding: 15px;
    margin: 0 0 20px 0;
    border-radius: 4px;
}

.mxchat-knowledge-warning.success p {
    margin: 0;
    color: #2a4f30;
    align-items: center;
    gap: 8px;
}

.mxchat-knowledge-warning.success .dashicons {
    color: #46b450;
}

/* Form Groups */
.mxchat-form-group {
    margin-bottom: 20px;
}

.mxchat-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.mxchat-form-group label .required {
    color: #dc3232;
    margin-left: 4px;
}

.mxchat-form-group input[type="text"],
.mxchat-form-group input[type="password"] {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    border: 1px solid rgba(120, 115, 245, 0.2);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mxchat-form-group input[type="text"]:focus,
.mxchat-form-group input[type="password"]:focus {
    border-color: #7873f5;
    outline: none;
    box-shadow: 0 0 0 2px rgba(120, 115, 245, 0.1);
}

.mxchat-form-group .description {
    margin: 8px 0 0 0;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.mxchat-form-group .description a {
    color: #7873f5;
    text-decoration: none;
    font-weight: 500;
}

.mxchat-form-group .description a:hover {
    text-decoration: underline;
}

/* Setup Help Section */
.mxchat-pinecone-setup-help {
    background: white;
    border: 1px solid rgba(120, 115, 245, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-top: 25px;
}

.mxchat-pinecone-setup-help h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.mxchat-pinecone-setup-help ol {
    margin: 0;
    padding-left: 20px;
}

.mxchat-pinecone-setup-help li {
    margin-bottom: 12px;
    color: #666;
    line-height: 1.5;
}

.mxchat-pinecone-setup-help li:last-child {
    margin-bottom: 0;
}

.mxchat-pinecone-setup-help ul {
    margin: 8px 0;
    padding-left: 20px;
}

.mxchat-pinecone-setup-help ul li {
    margin-bottom: 6px;
    font-size: 13px;
}

.mxchat-pinecone-setup-help a {
    color: #7873f5;
    text-decoration: none;
    font-weight: 500;
}

.mxchat-pinecone-setup-help a:hover {
    text-decoration: underline;
}

/* Connection Status Section */
.mxchat-pinecone-status-section {
    background: white;
    border: 1px solid rgba(120, 115, 245, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-top: 25px;
}

.mxchat-pinecone-status-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

#mxchat-pinecone-test-connection {
    margin-bottom: 15px;
}

#test-pinecone-connection {
    background: linear-gradient(135deg, #fa73e6, #7873f5);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#test-pinecone-connection:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(120, 115, 245, 0.3);
}

#test-pinecone-connection:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Test Result Styles */
.mxchat-test-result {
    margin-top: 15px;
}

.mxchat-test-result .notice {
    margin: 0;
    padding: 12px 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mxchat-test-result .notice-success {
    background: #edfaef;
    border-left: 4px solid #46b450;
    color: #2a4f30;
}

.mxchat-test-result .notice-error {
    background: #fbeaea;
    border-left: 4px solid #dc3232;
    color: #721c24;
}

.mxchat-test-result .notice .dashicons {
    flex-shrink: 0;
}

.mxchat-test-result .notice p {
    margin: 0;
    font-size: 14px;
}

/* Compatibility Notice */
.mxchat-pinecone-compatibility-notice {
    background: #e8f4ff;
    border-left: 4px solid #2196f3;  
    padding: 15px;
    margin: 0 0 20px 0;
    border-radius: 4px;
}

.mxchat-pinecone-compatibility-notice p {
    margin: 0;
    color: #1565c0;
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
    .mxchat-pinecone-info-box {
        flex-direction: column;
        gap: 10px;
    }
    
    .mxchat-toggle-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .mxchat-form-group input[type="text"],
    .mxchat-form-group input[type="password"] {
        max-width: 100%;
    }
    
    .mxchat-pinecone-settings {
        padding: 15px;
    }
    
    .mxchat-pinecone-setup-help,
    .mxchat-pinecone-status-section {
        padding: 15px;
    }
}


/* Setup Steps */
.mxchat-setup-steps {
    margin: 30px 0;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
}

.mxchat-setup-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.step-number {
    background: linear-gradient(135deg, #fa73e6, #7873f5);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    margin: 0 0 5px 0;
}

.step-content p {
    margin: 0;
    color: #666;
}

.step-content ul {
    margin-top: 5px;
    margin-bottom: 0;
    color: #666;
}



/* ===== Role-Based Content Restrictions Styles ===== */

/* Role mapping form */
.mxchat-role-mapping-form {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9ff;
    border-radius: 8px;
    border: 1px solid rgba(120, 115, 245, 0.1);
}

.mxchat-role-mapping-form h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

.mxchat-form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
}

/* Role mappings table */
.mxchat-mappings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(120, 115, 245, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.mxchat-mappings-table th,
.mxchat-mappings-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(120, 115, 245, 0.1);
}

.mxchat-mappings-table th {
    background: #f8f9ff;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.mxchat-mappings-table tbody tr {
    transition: background-color 0.2s ease;
}

.mxchat-mappings-table tbody tr:hover {
    background: rgba(120, 115, 245, 0.03);
}

.mxchat-mappings-table tbody tr:last-child td {
    border-bottom: none;
}

/* Tag and role badges */
.mxchat-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #fa73e6, #7873f5);
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.mxchat-tag-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.mxchat-role-badge {
    display: inline-block;
    padding: 5px 12px;
    background: #f0f0f1;
    color: #2c3338;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

/* Role-specific badge colors */
.mxchat-role-badge.public {
    background: #e8f5e9;
    color: #2e7d32;
}

.mxchat-role-badge.logged_in {
    background: #e3f2fd;
    color: #1565c0;
}

.mxchat-role-badge.subscriber {
    background: #f3e5f5;
    color: #7b1fa2;
}

.mxchat-role-badge.contributor {
    background: #fff3e0;
    color: #e65100;
}

.mxchat-role-badge.author {
    background: #fff9c4;
    color: #f57f17;
}

.mxchat-role-badge.editor {
    background: #fce4ec;
    color: #c2185b;
}

.mxchat-role-badge.administrator {
    background: #ffebee;
    color: #c62828;
}

/* Mapping actions */
.mxchat-mapping-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mxchat-delete-mapping {
    color: #d63638;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    font-size: 13px;
}

.mxchat-delete-mapping:hover {
    background: #fef0f0;
    color: #b32d2e;
}

.mxchat-delete-mapping .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Post count display */
.mxchat-post-count {
    color: #666;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mxchat-post-count .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #7873f5;
}

/* Loading state for mappings */
.mxchat-loading-mappings {
    text-align: center;
    padding: 40px;
    color: #666;
}

.mxchat-role-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(120, 115, 245, 0.2);
    border-top: 2px solid #7873f5;
    border-radius: 50%;
    animation: mxchat-role-spin 1s linear infinite;
    margin-right: 10px;
}

.mxchat-role-spinner.is-active {
    display: inline-block;
}

@keyframes mxchat-role-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty state */
#mxchat-no-mappings {
    text-align: center;
    padding: 40px;
    color: #666;
}

#mxchat-no-mappings .dashicons {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 15px;
    display: block;
}

#mxchat-no-mappings p {
    margin: 0;
    font-size: 14px;
}

/* Bulk update section */
.mxchat-bulk-update-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(120, 115, 245, 0.1);
}

.mxchat-bulk-update-section h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
}

.mxchat-bulk-update-controls {
    margin-top: 15px;
}

#mxchat-bulk-update-roles {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#mxchat-bulk-update-progress {
    max-width: 600px;
}

#mxchat-bulk-update-progress .mxchat-progress-bar {
    height: 10px;
    background: rgba(120, 115, 245, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

#mxchat-bulk-update-progress .mxchat-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #fa73e6, #7873f5);
    transition: width 0.3s ease;
}

.mxchat-progress-text {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

/* Bulk update results */
#mxchat-bulk-update-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
}

#mxchat-bulk-update-result.success {
    background-color: #f0f9eb;
    border-left: 4px solid #67c23a;
    color: #3c763d;
}

#mxchat-bulk-update-result.error {
    background-color: #fef0f0;
    border-left: 4px solid #d63638;
    color: #a94442;
}

#mxchat-bulk-update-result h5 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
}

#mxchat-bulk-update-result p {
    margin: 5px 0;
    font-size: 14px;
}

/* Role mappings list container */
.mxchat-role-mappings-list {
    margin-top: 25px;
}

.mxchat-role-mappings-list h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

/* Info banner styling (reuse existing pattern) */
.mxchat-role-info-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 14px;
    background: #f8f9ff;
    border-left: 4px solid #7873f5;
    color: #333;
}

.mxchat-role-info-banner .dashicons {
    color: #7873f5;
    font-size: 18px;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .mxchat-form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mxchat-form-row .mxchat-form-group {
        flex: 1;
        max-width: none;
    }
    
    .mxchat-form-row > div {
        padding-bottom: 0;
    }
    
    .mxchat-mappings-table {
        display: block;
        overflow-x: auto;
    }
    
    .mxchat-mappings-table th,
    .mxchat-mappings-table td {
        padding: 10px;
        font-size: 13px;
    }
    
    .mxchat-mapping-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* RTL Support */
.rtl .mxchat-mappings-table th,
.rtl .mxchat-mappings-table td {
    text-align: right;
}

.rtl .mxchat-tag-badge {
    flex-direction: row-reverse;
}

.rtl .mxchat-role-info-banner {
    border-left: none;
    border-right: 4px solid #7873f5;
}

.rtl .mxchat-bulk-update-section {
    border-right: none;
}

.rtl #mxchat-bulk-update-result {
    border-left: none;
    border-right: 4px solid;
}

.rtl .mxchat-role-spinner {
    margin-right: 0;
    margin-left: 10px;
}

/* ===== Chunk Grouping Styles ===== */
.mxchat-chunk-group-header {
    background: rgba(120, 115, 245, 0.04) !important;
    border-left: 3px solid #7873f5;
}

.mxchat-chunk-group-header:hover {
    background: rgba(120, 115, 245, 0.08) !important;
}

.mxchat-chunk-group-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mxchat-chunk-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: linear-gradient(135deg, rgba(250, 115, 230, 0.1), rgba(120, 115, 245, 0.1));
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.mxchat-chunk-toggle:hover {
    background: linear-gradient(135deg, rgba(250, 115, 230, 0.2), rgba(120, 115, 245, 0.2));
    transform: scale(1.05);
}

.mxchat-chunk-toggle .dashicons {
    font-size: 16px;
    color: #7873f5;
    transition: transform 0.3s ease;
}

.mxchat-chunk-toggle.expanded .dashicons {
    transform: rotate(90deg);
}

.mxchat-chunk-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: linear-gradient(135deg, #7873f5, #3ac9d1);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.mxchat-chunk-preview {
    flex: 1;
    color: #666;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mxchat-chunk-row {
    border-left: 3px solid #e0e0e0;
}

.mxchat-chunk-row td:first-child {
    padding-left: 30px !important;
}

.mxchat-chunk-indicator {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #f0f0f0;
    color: #666;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.mxchat-chunk-label {
    color: #999;
    font-size: 12px;
    font-style: italic;
}

/* Delete button for chunk groups */
.delete-button-group {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.delete-button-group:hover {
    background: rgba(255, 0, 0, 0.1);
}

.delete-button-group .dashicons {
    color: #dc3545;
}

.delete-button-group .dashicons.spin {
    animation: mxchat-spin 1s linear infinite;
}

@keyframes mxchat-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== Sitemap Detection Styles ===== */
.dashicons.spin {
    animation: mxchat-spin 1s linear infinite;
}

.mxchat-sitemap-group.expanded .mxchat-sitemap-sub-list {
    display: block !important;
}

.mxchat-sitemap-group.expanded .dashicons-arrow-right-alt2 {
    transform: rotate(90deg) !important;
}

.mxchat-sitemap-row:last-child {
    border-bottom: none !important;
}

.mxchat-detected-sitemaps {
    margin-top: 24px;
}

.mxchat-sitemaps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.mxchat-sitemaps-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mxchat-sitemaps-header h4 .dashicons {
    color: #7873f5;
}

.mxchat-sitemap-group {
    margin-bottom: 16px;
    border: 1px solid rgba(120, 115, 245, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.mxchat-sitemap-group-header {
    padding: 12px 16px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mxchat-sitemap-group-header:hover {
    background: #f0f4f8;
}

.mxchat-sitemap-sub-list {
    display: none;
    border-top: 1px solid rgba(120, 115, 245, 0.2);
}

.mxchat-sitemap-row {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(120, 115, 245, 0.1);
}

.mxchat-sitemap-row.sub-item {
    padding-left: 40px;
}

.mxchat-sitemaps-loading {
    margin-top: 24px;
    padding: 20px;
    text-align: center;
}

.mxchat-sitemaps-loading .dashicons {
    font-size: 20px;
    color: #7873f5;
}

.mxchat-sitemaps-loading p {
    margin: 8px 0 0;
    color: #666;
}

.mxchat-no-sitemaps {
    margin-top: 24px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    text-align: center;
}

.mxchat-no-sitemaps .dashicons {
    font-size: 24px;
    color: #999;
    margin-bottom: 8px;
}

.mxchat-no-sitemaps p {
    margin: 0;
    color: #666;
}

/* ===== Admin Notice Dismiss Button Styles ===== */
.notice.is-dismissible {
    position: relative;
    padding-right: 38px;
}

.notice-dismiss {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #787c82;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.notice-dismiss:hover {
    color: #d63638;
}

.notice-dismiss:before {
    content: "\f153";
    font-family: dashicons;
    font-size: 16px;
    line-height: 1;
}

.notice-dismiss .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== AJAX Pagination Styles ===== */
.mxchat-kb-pagination-wrapper {
    background: #f8fafc;
}

.mxchat-ajax-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mxchat-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--mxch-card-border, #e5e7eb);
    border-radius: 6px;
    color: var(--mxch-text-primary, #1f2937);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.mxchat-page-link:hover {
    background: var(--mxch-primary, #7873f5);
    border-color: var(--mxch-primary, #7873f5);
    color: #fff;
    text-decoration: none;
}

.mxchat-page-link.loading {
    opacity: 0.6;
    pointer-events: none;
}

.mxchat-page-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--mxch-primary, #7873f5);
    border: 1px solid var(--mxch-primary, #7873f5);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.mxchat-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 36px;
    color: var(--mxch-text-muted, #9ca3af);
    font-size: 14px;
}

.mxchat-pagination-loading {
    margin-left: 12px;
}

.mxchat-pagination-loading .dashicons {
    color: var(--mxch-primary, #7873f5);
}

/* Spin animation for loading indicator */
@keyframes mxchat-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mxchat-pagination-loading .spin,
.mxchat-ajax-pagination .spin {
    animation: mxchat-spin 1s linear infinite;
}

/* Mobile responsive pagination */
@media (max-width: 600px) {
    .mxchat-ajax-pagination {
        gap: 4px;
    }

    .mxchat-page-link,
    .mxchat-page-current {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }

    .mxchat-page-dots {
        min-width: 20px;
    }
}

/* ========================================
   BULK SELECTION STYLES
   ======================================== */

/* Bulk Actions Toolbar */
.mxchat-bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid var(--mxch-card-border);
    border-bottom: none;
    border-radius: var(--mxch-radius-md) var(--mxch-radius-md) 0 0;
}

.mxchat-bulk-select-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--mxch-text-secondary);
    cursor: pointer;
}

.mxchat-bulk-select-label:hover {
    color: var(--mxch-text-primary);
}

.mxchat-entry-checkbox,
.mxchat-entry-checkbox-all {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--mxch-primary, #7873f5);
}

.mxchat-bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.mxchat-bulk-delete {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--mxch-error, #dc2626) !important;
    border-color: #fecaca !important;
    background: transparent !important;
}

.mxchat-bulk-delete:hover:not(:disabled) {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
}

.mxchat-bulk-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mxchat-selected-count {
    font-size: 12px;
    color: var(--mxch-primary, #7873f5);
    font-weight: 600;
    margin-left: 4px;
}

/* Delete container - holds Delete All form and Delete Selected button */
.mxchat-delete-container {
    display: flex;
    align-items: center;
}

/* Selected row highlighting */
#mxchat-records-table tr.selected {
    background-color: rgba(120, 115, 245, 0.05) !important;
}

#mxchat-records-table tr.selected td:first-child {
    position: relative;
}

#mxchat-records-table tr.selected td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--mxch-primary, #7873f5);
}

/* Deleting state */
tr.mxchat-row-deleting {
    opacity: 0.5;
    pointer-events: none;
}

/* Error state for failed deletions */
tr.mxchat-row-error {
    background-color: rgba(220, 38, 38, 0.05) !important;
}

tr.mxchat-row-error td:first-child {
    position: relative;
}

tr.mxchat-row-error td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--mxch-error, #dc2626);
}

/* Spin animation for loading states */
.spin {
    animation: mxchat-spin 1s linear infinite;
}

/* Responsive adjustments for bulk toolbar */
@media (max-width: 768px) {
    .mxchat-bulk-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .mxchat-bulk-delete-text {
        display: none;
    }

    .mxchat-bulk-actions {
        margin-left: 0;
    }
}

/* ==========================================================================
   Knowledge Base - Mobile Responsive
   ========================================================================== */

/* Desktop defaults for KB header controls */
.mxch-kb-header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mxch-kb-search-form {
    display: flex;
    gap: 10px;
}

.mxch-kb-search-input {
    width: 200px;
}

.mxch-kb-type-filter {
    width: auto;
}

/* Mobile: Knowledge Base card header stacks vertically */
@media screen and (max-width: 960px) {
    /* Stack card header vertically */
    #knowledge-base .mxch-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 16px;
    }

    /* Title row wraps badges */
    #knowledge-base .mxch-card-title {
        flex-wrap: wrap;
        font-size: 14px;
    }

    /* Controls stack vertically */
    .mxch-kb-header-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }

    /* Search form wraps */
    .mxch-kb-search-form {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    /* Search input takes full width */
    .mxch-kb-search-input {
        width: 100% !important;
        flex: 1;
        min-width: 0;
    }

    /* Filter dropdown takes full width */
    .mxch-kb-type-filter {
        width: 100% !important;
        flex: 1;
        min-width: 0;
    }

    /* Delete container full width */
    .mxchat-delete-container {
        width: 100%;
    }

    .mxchat-delete-container form,
    .mxchat-delete-container .mxchat-bulk-delete {
        width: 100%;
    }

    .mxchat-delete-container .mxch-btn {
        width: 100%;
        justify-content: center;
    }

    /* Table: hide ID and Source columns on mobile to save space */
    .mxchat-records-table th:nth-child(2),
    .mxchat-records-table td:nth-child(2) {
        display: none;
    }

    .mxchat-records-table th:nth-child(4),
    .mxchat-records-table td:nth-child(4) {
        display: none;
    }

    /* Content column needs more room */
    .mxchat-content-cell {
        max-width: none !important;
    }

    /* Table cells padding */
    .mxchat-records-table th,
    .mxchat-records-table td {
        padding: 10px 8px !important;
    }

    /* Pagination wraps nicely */
    .mxchat-ajax-pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Small mobile: further adjustments */
@media screen and (max-width: 480px) {
    #knowledge-base .mxch-card-header {
        padding: 10px 12px;
    }

    #knowledge-base .mxch-card-title {
        font-size: 13px;
    }

    /* Search form items fully stacked */
    .mxch-kb-search-form {
        flex-direction: column;
    }

    /* Smaller table text */
    .mxchat-records-table {
        font-size: 12px;
    }

    .mxchat-records-table th,
    .mxchat-records-table td {
        padding: 8px 6px !important;
    }

    /* Also hide Actions header text but keep the column for delete buttons */
    .mxchat-records-table th:nth-child(5) {
        font-size: 0;
        padding: 8px 4px !important;
        width: 40px;
    }
}

/* ─── Edit Entry Modal ─── */

.mxchat-edit-entry-btn {
    color: var(--mxch-primary, #7873f5);
}
.mxchat-edit-entry-btn:hover {
    color: var(--mxch-primary-dark, #5b56d6);
    background: rgba(120, 115, 245, 0.08);
}

.mxchat-kb-edit-modal-content {
    max-width: 760px;
    max-height: 90vh;
}

.mxchat-kb-edit-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
    gap: 12px;
}

.mxchat-kb-edit-source {
    font-size: 12px;
    color: var(--mxch-text-muted, #6b7280);
    word-break: break-all;
}
.mxchat-kb-edit-source a {
    color: var(--mxch-primary, #7873f5);
    text-decoration: none;
}

.mxchat-kb-edit-textarea {
    flex: 1;
    min-height: 300px;
    max-height: 55vh;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--mxch-input-border, #d1d5db);
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    resize: vertical;
    color: var(--mxch-text-primary, #1a1a2e);
    background: var(--mxch-input-bg, #fff);
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.mxchat-kb-edit-textarea:focus {
    outline: none;
    border-color: var(--mxch-primary, #7873f5);
    box-shadow: 0 0 0 3px rgba(120, 115, 245, 0.1);
}

.mxchat-kb-edit-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--mxch-text-muted, #6b7280);
}

.mxchat-kb-edit-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #e5e5e5;
    gap: 12px;
}

.mxchat-kb-edit-notice {
    flex: 1;
    font-size: 13px;
}
.mxchat-kb-edit-notice.success { color: #16a34a; }
.mxchat-kb-edit-notice.error { color: #dc2626; }

.mxchat-kb-edit-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.mxchat-kb-edit-save-spinner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 782px) {
    .mxchat-kb-edit-modal-content {
        width: 96%;
        max-width: 96%;
        margin: 10px auto;
        max-height: 95vh;
    }
    .mxchat-kb-edit-body {
        padding: 14px;
    }
    .mxchat-kb-edit-textarea {
        min-height: 200px;
        font-size: 15px;
    }
    .mxchat-kb-edit-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .mxchat-kb-edit-actions {
        justify-content: stretch;
    }
    .mxchat-kb-edit-actions .mxch-btn {
        flex: 1;
        text-align: center;
    }
}