/**
 * LISA AI Admin Styles
 */

.lisa-ai-admin-container {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.lisa-ai-settings-main {
    flex: 1;
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
}

.lisa-ai-settings-sidebar {
    width: 300px;
}

.lisa-ai-info-box {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 20px;
}

.lisa-ai-info-box h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.lisa-ai-info-box p:last-child {
    margin-bottom: 0;
}

/* Form Styles */
.form-table th {
    padding-left: 0;
}

.lisa-color-picker {
    width: 100px;
}

/* Sync Button */
#lisa-sync-products {
    margin-right: 10px;
}

#lisa-sync-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 3px;
}

#lisa-sync-status.success {
    background: #d4edda;
    color: #155724;
}

#lisa-sync-status.error {
    background: #f8d7da;
    color: #721c24;
}

#lisa-sync-status.loading {
    background: #fff3cd;
    color: #856404;
}

/* Registration */
.lisa-registration-box {
    background: #f0f6fc;
    border: 2px solid #2271b1;
    border-radius: 8px;
    padding: 20px 25px;
}

.lisa-registration-box h2 {
    margin-top: 0;
    color: #1d2327;
}

.lisa-registration-box .button-hero {
    font-size: 16px;
    padding: 8px 30px;
    height: auto;
}

#lisa-reg-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
}

#lisa-reg-status.success {
    background: #d4edda;
    color: #155724;
}

#lisa-reg-status.error {
    background: #f8d7da;
    color: #721c24;
}

#lisa-reg-status.loading {
    background: #fff3cd;
    color: #856404;
}

#lisa-reg-status:empty {
    display: none;
}

/* Plan & Billing */
.lisa-billing-current {
    background: #f0f6fc;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #2271b1;
}

.lisa-billing-current p {
    margin: 5px 0;
}

.lisa-billing-active {
    color: #155724;
    font-weight: 600;
}

.lisa-billing-error {
    color: #721c24;
    background: #f8d7da;
    padding: 10px 15px;
    border-radius: 4px;
}

.lisa-billing-plans h3 {
    margin-bottom: 5px;
}

.lisa-plan-cards {
    display: flex;
    gap: 16px;
    margin-top: 15px;
}

.lisa-plan-card {
    flex: 1;
    background: #fff;
    border: 2px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.2s;
}

.lisa-plan-card:hover {
    border-color: #2271b1;
}

.lisa-plan-card.lisa-plan-current {
    border-color: #2271b1;
    background: #f0f6fc;
}

.lisa-plan-card h4 {
    margin: 0 0 10px;
    font-size: 18px;
}

.lisa-plan-price {
    font-size: 32px;
    font-weight: 700;
    color: #1d2327;
    margin-bottom: 8px;
}

.lisa-plan-price span {
    font-size: 14px;
    font-weight: 400;
    color: #646970;
}

.lisa-plan-card p {
    color: #646970;
    margin-bottom: 15px;
}

.lisa-plan-card .button {
    width: 100%;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .lisa-ai-admin-container {
        flex-direction: column;
    }

        .lisa-ai-settings-sidebar {
            width: 100%;
        }
    
        .lisa-plan-cards {
            flex-direction: column;
        }
        }
/* ========================
   Analytics page
   ======================== */
.lisa-analytics-controls {
    margin: 16px 0 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lisa-analytics-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.lisa-ai-knowledge {
    background: #E7E3EF;
    margin: 10px 0 0 -20px;
    padding: 10px 24px 28px;
    min-height: calc(100vh - 32px);
    box-sizing: border-box;
}

.lisa-ai-knowledge h1 {
    padding-top: 8px;
}

.lisa-ai-analytics {
    background: #E7E3EF;
    margin: 10px 0 0 -20px;
    padding: 10px 24px 28px;
    min-height: calc(100vh - 32px);
    box-sizing: border-box;
}

.lisa-ai-analytics h1 {
    padding-top: 8px;
}

.lisa-stat-card {
    background: #fff;
    border: 1px solid #e8e6ee;
    border-radius: 12px;
    padding: 22px 26px;
    min-width: 160px;
    flex: 1;
    box-shadow: 0 1px 3px rgba(43, 24, 63, 0.06);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.lisa-stat-card:hover {
    box-shadow: 0 6px 18px rgba(43, 24, 63, 0.12);
    transform: translateY(-2px);
}

.lisa-stat-value {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.1;
    color: #2B183F;
}

.lisa-stat-label {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a8694;
}

.lisa-analytics-section {
    background: #fff;
    border: 1px solid #e8e6ee;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(43, 24, 63, 0.06);
}

.lisa-section-subtitle {
    margin: 0 0 14px;
    color: #8a8694;
    font-size: 13px;
}

.lisa-analytics-section h2 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: #2B183F;
    border-bottom: 1px solid #f0eef4;
    padding-bottom: 12px;
}

.lisa-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 8px;
    border-bottom: 1px solid #f4f3f7;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.lisa-row:hover {
    background: #faf9fc;
}

