.cwp-ai-admin {
    background: #fff;
    padding: 20px;
    margin: 20px 20px 20px 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cwp-ai-admin h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #1d2327;
}

.cwp-ai-admin h1 .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #2271b1;
}

.nav-tab-wrapper {
    border-bottom: 1px solid #c3c4c7;
    margin: 20px 0;
}

.nav-tab {
    font-size: 14px;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    background: #f0f0f1;
}

.nav-tab-active {
    border-bottom: 3px solid #2271b1;
    font-weight: 600;
}

.cwp-ai-tab-content {
    padding: 20px 0;
}

.cwp-ai-knowledge-header {
    margin-bottom: 30px;
}

.cwp-ai-knowledge-header h2 {
    margin-bottom: 10px;
    color: #1d2327;
}

.cwp-ai-add-qa-form {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 40px;
    transition: all 0.3s ease;
}

.cwp-ai-add-qa-form .form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2271b1;
}

.cwp-ai-add-qa-form .form-header h3 {
    margin: 0;
    color: #2271b1;
    font-size: 18px;
}

#cwp-add-qa-row {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #2271b1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

#cwp-add-qa-row:hover:not(:disabled) {
    background: #135e96;
    transform: translateY(-1px);
}

#cwp-add-qa-row:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#cwp-qa-rows-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cwp-qa-row {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    transition: all 0.3s;
}

.cwp-qa-row:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.1);
}

.qa-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.qa-row-header .row-number {
    font-weight: 600;
    color: #2271b1;
    font-size: 14px;
}

.remove-qa-row {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s;
}

.remove-qa-row:hover {
    background: #c82333;
}

.remove-qa-row .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.qa-row-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.qa-field {
    display: flex;
    flex-direction: column;
}

.qa-field label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.qa-field .label-text {
    font-weight: 600;
    color: #1d2327;
    font-size: 13px;
}

.qa-field input[type="text"],
.qa-field textarea {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    width: 100%;
}

.qa-field input[type="text"]:focus,
.qa-field textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.qa-field .description {
    margin: 5px 0 0 0;
    color: #646970;
    font-size: 12px;
}

.form-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.form-footer .submit {
    display: flex;
    align-items: center;
    gap: 10px;
}

#cwp-submit-all-qa {
    background: #00a32a;
    border-color: #00a32a;
    color: white;
    padding: 10px 24px;
    font-size: 14px;
    height: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

#cwp-submit-all-qa:hover:not(:disabled) {
    background: #008a20;
    border-color: #008a20;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 163, 42, 0.3);
}

#cwp-submit-all-qa:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-footer .spinner {
    float: none;
    margin: 0;
}

.form-footer .spinner.is-active {
    visibility: visible;
}

.cwp-ai-qa-list {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.list-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1d2327;
}

.list-actions {
    display: flex;
    gap: 10px;
}

.list-actions input[type="text"],
.list-actions select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.cwp-ai-qa-table-wrapper {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cwp-ai-qa-table-wrapper table {
    margin: 0;
}

.cwp-ai-qa-table-wrapper th {
    background: #f0f0f1;
    font-weight: 600;
    padding: 15px 10px;
}

.cwp-ai-qa-table-wrapper td {
    padding: 15px 10px;
    vertical-align: middle;
}

.cwp-ai-qa-table-wrapper .qa-question {
    color: #2271b1;
    font-size: 14px;
}

.qa-answer-preview,
.qa-answer-full {
    color: #646970;
    font-size: 13px;
    line-height: 1.5;
}

.button-link {
    color: #2271b1;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    font-size: 12px;
    margin-top: 5px;
}

.button-link:hover {
    text-decoration: underline;
}

.qa-keywords-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.keyword-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.keyword-more {
    display: inline-block;
    padding: 4px 8px;
    background: #f0f0f1;
    color: #646970;
    border-radius: 12px;
    font-size: 11px;
}

.no-keywords {
    color: #a7aaad;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.cwp-ai-edit-qa {
    background: #2271b1;
    border-color: #2271b1;
    color: white;
}

.cwp-ai-edit-qa:hover {
    background: #135e96;
    border-color: #135e96;
}

.cwp-ai-delete-qa {
    background: #d63638;
    border-color: #d63638;
    color: white;
}

.cwp-ai-delete-qa:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}

.cwp-ai-qa-table-wrapper button {
    margin-right: 0;
    padding: 5px 10px;
    height: auto;
    line-height: 1;
}

.cwp-ai-qa-table-wrapper button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.cwp-ai-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.cwp-ai-empty-state .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #c3c4c7;
    margin-bottom: 15px;
}

.empty-title {
    color: #1d2327;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.empty-description {
    color: #646970;
    font-size: 14px;
    margin: 0;
}

