.faq-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.faq-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 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    color: white;
    font-size: 24px;
}

.faq-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.faq-chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid #e2e8f0;
    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);
    }
}

.faq-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-chat-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.faq-chat-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.faq-chat-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.faq-chat-category-selector {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.faq-chat-category-selector label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.faq-chat-category-selector select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #374151;
    outline: none;
    transition: border-color 0.2s;
}

.faq-chat-category-selector select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.faq-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
}

.faq-message {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
}

.faq-message.faq-user {
    flex-direction: row-reverse;
}

.faq-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.faq-message.faq-bot .faq-message-content {
    background: white;
    border: 1px solid #e2e8f0;
    color: #374151;
}

.faq-message.faq-user .faq-message-content {
    background: #667eea;
    color: white;
}

.faq-chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.faq-chat-input {
    display: flex;
    gap: 8px;
}

.faq-chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.faq-chat-input input:focus {
    border-color: #667eea;
}

.faq-chat-send {
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.faq-chat-send:hover {
    background: #5a67d8;
}

.faq-chat-send:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.faq-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    font-size: 14px;
    padding: 8px 16px;
}

.faq-typing-dots {
    display: flex;
    gap: 2px;
}

.faq-typing-dot {
    width: 4px;
    height: 4px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.faq-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.faq-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.faq-category-badge {
    display: inline-block;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.disclaimer {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 8px;
    text-align: center;
}

@media (max-width: 768px) {
    .faq-chatbot-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .faq-chat-container {
        width: calc(100vw - 20px);
        height: 70vh;
        bottom: 80px;
        right: -10px;
    }
}

/* Scrollbar styling for messages */
.faq-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.faq-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.faq-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.faq-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading state for category selector */
.faq-chat-category-selector.loading select {
    background-image: url("data:image/svg+xml,%3csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3e%3cg fill='none' fill-rule='evenodd'%3e%3cg transform='translate(1 1)' stroke='%23667eea'%3e%3ccircle stroke-opacity='.5' cx='9' cy='9' r='9'/%3e%3cpath d='m0 9a9 9 0 0 1 9-9'%3e%3canimateTransform attributeName='transform' type='rotate' from='0 9 9' to='360 9 9' dur='1s' repeatCount='indefinite'/%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

/* Enhanced message styling for category context */
.faq-message.faq-bot .faq-message-content .category-context {
    font-size: 11px;
    opacity: 0.7;
    font-style: italic;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #e2e8f0;
}