.lisa-row:last-child {
    border-bottom: none;
}

.lisa-count {
    font-weight: 600;
    font-size: 12px;
    color: #fff;
    background: #2B183F;
    padding: 3px 12px;
    border-radius: 999px;
    margin-left: 16px;
    white-space: nowrap;
}

.lisa-topics-search {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 14px;
    padding: 10px 14px;
    border: 1px solid #e0dce8;
    border-radius: 8px;
    font-size: 14px;
    color: #2B183F;
    background: #fff;
}

.lisa-topics-search:focus {
    outline: none;
    border-color: #2B183F;
    box-shadow: 0 0 0 1px #2B183F;
}

.lisa-uq-card {
    background: #f0eef4;
    border-left: 4px solid #2B183F;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.lisa-uq-text {
    color: #2B183F;
    font-size: 14px;
    line-height: 1.4;
}

.lisa-uq-date {
    margin-top: 6px;
    color: #8a8694;
    font-size: 12px;
}

.lisa-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
}

.lisa-bar-label {
    width: 140px;
    flex-shrink: 0;
    font-size: 13px;
    color: #2B183F;
}

.lisa-bar-track {
    flex: 1;
    height: 22px;
    background: #ECEAF2;
    border-radius: 6px;
    overflow: hidden;
}

.lisa-bar-fill {
    height: 100%;
    min-width: 2px;
    background: #2B183F;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding-left: 8px;
    box-sizing: border-box;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.lisa-bar-fill.lisa-bar-positive {
    background: #4ade80;
    color: #14532d;
}

.lisa-bar-fill.lisa-bar-neutral {
    background: #d1d5db;
    color: #374151;
}

.lisa-bar-fill.lisa-bar-negative {
    background: #f87171;
    color: #7f1d1d;
}

.lisa-bar-value {
    width: 48px;
    flex-shrink: 0;
    text-align: right;
    font-size: 13px;
    color: #646970;
}

#lisa-top-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lisa-topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #faf9fc;
    border: 1px solid #e0dce8;
    border-radius: 999px;
    padding: 7px 8px 7px 16px;
    font-size: 13px;
    color: #2B183F;
}

.lisa-topic-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    background: #2B183F;
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.lisa-topics-more-wrap {
    flex-basis: 100%;
    margin-top: 6px;
}

.lisa-topics-more, .lisa-uq-more {
    cursor: pointer;
    background: #2B183F;
    border: 1px solid #2B183F;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 13px;
    color: #fff;
    font-weight: 500;
}

.lisa-topics-more:hover, .lisa-uq-more:hover {
    background: #3d2456;
}

.lisa-trend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f4f3f7;
}

.lisa-trend-row:last-child {
    border-bottom: none;
}

.lisa-trend-topic {
    font-size: 14px;
    font-weight: 500;
    color: #2B183F;
}

.lisa-trend-stats {
    margin-top: 3px;
    font-size: 12px;
    color: #8a8694;
}

.lisa-trend-change {
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 16px;
}

.lisa-trend-up {
    color: #16a34a;
}

.lisa-trend-down {
    color: #dc2626;
}

.lisa-kb-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

.lisa-kb-page-info {
    font-size: 13px;
    color: #2B183F;
    font-weight: 600;
}

.lisa-kb-page-hidden {
    visibility: hidden;
}

.lisa-kb-hidden {
    display: none !important;
}

.lisa-empty {
    text-align: center;
    padding: 30px 16px;
    color: #8a8694;
    font-size: 14px;
}

.lisa-empty-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.lisa-analytics-empty {
    color: #646970;
    font-style: italic;
    margin: 4px 0;
}

.lisa-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border-radius: 50%;
    background: #EDE7F0;
    color: #2B183F;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    cursor: help;
    vertical-align: middle;
}

.lisa-info:hover {
    background: #2B183F;
    color: #fff;
}

.lisa-info {
    position: relative;
}

.lisa-info-left .lisa-tip-popup {
    left: auto;
    right: 22px;
}

.lisa-tip-popup {
    text-transform: none;
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    width: 240px;
    background: #2B183F;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    padding: 10px 12px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    white-space: normal;
}

/* ========================
   Knowledge Base page
   ======================== */
.lisa-kb-intro {
    max-width: 720px;
    color: #50575e;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.lisa-kb-form {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 28px;
    max-width: 800px;
}

.lisa-kb-form h2,
.lisa-kb-list-section h2 {
    margin-top: 0;
    font-size: 16px;
}

.lisa-kb-item {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 12px;
    max-width: 800px;
    position: relative;
}

.lisa-kb-q {
    font-weight: 600;
    color: #2B183F;
    margin-bottom: 4px;
}

.lisa-kb-a {
    color: #50575e;
}

.lisa-kb-delete {
    position: absolute;
    top: 12px;
    right: 16px;
    color: #b32d2e !important;
    text-decoration: none;
}

.lisa-kb-empty {
    color: #646970;
    font-style: italic;
}


