/* Chat Assistant Styles */
.chat-assistant-bottom-right {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 9999;
}

.chat-assistant-bottom-left {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
}

.chat-assistant-top-right {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.chat-assistant-top-left {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
}

/* Chat Toggle Button */
.chat-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.chat-toggle i {
    color: white;
    font-size: 24px;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chat-assistant-bottom-left .chat-window {
    right: auto;
    left: 0;
}

.chat-assistant-top-right .chat-window {
    bottom: auto;
    top: 80px;
}

.chat-assistant-top-left .chat-window {
    bottom: auto;
    top: 80px;
    right: auto;
    left: 0;
}

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

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 18px;
    color: #fff;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.chat-close i {
    font-size: 16px;
}

.chat-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-header-btn {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.chat-header-btn i {
    font-size: 14px;
}

.chat-header-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.chat-message {
    margin-bottom: 15px;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.bot-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e1e5e9;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: inline-block;
}

.message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 5px 0;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.quick-action-btn {
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #5f6368;
}

.quick-action-btn:hover {
    background: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
}

/* Chat Input */
.chat-input-container {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e1e5e9;
    position: relative;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

#chat-input {
    flex: 1;
    border: 1px solid #dadce0;
    border-radius: 25px;
    padding: 10px 40px 10px 15px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#chat-input:focus {
    border-color: #1a73e8;
}

.chat-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#searchBox.minimalSearch #searchForm .largerWidth {
    position: relative;
}

.chat-assistant-button {
    position: absolute;
    right: 0;
    top: 0px;
    color: white;
    border: none;
    padding: 0px 0px;
    border: 0px;
    cursor: pointer;
    white-space: nowrap;
    z-index: 10;
}

.chat-assistant-button button {
    border: 0px;
    background-color: transparent;
    color: #333;
    -moz-webkit-text-fill-color: transparent;
    webkit-text-fill-color: transparent;
    background: linear-gradient(135deg, #42d392, #647eff);
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    margin: 4px;
    padding: 5px 10px !important;
}

#footerTop.chatAssistant {
    bottom: 65px;
}

/* Action Buttons */
.message-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #1557b0;
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: #f1f3f4;
    color: #5f6368;
    border: 1px solid #dadce0;
}

.action-btn.secondary:hover {
    background: #e8f0fe;
    color: #1a73e8;
    border-color: #1a73e8;
}

/* Feedback Buttons - Positioned outside message content at bottom right */
.feedback-buttons {
    position: absolute;
    bottom: -15px;
    right: -10px;
    display: flex;
    gap: 4px;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.chat-message:hover .feedback-buttons {
    opacity: 1;
}

/* Ensure the chat message container has relative positioning for absolute feedback buttons */
.chat-message {
    position: relative;
}

.feedback-btn {
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    background-color: #333;
    border: 0px;
}

.feedback-btn:hover {

    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.feedback-btn.positive:hover,
.feedback-btn.clicked {
    border: 1px solid #4caf50;
}

.feedback-btn.negative:hover,
.feedback-btn.negative.clicked {
    border: 1px solid #f44336;
}

/* Clicked state styling - more prominent */
.feedback-btn.clicked {
    opacity: 1 !important;
    transform: scale(0.95);
}

/* Tooltip for feedback buttons */
.feedback-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 10px;
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    margin-bottom: 4px;
}

.feedback-btn::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    margin-bottom: -4px;
}

.feedback-btn:hover::after,
.feedback-btn:hover::before {
    opacity: 1;
}

/* Message content styling - no special positioning needed since buttons are relative to chat-message */

/* Search Result Display */
.search-result {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
}

.search-result h4 {
    margin: 0 0 10px 0;
    color: #2e7d32;
}

