/* Admin Styles */
.qa-bot-admin {
    max-width: 1200px;
    margin: 0 auto;
}

.qa-bot-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.qa-bot-form-section,
.qa-bot-list-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 120px;
}

.qa-save-btn {
    position: relative;
    padding: 10px 20px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.qa-save-btn:hover {
    background: #135e96;
}

.qa-save-btn .spinner {
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.qa-save-btn.loading .save-text {
    opacity: 0;
}

.qa-save-btn.loading .spinner {
    display: block;
}

.qa-response-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.qa-response-message.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.qa-response-message.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

.search-box {
    display: flex;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    margin-right: 10px;
}

.qa-questions-list {
    max-height: 600px;
    overflow-y: auto;
}

.qa-answer-preview {
    margin-top: 5px;
    color: #666;
    font-size: 13px;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Frontend Widget Styles */
.qa-bot-widget {
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.qa-bot-header {
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.qa-bot-avatar {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.qa-bot-avatar:before {
    content: "";
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    border-radius: 50%;
    position: absolute;
}

.qa-bot-pulse {
    width: 10px;
    height: 10px;
    background: #4caf50;
    border-radius: 50%;
    position: absolute;
    bottom: 5px;
    right: 5px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    70% {
        transform: scale(2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.qa-bot-header h3 {
    margin: 0 0 5px;
    font-size: 18px;
}

.qa-bot-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.qa-bot-conversation {
    height: 300px;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
}

.qa-bot-message {
    display: flex;
    margin-bottom: 15px;
}

.qa-bot-message.bot {
    justify-content: flex-start;
}

.qa-bot-message.user {
    justify-content: flex-end;
}

.qa-bot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ddd;
    margin-right: 10px;
    flex-shrink: 0;
}

.qa-bot-message.user .qa-bot-message-avatar {
    background: #6e8efb;
    margin-right: 0;
    margin-left: 10px;
}

.qa-bot-message-content {
    max-width: 70%;
}

.qa-bot-message-content p {
    margin: 0;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.qa-bot-message.bot .qa-bot-message-content p {
    background: white;
    color: #333;
    border-top-left-radius: 5px;
}

.qa-bot-message.user .qa-bot-message-content p {
    background: #6e8efb;
    color: white;
    border-top-right-radius: 5px;
}

.qa-bot-input {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

.qa-bot-question-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border 0.3s;
}

.qa-bot-question-input:focus {
    border-color: #6e8efb;
}

.qa-bot-send-btn {
    width: 40px;
    height: 40px;
    margin-left: 10px;
    background: #6e8efb;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}

.qa-bot-send-btn:hover {
    background: #5a7de3;
}

/* Responsive */
@media (max-width: 768px) {
    .qa-bot-container {
        grid-template-columns: 1fr;
    }
}

/* Add these to the existing styles.css */

/* Admin Edit/Delete buttons */
.actions {
    white-space: nowrap;
}

.qa-edit-btn {
    margin-right: 5px;
    background: #2271b1;
    color: white;
    border: none;
}

.qa-delete-btn {
    color: #b32d2e;
}

.qa-delete-btn:hover {
    color: #dc3232;
}

.qa-cancel-btn {
    margin-left: 10px;
    background: #ddd;
}

/* Form states */
#qa-bot-form.edit-mode .qa-save-btn {
    background: #4CAF50;
}

#qa-bot-form.edit-mode .qa-save-btn:hover {
    background: #3e8e41;
}

/* Responsive table */
@media (max-width: 1200px) {
    .qa-questions-list table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Hover effects for table rows */
.qa-questions-list tr:hover {
    background-color: #f5f5f5;
}