.cwp-ai-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: cwpFadeIn 0.3s;
}

@keyframes cwpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cwp-ai-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: cwpSlideIn 0.3s;
}

@keyframes cwpSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cwp-ai-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.cwp-ai-modal-close:hover,
.cwp-ai-modal-close:focus {
    color: #000;
}

.cwp-ai-modal-content h2 {
    margin-top: 0;
    color: #2271b1;
}

.cwp-ai-settings-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.cwp-ai-settings-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2271b1;
    font-size: 18px;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
}

.cwp-ai-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.cwp-ai-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cwp-ai-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.cwp-ai-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .cwp-ai-slider {
    background-color: #2271b1;
}

input:checked + .cwp-ai-slider:before {
    transform: translateX(26px);
}

input[type="range"] {
    width: 300px;
    margin-right: 10px;
}

#temperature_value {
    display: inline-block;
    min-width: 30px;
    font-weight: 600;
    color: #2271b1;
}

.cwp-ai-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.cwp-ai-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

.cwp-ai-stat-card:hover {
    transform: translateY(-5px);
}

.cwp-ai-stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.cwp-ai-stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.cwp-ai-stat-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-icon {
    font-size: 48px;
}

.stat-icon .dashicons {
    width: 48px;
    height: 48px;
    font-size: 48px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.cwp-ai-recent-conversations {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cwp-ai-recent-conversations h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1d2327;
}

.cwp-ai-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

@media (max-width: 782px) {
    .cwp-ai-stats-grid {
        grid-template-columns: 1fr;
    }

    .cwp-ai-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    .cwp-ai-qa-table-wrapper {
        overflow-x: auto;
    }
}

.cwp-ai-admin .notice {
    margin: 20px 0;
    animation: cwpSlideDown 0.3s;
}

@keyframes cwpSlideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cwp-ai-knowledge-section {
    max-width: 100%;
}

.cwp-ai-knowledge-header {
    margin-bottom: 30px;
}

.cwp-ai-knowledge-header h2 {
    margin-bottom: 10px;
}

.cwp-ai-add-qa-form {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 40px;
}

.cwp-ai-add-qa-form .form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2271b1;
}

.cwp-ai-add-qa-form .form-header h3 {
    margin: 0;
    color: #2271b1;
    font-size: 18px;
}

#cwp-add-qa-row {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #2271b1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

#cwp-add-qa-row:hover:not(:disabled) {
    background: #135e96;
}

#cwp-add-qa-row:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#cwp-qa-rows-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cwp-qa-row {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.cwp-qa-row:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.1);
}

.qa-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.qa-row-header .row-number {
    font-weight: 600;
    color: #2271b1;
}

.remove-qa-row {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
}

.remove-qa-row:hover {
    background: #c82333;
}

.qa-row-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.qa-field label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.qa-field .label-text {
    font-weight: 600;
    color: #1d2327;
    font-size: 13px;
}

.qa-field input[type="text"],
.qa-field textarea {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    width: 100%;
}

.qa-field input:focus,
.qa-field textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.form-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.form-footer .submit {
    margin: 0;
}

#cwp-submit-all-qa {
    background: #00a32a;
    border-color: #00a32a;
    color: white;
    padding: 10px 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#cwp-submit-all-qa:hover:not(:disabled) {
    background: #008a20;
}

#cwp-submit-all-qa:disabled {
    opacity: 0.5;
}

.form-footer .spinner.is-active {
    visibility: visible;
}

.cwp-ai-qa-list {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.list-header h3 {
    margin: 0 0 20px 0;
}

.keyword-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 11px;
    margin-right: 5px;
}

.no-keywords {
    color: #a7aaad;
}

.cwp-ai-delete-qa {
    background: #d63638;
    border-color: #d63638;
    color: white;
}

.cwp-ai-delete-qa:hover {
    background: #b32d2e;
}

.cwp-ai-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.cwp-ai-empty-state .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #c3c4c7;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    margin: 10px 0;
}

.empty-description {
    color: #646970;
}

.swal2-popup {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.swal2-title {
    color: #1d2327;
    font-size: 1.3em;
    font-weight: 600;
}

.swal2-html-container {
    color: #50575e;
}

.swal2-confirm {
    background-color: #2271b1 !important;
    border-color: #2271b1 !important;
}

.swal2-confirm:hover {
    background-color: #135e96 !important;
    border-color: #135e96 !important;
}

.swal2-styled.swal2-confirm[style*="background-color: rgb(214, 54, 56)"] {
    background-color: #d63638 !important;
}

.swal2-container.swal2-top-end {
    top: 32px;
}

.swal2-loader {
    border-color: #2271b1 transparent #2271b1 transparent !important;
}