/* Knowledge Base action buttons (added for Edit/Delete/Cancel) */
.lisa-kb-item {
    position: relative;
}
.lisa-kb-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}
.lisa-kb-btn-edit.button,
.lisa-kb-btn-delete.button,
.lisa-kb-btn-cancel.button {
    height: auto;
    line-height: 1.6;
    padding: 4px 12px;
    border-radius: 6px;
}
.lisa-kb-btn-edit.button {
    color: #2B183F;
    border-color: #c8c2d0;
    background: #f6f4f8;
}
.lisa-kb-btn-edit.button:hover {
    background: #ede7f0;
    border-color: #2B183F;
}
.lisa-kb-btn-delete.button {
    color: #fff !important;
    background: #b32d2e;
    border-color: #8f2423;
}
.lisa-kb-btn-delete.button:hover {
    background: #8f2423;
    color: #fff !important;
}
.lisa-kb-btn-cancel.button {
    color: #50575e;
    background: #f0f0f1;
    border-color: #c3c4c7;
}

/* Override the old absolute positioning so Edit/Delete sit inline */
.lisa-kb-delete {
    position: static !important;
    top: auto !important;
    right: auto !important;
}

/* Form highlight flash when entering edit mode */
.lisa-kb-flash {
    animation: lisaKbFlash 1s ease-out;
}
@keyframes lisaKbFlash {
    0%   { box-shadow: 0 0 0 3px rgba(43, 24, 63, 0.45); }
    100% { box-shadow: 0 0 0 3px rgba(43, 24, 63, 0); }
}


/* Knowledge Base saving spinner */
#lisa-kb-status {
    margin-left: 10px;
}
#lisa-kb-status.loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #856404;
}
#lisa-kb-status.loading::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid #d6c98a;
    border-top-color: #856404;
    border-radius: 50%;
    display: inline-block;
    animation: lisaKbSpin 0.7s linear infinite;
    flex: none;
}
@keyframes lisaKbSpin {
    to { transform: rotate(360deg); }
}


/* Knowledge Base success state (green confirmation) */
#lisa-kb-status.success {
    display: inline-block;
    background: #e6f5ea;
    color: #1c7c3e;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid #b8e0c4;
}
#lisa-kb-status.error {
    display: inline-block;
    background: #fdeaea;
    color: #b32d2e;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid #f0c2c2;
}


/* Knowledge Base search box */
.lisa-kb-search {
    width: 100%;
    max-width: 420px;
    padding: 8px 12px;
    margin: 4px 0 16px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    font-size: 14px;
}
.lisa-kb-search:focus {
    border-color: #2B183F;
    outline: none;
    box-shadow: 0 0 0 1px #2B183F;
}


/* Knowledge Base search row (input + clear button) */
.lisa-kb-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 16px;
}
.lisa-kb-search-row .lisa-kb-search {
    margin: 0;
    flex: 1;
}
.lisa-kb-btn-clear.button {
    height: auto;
    padding: 7px 14px;
    border-radius: 6px;
}

/* Round the KB primary buttons (Add/Update + Clear) to match other KB buttons */
#lisa-kb-add.button,
#lisa-kb-search-clear.button {
    border-radius: 6px;
}


/* Knowledge Base list header (heading + Export/Import tools) */
.lisa-kb-list-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.lisa-kb-list-header h2 {
    margin: 0;
}
.lisa-kb-tools {
    display: flex;
    gap: 8px;
}
.lisa-kb-btn-tool.button {
    height: auto;
    padding: 6px 16px;
    border-radius: 6px;
    color: #fff !important;
    font-weight: 600;
}
#lisa-kb-export.button {
    background: #2271b1;
    border-color: #2271b1;
}
#lisa-kb-export.button:hover {
    background: #135e96;
    border-color: #135e96;
}
#lisa-kb-import-btn.button {
    background: #1c7c3e;
    border-color: #1c7c3e;
}
#lisa-kb-import-btn.button:hover {
    background: #155f30;
    border-color: #155f30;
}


/* Knowledge Base field helper text + character counter */
.lisa-kb-help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #646970;
}
.lisa-kb-count {
    font-weight: 600;
    color: #50575e;
}
.lisa-kb-count.over {
    color: #b32d2e;
}


/* Knowledge Base import status box */
.lisa-kb-import-status {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #c3c4c7;
    background: #f6f7f7;
}
.lisa-kb-import-status.loading {
    background: #fff3cd;
    border-color: #e6d8a8;
    color: #856404;
}
.lisa-kb-import-status.success {
    background: #e6f5ea;
    border-color: #b8e0c4;
    color: #1c7c3e;
}
.lisa-kb-import-status.error {
    background: #fdeaea;
    border-color: #f0c2c2;
    color: #b32d2e;
}


/* Knowledge Base import summary dismiss button */
.lisa-kb-import-status {
    position: relative;
}
.lisa-kb-import-dismiss {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0;
}
.lisa-kb-import-dismiss:hover {
    opacity: 1;
}
