/* Tablestakes AI Chatbot Widget Styles */

#tablestakes-chatbot {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    z-index: 9999;
}

/* Chat Button */
.chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    transition: all 0.3s ease;
    color: white;
    border: none;
    z-index: 9999;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

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

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Lead Form */
.lead-form {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

.chat-message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease-out;
    width: 100%;
}

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

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

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

.chat-message-user .message-bubble {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message-assistant {
    display: flex;
    justify-content: flex-start;
}

.chat-message-assistant .message-bubble {
    background: white;
    color: #1a1a1a;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

#chat-form {
    display: flex;
    gap: 8px;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

#chat-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

#send-button {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

#send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

#send-button:active {
    transform: scale(0.95);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 48px);
        bottom: 16px;
        right: 16px;
    }
    
    .chat-button {
        bottom: 16px;
        right: 16px;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Greeting Message Styling */
.greeting-message {
    max-width: 100% !important;
    width: 100%;
    min-width: 280px;
}

.greeting-headline {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    white-space: normal;
    word-wrap: break-word;
}

.greeting-body {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 12px;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
}

.greeting-prompt {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    margin-top: 4px;
    white-space: normal;
    word-wrap: break-word;
}

/* Quick Action Buttons */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 20px;
    animation: fadeIn 0.3s ease-out;
}

.quick-action-btn {
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.quick-action-btn:hover:not(:disabled) {
    border-color: #7c3aed;
    background: #faf5ff;
    color: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
}

.quick-action-btn:active:not(:disabled) {
    transform: translateY(0);
}

.quick-action-btn:disabled {
    cursor: not-allowed;
}
