/**
 * LinkFlow Chat Chat Admin Styles
 */

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

/* Status indicators */
.status-active {
    color: #46b450 !important;
    font-weight: 600;
}

.status-inactive {
    color: #dc3232 !important;
    font-weight: 600;
}

/* Form styling */
.form-table th {
    width: 200px;
}

.form-table .description {
    font-style: italic;
    color: #666;
}

/* Button styling */
.button-primary.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.button.disabled:hover {
    opacity: 0.5;
}

/* Table styling */
.wp-list-table .column-name {
    width: 20%;
}

.wp-list-table .column-display-name {
    width: 20%;
}

.wp-list-table .column-provider {
    width: 15%;
}

.wp-list-table .column-status {
    width: 10%;
}

.wp-list-table .column-knowledge {
    width: 10%;
}

.wp-list-table .column-date {
    width: 15%;
}

.wp-list-table .column-question {
    width: 40%;
}

.wp-list-table .column-answer {
    width: 40%;
}

/* Knowledge base specific */
.knowledge-entry {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.knowledge-entry .question {
    font-weight: 600;
    margin-bottom: 10px;
    color: #23282d;
}

.knowledge-entry .answer {
    color: #555;
    line-height: 1.5;
}

/* Service configuration */
.service-config-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.service-config-section h3 {
    margin-top: 0;
    color: #23282d;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.service-config-section h2.title {
    margin-top: 0;
    color: #23282d;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Settings page: card container */
.ai-settings-card-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 16px;
}

/* Ensure tables inside cards fit nicely */
.service-config-section .form-table {
    margin-top: 0;
}

/* Color picker styling */
input[type="color"] {
    width: 50px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .wp-list-table .column-provider,
    .wp-list-table .column-knowledge,
    .wp-list-table .column-date {
        display: none;
    }
    
    .form-table th,
    .form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .form-table th {
        border-bottom: none;
        padding-bottom: 5px;
    }
}

/* Variable buttons styling */
.linkflow-chat-variables {
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.linkflow-chat-variables p {
    margin-top: 0;
    margin-bottom: 10px;
}

.variable-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variable-button {
    margin: 0;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.4;
    background-color: #f0f0f1;
    border-color: #7e8993;
    color: #32373c;
    text-decoration: none;
    cursor: pointer;
}

.variable-button:hover {
    background-color: #e2e4e7;
    border-color: #555;
    color: #23282d;
}

.variable-button:active {
    background-color: #d0d2d5;
    border-color: #333;
    color: #000;
    transform: translateY(1px);
}

/* Avatar upload styling */
.avatar-upload-container {
    margin-bottom: 10px;
}

.avatar-preview {
    margin-bottom: 10px;
}

.avatar-preview img {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
    background: #fff;
}

.avatar-placeholder {
    border-radius: 4px;
    color: #666;
    font-size: 12px;
    text-align: center;
}

.avatar-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.avatar-controls .button {
    margin: 0;
}

@media screen and (max-width: 782px) {
    .avatar-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .avatar-controls .button {
        margin-bottom: 8px;
        width: 100%;
        text-align: center;
    }
}