/* LanceDB Frontend Chatbot Widget Styles */

#lancedb-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-size: 14px !important;
    line-height: 1.5 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif !important;
}

#lancedb-chatbot-widget h3{
    font-size: x-large !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif !important;
}

#lancedb-chatbot-widget * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif !important;
}

/* Chat Bubble Button */
.lancedb-chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: var(--lancedb-bubble-radius, 50%);
    background: var(--lancedb-bubble-bg, var(--lancedb-border, #2271b1));
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--lancedb-bubble-icon, #ffffff);
}

.lancedb-chat-bubble[data-hover="scale"]:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.lancedb-chat-bubble[data-hover="pulse"]:hover {
    animation: lancedb-pulse 0.6s ease-in-out;
}

.lancedb-chat-bubble[data-hover="bounce"]:hover {
    animation: lancedb-bounce 0.6s ease-in-out;
}

.lancedb-chat-bubble[data-hover="rotate"]:hover {
    transform: rotate(15deg) scale(1.05);
}

.lancedb-chat-bubble svg {
    width: 28px;
    height: 28px;
}

/* Hover Animations */
@keyframes lancedb-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

@keyframes lancedb-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(-5px);
    }
}

/* Chat Window */
.lancedb-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.lancedb-chat-header {
    background: var(--lancedb-header-bg, var(--lancedb-border, #2271b1));
    color: var(--lancedb-header-text, #ffffff);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lancedb-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.lancedb-close-btn {
    background: transparent;
    border: none;
    color: var(--lancedb-header-text, #ffffff);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.lancedb-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages */
.lancedb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

.lancedb-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.lancedb-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5 !important;
    font-size: 14px !important;
}

.lancedb-bot-message .lancedb-message-content {
    background: var(--lancedb-bot-bg, #f0f6fc);
    color: var(--lancedb-bot-text, #1d2327);
    border-left: 3px solid var(--lancedb-border, #2271b1);
    align-self: flex-start;
}

.lancedb-user-message .lancedb-message-content {
    background: var(--lancedb-user-bg, #2271b1);
    color: var(--lancedb-user-text, #ffffff);
    align-self: flex-end;
    border-radius: 12px;
}

/* Typing Indicator */
.lancedb-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--lancedb-bot-bg, #f0f6fc);
    border-left: 3px solid var(--lancedb-border, #2271b1);
    border-radius: 12px;
}

.lancedb-message.lancedb-bot-message.lancedb-typing-message {
    align-self: flex-start;
}

.lancedb-message.lancedb-bot-message.lancedb-typing-message .lancedb-typing {
    max-width: 60px;
}

.lancedb-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lancedb-border, #2271b1);
    animation: typing 1.4s infinite;
    display: inline-block;
}

.lancedb-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.lancedb-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Chat Input */
.lancedb-chat-input-wrapper {
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
}

#lancedb-chat-form {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

#lancedb-chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif !important;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    line-height: 1.4 !important;
}

#lancedb-chat-input::placeholder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif !important;
}

#lancedb-chat-input:focus {
    outline: none;
    border-color: var(--lancedb-border, #2271b1);
}

.lancedb-send-btn {
    background: var(--lancedb-send-btn-bg, var(--lancedb-border, #2271b1));
    color: var(--lancedb-send-btn-text, #ffffff);
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.lancedb-send-btn:hover {
    opacity: 0.9;
}

.lancedb-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lancedb-clear-btn {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #666;
    font-size: 12px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4 !important;
}

.lancedb-clear-btn:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

/* Chat description text */
.lancedb-chat-messages p,
.lancedb-chat-input-wrapper p {
    font-size: 14px !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}

/* Responsive */
@media (max-width: 480px) {
    .lancedb-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: 20px;
    }
    
    #lancedb-chatbot-widget {
        right: 20px;
        bottom: 20px;
    }
}

/* Scrollbar Styling */
.lancedb-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.lancedb-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.lancedb-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.lancedb-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Area Profile Card */
.lancedb-area-card {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.lancedb-area-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.lancedb-area-card-link {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.lancedb-area-card-image {
    width: 100px;
    height: 100px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.lancedb-area-card-content {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lancedb-area-card-title {
    font-weight: 600;
    font-size: 16px !important;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.3 !important;
}

.lancedb-area-card-view {
    font-size: 13px !important;
    color: var(--lancedb-border, #2271b1);
    font-weight: 500;
    line-height: 1.3 !important;
}

.lancedb-area-card-link:hover .lancedb-area-card-view {
    text-decoration: underline;
}

/* Agent Contact Card */
.lancedb-agent-card {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    transition: all 0.3s ease;
}

.lancedb-agent-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.lancedb-agent-card-photo {
    width: 100px;
    height: 100px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    background-color: rgba(0, 0, 0, 0.05);
}

.lancedb-agent-card-content {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lancedb-agent-card-name {
    font-weight: 600;
    font-size: 16px !important;
    color: #333333 !important;
    margin-bottom: 8px;
    line-height: 1.3 !important;
}

.lancedb-agent-card-contacts {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lancedb-agent-card-contact {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px !important;
    color: #333333 !important;
    text-decoration: underline !important;
    line-height: 1.3 !important;
    transition: opacity 0.2s ease;
}

.lancedb-agent-card-contact:hover {
    opacity: 0.7;
}

.lancedb-agent-card-contact svg {
    flex-shrink: 0;
}

