/* Chatbot Widget Styles */

.chatbot-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    color: white;
    font-size: 24px;
    padding: 0;
}

.chatbot-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.chatbot-fab:active {
    transform: translateY(0);
}

.chatbot-panel {
    position: fixed;
    bottom: 5.5rem;
    right: 2rem;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    overflow: hidden;
}

.chatbot-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chatbot-header {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.chatbot-header-text h3 {
    margin: 0;
    font-size: 1rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    color: white;
}

.chatbot-header-text p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Inter', sans-serif;
}

.chatbot-header-actions {
    display: flex;
    gap: 0.5rem;
}

.chatbot-header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
    padding: 0;
}

.chatbot-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #ffffff;
}

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

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

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

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.message {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    animation: fadeInUp 0.3s ease-out;
}

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

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

.message.bot {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user .message-content {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-radius: 12px 12px 4px 12px;
}

.message.bot .message-content {
    background: #f1f5f9;
    color: #4a5568;
    border-radius: 12px 12px 12px 4px;
}

/* Markdown styles for bot messages */
.message.bot .message-content strong {
    color: #1a1a1a;
    font-weight: 600;
}

.message.bot .message-content em {
    font-style: italic;
}

.message.bot .message-content a {
    color: #3b82f6;
    text-decoration: underline;
    word-break: break-word;
}

.message.bot .message-content a:hover {
    color: #1d4ed8;
}

.message.bot .message-content ul,
.message.bot .message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.message.bot .message-content li {
    margin: 0.25rem 0;
    line-height: 1.5;
}

.message.bot .message-content code {
    background: #e2e8f0;
    color: #1a1a1a;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
}

.message.bot .message-content pre {
    background: #1a1a1a;
    color: #f1f5f9;
    padding: 0.75rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.5rem 0;
    font-size: 0.85em;
}

.message.bot .message-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.message.bot .message-content br + br {
    display: none;
}

.message.system .message-content {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #22c55e;
    border-radius: 8px;
    font-size: 0.85rem;
    max-width: 90%;
    text-align: center;
    margin: 0 auto;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
    background: #f1f5f9;
    border-radius: 12px 12px 12px 4px;
    width: fit-content;
}

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

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

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

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

.chatbot-input-area {
    border-top: 1px solid #e2e8f0;
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    background: #ffffff;
}

.chatbot-input-area input {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.chatbot-input-area input:focus {
    outline: none;
    border-color: #3b82f6;
}

.chatbot-input-area input::placeholder {
    color: #94a3b8;
}

.chatbot-send-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    padding: 0;
    flex-shrink: 0;
}

.chatbot-send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.chatbot-send-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

/* Notification Toast */
.chatbot-notification {
    position: fixed;
    bottom: 7.5rem;
    right: 2rem;
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    z-index: 998;
    animation: slideUp 0.3s ease-out;
}

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

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-fab {
        bottom: 1.5rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }

    .chatbot-panel {
        bottom: 5rem;
        right: 1rem;
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        height: 65vh;
        max-height: 500px;
    }

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

    .chatbot-input-area {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .chatbot-messages {
        padding: 0.75rem;
    }

    .chatbot-header {
        padding: 0.75rem;
    }
}
