/**
 * Admin styles for WebChatAgent
 */

/* Header with logo */
.webchatagent-admin-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dcdcde;
}

.webchatagent-logo {
    width: 142px;
    height: 92px;
    margin-right: 15px;
    background: url('../images/WebChatAgentWordpress.png') no-repeat center center;
    background-size: contain;
}

.webchatagent-admin-header h1 {
    margin: 0;
    padding: 0;
}

.webchatagent-admin-container {
    display: flex;
    flex-wrap: wrap;
    margin-top: 20px;
    gap: 40px;
}

.webchatagent-settings-container {
    flex: 1;
    min-width: 500px;
}

.webchatagent-preview-container {
    flex: 1;
    min-width: 360px;
    max-width: 500px;
}

.webchatagent-preview {
    position: relative;
    background-color: #f0f2f5;
    border-radius: 8px;
    overflow: hidden;
    height: 600px;
    border: 1px solid #dcdcde;
    padding: 20px;
}

#webchatagent-preview-frame {
    height: 100%;
    width: 100%;
    position: relative;
}

/* Avatar preview */
.webchatagent-avatar-preview {
    margin-top: 10px;
    max-width: 100px;
    max-height: 100px;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid #dcdcde;
}

.webchatagent-avatar-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* Media field */
.webchatagent-media-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Color picker */
.webchatagent-color-picker {
    width: 100px;
    height: 30px;
    padding: 0;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
}

/* Form field spacing */
.webchatagent-form-table th {
    padding-top: 20px;
    padding-bottom: 20px;
}

.webchatagent-form-table td {
    padding-top: 15px;
    padding-bottom: 15px;
}

/* Chatbot ID hints */
.webchatagent-get-id {
    margin-top: 10px;
    font-size: 14px;
}

.webchatagent-get-id a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
}

.webchatagent-get-id a:hover {
    color: #135e96;
    text-decoration: underline;
}

.webchatagent-free-notice {
    margin-top: 12px;
    background-color: #f0f6fc;
    border-left: 4px solid #2271b1;
    padding: 10px 15px;
    display: inline-block;
}

.webchatagent-free-notice span {
    font-weight: 600;
    color: #1d2327;
}

/* Live preview widget styles */
.webchatagent-chat-container-preview {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 360px;
    max-width: 90%;
    height: 480px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.webchatagent-chat-header-preview {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.webchatagent-header-content-preview {
    display: flex;
    align-items: center;
    gap: 10px;
}

.webchatagent-avatar-image-preview {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background-color: rgba(255, 255, 255, 0.2);
}

.webchatagent-chat-title-preview {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.webchatagent-chat-body-preview {
    flex-grow: 1;
    background-color: #f9fafb;
    padding: 16px;
    overflow-y: auto;
}

.webchatagent-message-preview {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 12px;
    background-color: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.webchatagent-chat-bubble-preview {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    bottom: 20px;
    right: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.webchatagent-bubble-icon-preview {
    width: 24px;
    height: 24px;
}

/* Position Settings Styles */
.webchatagent-position-fields {
    margin-top: 20px;
}

.webchatagent-position-fields .webchatagent-form-table th {
    width: 250px;
}

.webchatagent-position-fields input[type="number"] {
    width: 80px;
}

/* Highlighting the position area */
#webchatagent_position_section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

/* Tab-Navigation Styling */
.webchatagent-nav-tab-wrapper {
    border-bottom: 1px solid #ccc;
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

.webchatagent-nav-tab {
    font-size: 14px;
    margin-left: 0px !important;
    margin-right: 10px !important;
    padding: 8px 12px;
    background: #f8f8f8;
    border: 1px solid #ccc;
    border-bottom: none;
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
    margin-bottom: -1px;
}

.webchatagent-nav-tab:hover {
    background: #fff;
    color: #0073aa;
}

.webchatagent-nav-tab-active {
    background: #fff;
    color: #0073aa;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    font-weight: 600;
}

/* Tab contents */
.webchatagent-tab-content {
    background: #fff;
    padding: 15px;
    border: 1px solid #ccc;
    border-top: none;
    margin-top: -1px;
}

/* Form fields */
.webchatagent-form-table th {
    padding: 15px 10px 15px 0;
    width: 200px;
}

.webchatagent-form-table td {
    padding: 15px 10px;
}

.webchatagent-description {
    font-style: italic;
    color: #666;
    margin-top: 5px;
}

/* Color picker */
.webchatagent-color-picker {
    width: 65px;
    height: 30px;
    padding: 0;
    border: 1px solid #ddd;
    cursor: pointer;
}

/* Avatar Preview */
.webchatagent-avatar-preview {
    margin-top: 10px;
    display: inline-block;
    min-height: 60px;
    min-width: 60px;
}

.webchatagent-media-field {
    display: flex;
    align-items: center;
}

.webchatagent-media-button {
    margin-left: 8px !important;
}

/* Chatbot ID field and button */
.webchatagent-id-field-container {
    display: flex;
    align-items: center;
}

.webchatagent-get-id {
    margin-top: 5px !important;
    color: #0073aa;
}

.webchatagent-free-notice {
    background: #e9f7e9;
    color: #1e7b1e;
    padding: 5px 10px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 5px !important;
    font-weight: 500;
}

/* Error and notice styles */
.webchatagent-error {
    color: #d63638;
    background-color: #f8d7da;
    padding: 10px;
    border-left: 4px solid #d63638;
    margin: 10px 0;
}

.webchatagent-notice {
    padding: 10px 15px;
    margin: 5px 0 15px;
    background: #fff;
    border-left: 4px solid #72aee6;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.webchatagent-notice-success {
    border-left-color: #00a32a;
}

.webchatagent-field-error {
    background-color: rgba(220, 50, 50, 0.05) !important;
    border-left: 4px solid #dc3232 !important;
}

.webchatagent-field-error tr {
    background-color: rgba(220, 50, 50, 0.05) !important;
}

.webchatagent-field-error input, 
.webchatagent-field-error select, 
.webchatagent-field-error textarea {
    border-color: #dc3232 !important;
    box-shadow: 0 0 2px rgba(220, 50, 50, 0.8) !important;
}

/* Live preview */
.webchatagent-preview-container {
    min-width: 320px;
    max-width: 500px;
    flex: 1;
}

.webchatagent-preview {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    min-height: 400px;
    position: relative;
}

#webchatagent-preview-frame {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* Responsive adjustments */
@media screen and (max-width: 1200px) {
    .webchatagent-admin-container {
        flex-direction: column;
    }
    
    .webchatagent-settings-container {
        margin-right: 0;
        margin-bottom: 30px;
        max-width: 100%;
    }
    
    .webchatagent-preview-container {
        max-width: 100%;
    }
}
