/* ===================================
   CYNARAX - Chatbot Widget Styles
   Floating AI assistant chat widget
   =================================== */

/* Chat Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    transition: var(--transition-smooth);
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.6);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    fill: var(--dark-bg);
    transition: var(--transition-smooth);
}

.chatbot-toggle .icon-close {
    display: none;
}

.chatbot-toggle.active .icon-chat {
    display: none;
}

.chatbot-toggle.active .icon-close {
    display: block;
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 105px;
    right: 30px;
    width: 400px;
    max-height: 560px;
    background: var(--dark-surface);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 212, 255, 0.08);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chatbot-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.chatbot-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--dark-card) 0%, var(--dark-surface) 100%);
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    flex-shrink: 0;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-avatar svg {
    width: 20px;
    height: 20px;
    fill: var(--dark-bg);
}

.chatbot-header-info h4 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.chatbot-header-info span {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--accent-neon);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 300px;
    max-height: 380px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 212, 255, 0.2) transparent;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.2);
    border-radius: 10px;
}

/* Message Bubbles */
.chatbot-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 14px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    line-height: 1.55;
    word-wrap: break-word;
    animation: msgFadeIn 0.3s ease;
}

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

.chatbot-msg.bot {
    align-self: flex-start;
    background: var(--dark-card);
    color: var(--text-secondary);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0, 212, 255, 0.08);
}

.chatbot-msg.user {
    align-self: flex-end;
    background: var(--gradient-primary);
    color: var(--dark-bg);
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

/* Typing Indicator */
.chatbot-typing {
    align-self: flex-start;
    display: flex;
    gap: 5px;
    padding: 12px 18px;
    background: var(--dark-card);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0, 212, 255, 0.08);
}

.chatbot-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingDot 1.4s ease-in-out infinite;
}

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Input Area */
.chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid rgba(0, 212, 255, 0.1);
    background: var(--dark-card);
    flex-shrink: 0;
}

.chatbot-input {
    flex: 1;
    background: var(--dark-surface);
    border: 1px solid rgba(0, 212, 255, 0.12);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.3s ease;
    resize: none;
}

.chatbot-input::placeholder {
    color: var(--text-muted);
}

.chatbot-input:focus {
    border-color: var(--primary-blue);
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gradient-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.chatbot-send:hover {
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.chatbot-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.chatbot-send svg {
    width: 18px;
    height: 18px;
    fill: var(--dark-bg);
}

/* Error Message */
.chatbot-msg.error {
    align-self: center;
    background: rgba(255, 77, 77, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255, 77, 77, 0.2);
    font-size: 0.8rem;
    text-align: center;
    max-width: 90%;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 100vh;
        border-radius: 16px 16px 0 0;
    }

    .chatbot-messages {
        max-height: calc(100vh - 200px);
    }

    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 54px;
        height: 54px;
    }
}