.search-params {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.search-params span {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
    margin-right: 5px;
    display: inline-block;
    margin-bottom: 5px;
}

/* Shortcode Help Display */
.shortcode-help {
    background: #fff3e0;
    border: 1px solid #ff9800;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
}

.shortcode-help h4 {
    margin: 0 0 10px 0;
    color: #e65100;
}

.shortcode-example {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    margin: 10px 0;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
}

.copy-btn:hover {
    background: #1557b0;
}

/* Agent Handoff */
.agent-handoff {
    border-radius: 10px;
    padding: 0px;
    margin: 10px 0;
    text-align: center;
}

.agent-handoff h4 {
    margin: 0 0 10px 0;
    color: #1976d2;
}

/* Dark Theme */
.chat-assistant-dark .chat-window {
    background: #2d3748;
    color: #e2e8f0;
}

.chat-assistant-dark .chat-messages {
    background: #1a202c;
}

.chat-assistant-dark .chat-input-container {
    background: #2d3748;
    border-top-color: #4a5568;
}

.chat-assistant-dark #chat-input {
    background: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

.chat-assistant-dark .bot-message .message-content {
    background: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
}

.chat-assistant-dark .quick-action-btn {
    background: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

.chat-assistant-dark .quick-action-btn:hover {
    background: #2b6cb0;
    border-color: #3182ce;
    color: #e2e8f0;
}

/* Responsive Design */
@media (max-width: 480px) {
    .chat-window {
        width: 300px;
        height: 400px;
    }
    
    .chat-assistant-bottom-right,
    .chat-assistant-bottom-left {
        bottom: 10px;
    }
    
    .chat-assistant-bottom-right {
        right: 10px;
    }
    
    .chat-assistant-bottom-left {
        left: 10px;
    }
}

/* Loading Animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 18px;
    max-width: 80px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input Container with Emoticon Picker Inside */
.input-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.input-container input {
    width: 100%;
    padding-right: 40px; /* Make space for the emoticon picker */
    border: 1px solid #e9ecef;
    border-right: none;
    border-radius: 8px 0 0 8px;
}

/* Form Container */
.form-container {
    margin-top: 15px;
    padding: 0px;
    border-radius: 8px;
}

.form-container .frm_form {
    margin: 0;
}

.form-container .frm_form_field {
    margin-bottom: 15px;
}

.form-container .frm_form_field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-container .frm_form_field input,
.form-container .frm_form_field textarea,
.form-container .frm_form_field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-container .frm_form_field input:focus,
.form-container .frm_form_field textarea:focus,
.form-container .frm_form_field select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.form-container .frm_submit {
    margin-top: 20px;
}

.form-container .frm_submit input[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.form-container .frm_submit input[type="submit"]:hover {
    transform: translateY(-1px);
}

/* Form Loading */
.form-loading {
    text-align: center;
    padding: 20px;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* Emoticon Bar - Horizontal Scrollable */
.emoticon-bar {
    background: #333;
    border-bottom: 1px solid #666;
    padding: 8px 0;
    margin-bottom: 10px;
    display: none;
}

.emoticon-bar.show {
    display: block;
}

.emoticon-scroll {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding: 0 10px;
    scrollbar-width: thin;
    scrollbar-color: #000 #000;
}

.emoticon-scroll::-webkit-scrollbar {
    height: 6px;
    background: #000;
}

.emoticon-scroll::-webkit-scrollbar-track {
    background: #666;
    border-radius: 3px;
}

.emoticon-scroll::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.emoticon-scroll::-webkit-scrollbar-thumb:hover {
    background: #333;
}

.emoticon-btn {
    background: none;
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 20px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    flex-shrink: 0;
}

.emoticon-btn:hover {
    transform: scale(1.1);
}

.emoticon-btn:active {
    transform: scale(0.95);
}

/* Emoticon Toggle Button - Inside Input */
.emoticon-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    padding: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    z-index: 10;
}

.emoticon-toggle:hover {
    color: #fff;
}

.emoticon-toggle.active {
    color: white;
}

/* Chat input wrapper with new structure */
.chat-input-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}

.chat-input-wrapper .chat-send {
    border-left: none;
}
