/* Webspot AI Chat Widget - Exact Landing Page Design */
.webspot-ai-chat-container {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.webspot-chat-widget {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(40px);
    border-radius: 24px;
    padding: 32px;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(58, 208, 221, 0.5);
    box-shadow: 0 25px 50px -12px rgba(58, 208, 221, 0.2);
    height: var(--chat-height, 400px);
    display: flex;
    flex-direction: column;
}

/* Exact gradient overlay from landing page */
.webspot-chat-widget::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(58, 208, 221, 0.1) 0%, transparent 50%, rgba(58, 208, 221, 0.1) 100%);
    pointer-events: none;
}

.webspot-chat-header {
    position: relative;
    z-index: 10;
    margin-bottom: 16px;
    display: none; /* Hide header to match landing page */
}

.webspot-chat-messages {
    flex: 0 0 auto;
    overflow-y: auto;
    padding: 4px 16px;
    margin-bottom: 16px;
    position: relative;
    z-index: 10;
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
    max-height: 180px;
}

.webspot-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.webspot-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
    border-radius: 3px;
}

.webspot-message {
    margin-bottom: 16px;
    display: flex;
}

.webspot-ai-message {
    justify-content: flex-start;
}

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

.webspot-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.webspot-ai-message .webspot-message-content {
    background: rgba(31, 41, 55, 0.8);
    color: rgb(229, 231, 235);
    border: 1px solid rgba(75, 85, 99, 0.5);
}

/* Specific fix for welcome message - remove all left spacing */
.webspot-welcome-message {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

.webspot-welcome-message .webspot-message-content {
    margin-left: 0 !important;
    padding-left: 16px !important; /* Keep inner text padding for readability */
}

/* Ensure all AI messages align properly */
.webspot-ai-message {
    margin-left: 0;
    padding-left: 0;
}

.webspot-ai-message .webspot-message-content {
    margin-left: 0;
}

.webspot-user-message .webspot-message-content {
    background: linear-gradient(135deg, var(--primary-color, #D400a5) 0%, var(--accent-color, #3ad0dd) 100%);
    color: white;
}

/* Loading indicator styled as AI message - appears in messages area */
.webspot-loading-message .webspot-message-content {
    background: rgba(31, 41, 55, 0.8);
    color: rgb(229, 231, 235);
    border: 1px solid rgba(75, 85, 99, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.webspot-loading-dots {
    display: flex;
    gap: 4px;
}

.webspot-loading-dots div {
    width: 8px;
    height: 8px;
    background: rgb(156, 163, 175);
    border-radius: 50%;
    animation: webspot-bounce 1.4s ease-in-out infinite both;
}

.webspot-loading-dots div:nth-child(1) { animation-delay: -0.32s; }
.webspot-loading-dots div:nth-child(2) { animation-delay: -0.16s; }

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

/* Input area - exact landing page styling */
.webspot-chat-input-area {
    position: relative;
    z-index: 10;
    border-top: 1px solid rgba(75, 85, 99, 0.5);
    padding-top: 16px;
    margin-top: auto;
    space-y: 12px;
}

.webspot-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.webspot-chat-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(75, 85, 99, 1);
    border-radius: 8px;
    color: rgb(209, 213, 219);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.webspot-chat-input::placeholder {
    color: rgb(156, 163, 175);
}

.webspot-chat-input:focus {
    border-color: rgb(147, 51, 234);
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.2);
}

.webspot-send-button {
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color, #D400a5) 0%, var(--accent-color, #3ad0dd) 100%);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.webspot-send-button:hover {
    box-shadow: 0 10px 25px -5px rgba(212, 0, 165, 0.25);
}

.webspot-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.webspot-controls-row {
    display: flex;
    justify-content: flex-start;
}

.webspot-suggestion-pills {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.webspot-pill {
    flex-shrink: 0;
    padding: 8px 16px;
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(75, 85, 99, 1);
    border-radius: 20px;
    color: rgb(209, 213, 219);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.webspot-pill:hover {
    background: rgba(55, 65, 81, 0.8);
    border-color: rgba(107, 114, 128, 1);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .webspot-chat-widget {
        padding: 20px;
        border-radius: 16px;
    }
    
    .webspot-suggestion-pills {
        gap: 8px;
    }
    
    .webspot-pill {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .webspot-message-content {
        font-size: 13px;
        padding: 10px 12px;
    }
}