/* AI Bot Widget Styles */

/* Container */
.vt-ai-bot-container {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 99999;
    pointer-events: none;
}

.vt-ai-bot-container.position-right {
    right: 0;
}

.vt-ai-bot-container.position-left {
    left: 0;
}

/* Panel */
.vt-ai-bot-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--vt-ai-panel-width, 400px);
    max-width: 100vw;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    pointer-events: auto;
}

.vt-ai-bot-container.position-right .vt-ai-bot-panel {
    right: 0;
}

.vt-ai-bot-container.position-left .vt-ai-bot-panel {
    left: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.vt-ai-bot-container.is-open .vt-ai-bot-panel {
    transform: translateX(0);
}

/* Body push effect */
body.vt-ai-bot-panel-open {
    transition: margin 0.3s ease;
    overflow-x: hidden;
}

/* Panel Header */
.vt-ai-bot-header {
    padding: 16px 20px;
    background: var(--vt-ai-primary, #0084ff);
    color: var(--vt-ai-header-text, #fff);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.vt-ai-bot-header-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.vt-ai-bot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    padding: 0;
}

.vt-ai-bot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.vt-ai-bot-close i {
    font-size: 18px;
    line-height: 1;
}

/* Messages Area */
.vt-ai-bot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message Bubbles */
.vt-ai-bot-message {
    max-width: 85%;
    animation: vt-ai-bot-fade-in 0.3s ease;
}

.vt-ai-bot-message-user {
    align-self: flex-end;
}

.vt-ai-bot-message-user .vt-ai-bot-message-content {
    background: var(--vt-ai-user-bubble, #0084ff);
    color: var(--vt-ai-user-text, #fff);
    padding: 12px 16px;
    border-radius: var(--vt-ai-border-radius, 18px) var(--vt-ai-border-radius, 18px) 4px var(--vt-ai-border-radius, 18px);
    word-break: break-word;
    font-size: var(--vt-ai-font-size, 14px);
}

.vt-ai-bot-message-ai {
    align-self: flex-start;
}

.vt-ai-bot-message-ai .vt-ai-bot-message-content {
    background: var(--vt-ai-bubble, #f0f2f5);
    color: var(--vt-ai-text, #050505);
    padding: 12px 16px;
    border-radius: var(--vt-ai-border-radius, 18px) var(--vt-ai-border-radius, 18px) var(--vt-ai-border-radius, 18px) 4px;
    word-break: break-word;
    font-size: var(--vt-ai-font-size, 14px);
}

.vt-ai-bot-message-error {
    align-self: flex-start;
}

.vt-ai-bot-message-error .vt-ai-bot-message-content {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
}

/* Results Cards */
.vt-ai-bot-results {
    width: 100%;
    max-width: 100%;
}

.vt-ai-bot-result-group {
    margin-bottom: 16px;
}

.vt-ai-bot-result-group:last-child {
    margin-bottom: 0;
}

.vt-ai-bot-result-header {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding: 0 4px;
}

.vt-ai-bot-result-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Override Voxel card styles for panel context */
.vt-ai-bot-result-cards .ts-preview,
.vt-ai-bot-result-cards .ts-preview-card,
.vt-ai-bot-result-cards .ts-card {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: unset !important;
}

.vt-ai-bot-result-cards .ts-preview-card .ts-preview-body,
.vt-ai-bot-result-cards .ts-card .ts-card-body {
    padding: 12px !important;
    height: auto !important;
    min-height: unset !important;
}

/* Fix spacing in preview cards */
.vt-ai-bot-result-cards .ts-preview {
    display: block !important;
}

.vt-ai-bot-result-cards .ts-preview > * {
    height: auto !important;
    min-height: unset !important;
}

/* Remove fixed heights from card elements */
.vt-ai-bot-result-cards .ts-preview-card,
.vt-ai-bot-result-cards .ts-preview-card > *,
.vt-ai-bot-result-cards .elementor-element,
.vt-ai-bot-result-cards .elementor-widget-container {
    height: auto !important;
    min-height: unset !important;
}

/* Fix flex containers that might cause spacing */
.vt-ai-bot-result-cards .elementor-section,
.vt-ai-bot-result-cards .elementor-container,
.vt-ai-bot-result-cards .elementor-row,
.vt-ai-bot-result-cards .elementor-column {
    height: auto !important;
    min-height: unset !important;
    flex-grow: 0 !important;
}

.vt-ai-bot-result-more {
    font-size: 13px;
    color: #666;
    text-align: center;
    padding: 10px 16px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-top: 8px;
    display: block;
}

.vt-ai-bot-result-more-link {
    color: #0084ff;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.vt-ai-bot-result-more-link:hover {
    background: #e3f2fd;
    color: #0066cc;
}

/* Quick Filters */
.vt-ai-bot-quick-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.vt-ai-bot-filter-chip {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: #fff;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.vt-ai-bot-filter-chip:hover {
    border-color: #0084ff;
    color: #0084ff;
}

.vt-ai-bot-filter-chip.active {
    background: #0084ff;
    color: #fff;
    border-color: #0084ff;
}

/* Card Action Buttons */
.vt-ai-bot-card-actions {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #eee;
    background: #fafafa;
    margin-top: -1px;
}

.vt-ai-bot-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 500;
    color: #0084ff;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.vt-ai-bot-action-btn:hover {
    background: #0084ff;
    color: #fff;
    border-color: #0084ff;
}

.vt-ai-bot-action-btn i {
    font-size: 14px;
    line-height: 1;
}

.vt-ai-bot-action-btn span {
    display: inline;
}

/* Hide text on smaller panels, show only icons */
@media (max-width: 360px) {
    .vt-ai-bot-action-btn span {
        display: none;
    }

    .vt-ai-bot-action-btn {
        padding: 10px;
    }

    .vt-ai-bot-action-btn i {
        font-size: 16px;
    }
}

/* Input Area */
.vt-ai-bot-input-area {
    padding: 16px 20px;
    border-top: 1px solid #e4e6eb;
    flex-shrink: 0;
    background: #fff;
}

.vt-ai-bot-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.vt-ai-bot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: var(--vt-ai-font-size, 14px);
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.vt-ai-bot-input:focus {
    border-color: var(--vt-ai-primary, #0084ff);
}

.vt-ai-bot-input::placeholder {
    color: #999;
}

.vt-ai-bot-send {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: var(--vt-ai-primary, #0084ff);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.1s ease, filter 0.2s ease;
    padding: 0;
}

.vt-ai-bot-send:hover {
    filter: brightness(0.9);
}

.vt-ai-bot-send:active {
    transform: scale(0.95);
}

.vt-ai-bot-send i {
    font-size: 18px;
    line-height: 1;
}

.vt-ai-bot-send svg {
    width: 18px;
    height: 18px;
}

/* Suggested Queries */
.vt-ai-bot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 20px;
    animation: vt-ai-bot-fade-in 0.3s ease;
}

.vt-ai-bot-suggestion-chip {
    padding: 8px 14px;
    background: #f0f2f5;
    border: none;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.vt-ai-bot-suggestion-chip:hover {
    background: #e4e6eb;
}

.vt-ai-bot-suggestion-chip:active {
    transform: scale(0.95);
}

/* Loading Animation */
.vt-ai-bot-loading {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: #f0f2f5;
    border-radius: 18px 18px 18px 4px;
    width: fit-content;
}

.vt-ai-bot-loading-text {
    font-size: 14px;
    color: #666;
}

.vt-ai-bot-loading-dots {
    display: flex;
    gap: 3px;
    align-items: center;
}

.vt-ai-bot-loading-dots span {
    width: 5px;
    height: 5px;
    background: #666;
    border-radius: 50%;
    animation: vt-ai-bot-bounce 1.4s infinite ease-in-out both;
}

.vt-ai-bot-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.vt-ai-bot-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes vt-ai-bot-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

@keyframes vt-ai-bot-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .vt-ai-bot-panel {
        width: 100vw;
    }

    body.vt-ai-bot-panel-open {
        overflow: hidden;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .vt-ai-bot-container.is-open .vt-ai-bot-trigger {
        display: none;
    }
}

/* Scrollbar styling */
.vt-ai-bot-messages::-webkit-scrollbar {
    width: 6px;
}

.vt-ai-bot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.vt-ai-bot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.vt-ai-bot-messages::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* RTL Support */
[dir="rtl"] .vt-ai-bot-container.position-right {
    right: auto;
    left: 0;
}

[dir="rtl"] .vt-ai-bot-container.position-left {
    left: auto;
    right: 0;
}

[dir="rtl"] .vt-ai-bot-container.position-right .vt-ai-bot-trigger {
    right: auto;
    left: var(--vt-ai-bot-horizontal, 20px);
}

[dir="rtl"] .vt-ai-bot-container.position-left .vt-ai-bot-trigger {
    left: auto;
    right: var(--vt-ai-bot-horizontal, 20px);
}

[dir="rtl"] .vt-ai-bot-message-user .vt-ai-bot-message-content {
    border-radius: 18px 18px 18px 4px;
}

[dir="rtl"] .vt-ai-bot-message-ai .vt-ai-bot-message-content {
    border-radius: 18px 18px 4px 18px;
}
