/* Viizor Chatbot Widget */

.chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Chat Button (collapsed state) */
.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.6);
}

.chatbot-button svg {
    width: 28px;
    height: 28px;
    color: white;
    transition: transform 0.3s ease;
}

.chatbot-button.active svg {
    transform: rotate(90deg);
}

/* Notification badge */
.chatbot-button .notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Chat Window */
.chatbot-window {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 550px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.chatbot-window.open {
    display: flex;
}

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

/* Chat Header */
.chatbot-header {
    background: #1a1a1a;
    color: #e5e7eb;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #2d2d2d;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
}

.chatbot-header-text h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #e5e7eb;
}

.chatbot-header-text p {
    display: none;
}

.chatbot-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.chatbot-close:hover {
    background: #2d2d2d;
    color: #e5e7eb;
}

.chatbot-close svg {
    width: 16px;
    height: 16px;
}

/* Chat Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #0f0f0f;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

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

/* Message Bubbles */
.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.message.user .message-avatar {
    background: #e2e8f0;
}

.message-avatar svg {
    width: 18px;
    height: 18px;
}

.message.bot .message-avatar svg {
    color: white;
}

.message.user .message-avatar svg {
    color: #64748b;
}

.message-content {
    max-width: 75%;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot .message-bubble {
    background: #1a1a1a;
    color: #e5e7eb;
    border: 1px solid #2d2d2d;
}

.message.user .message-bubble {
    background: #2d2d2d;
    color: #e5e7eb;
    border: 1px solid #404040;
}

.message-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    padding: 0 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-indicator.active {
    display: block;
}

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

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

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

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

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Chat Input */
.chatbot-input-container {
    padding: 12px;
    background: #1a1a1a;
    border-top: 1px solid #2d2d2d;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #2d2d2d;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
    transition: border-color 0.2s;
    background: #0f0f0f;
    color: #e5e7eb;
}

.chatbot-input:focus {
    outline: none;
    border-color: #404040;
}

.chatbot-input::placeholder {
    color: #64748b;
}

.chatbot-send-button {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #2d2d2d;
    border: 1px solid #404040;
    color: #e5e7eb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.chatbot-send-button:hover:not(:disabled) {
    background: #404040;
    border-color: #525252;
}

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

.chatbot-send-button svg {
    width: 16px;
    height: 16px;
}

/* Welcome Message */
.welcome-message {
    text-align: left;
    padding: 8px;
    color: #64748b;
}

.welcome-message h4 {
    display: none;
}

.welcome-message p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

/* Quick Suggestions */
.quick-suggestions {
    display: none;
}

.suggestion-button {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.suggestion-button:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateX(4px);
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        right: 16px;
        bottom: 90px;
    }

    .chatbot-button {
        bottom: 16px;
        right: 16px;
    }
}

/* Code blocks in messages */
.message-bubble code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.message.user .message-bubble code {
    background: rgba(255, 255, 255, 0.2);
}

/* Links in messages */
.message-bubble a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
}

.message-bubble a:hover {
    opacity: 0.8;
}
