/* IndoTraq Chatbot Styles - 3D Blue Theme */

:root {
    --indotraq-blue-primary: #0066cc;
    --indotraq-blue-dark: #004499;
    --indotraq-blue-light: #3399ff;
    --indotraq-shadow: rgba(0, 102, 204, 0.3);
}

/* Container - Fixed position bottom right */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Input Bar */
.chatbot-input-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Bounce Animation */
.chatbot-input-bar.bouncing {
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Input Wrapper - 3D Effect */
.input-wrapper {
    display: flex;
    align-items: center;
    background: linear-gradient(145deg, var(--indotraq-blue-light), var(--indotraq-blue-primary));
    border-radius: 25px;
    padding: 8px 16px;
    box-shadow:
        0 6px 20px var(--indotraq-shadow),
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-width: 200px;
}

.input-wrapper:focus-within {
    min-width: 350px;
    box-shadow:
        0 8px 30px var(--indotraq-shadow),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15);
}

/* Text Input */
#chatbot-input {
    flex: 1;
    border: none;
    background: transparent;
    color: white;
    font-size: 14px;
    outline: none;
    padding: 8px 0;
}

#chatbot-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Send Button */
.send-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
    transition: background 0.2s;
}

.send-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Logo Button - Round with 3D effect */
.logo-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 0.8),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.logo-btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.8),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.logo-btn img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Messages Container */
.chatbot-messages {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 480px;
    max-height: 450px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: opacity 0.3s, transform 0.3s;
}

.chatbot-messages.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.messages-wrapper {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

/* Message Bubbles */
.message {
    margin-bottom: 12px;
    max-width: 85%;
}

.message.user {
    margin-left: auto;
    background: var(--indotraq-blue-primary);
    color: white;
    border-radius: 18px 18px 4px 18px;
    padding: 10px 16px;
}

.message.bot {
    background: #f0f2f5;
    color: #333;
    border-radius: 18px 18px 18px 4px;
    border-bottom-left-radius: 5px;
    /* Added/Modified */
    padding: 10px 16px;
}

/* Markdown Styles for Bot Messages */
.message.bot p {
    margin: 0 0 8px 0;
}

.message.bot p:last-child {
    margin-bottom: 0;
}

.message.bot ul,
.message.bot ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message.bot li {
    margin-bottom: 4px;
}

.message.bot strong {
    font-weight: 600;
}

.message.bot code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

/* Loading indicator */
.message.loading {
    display: flex;
    gap: 4px;
    padding: 14px 20px;
}

.message.loading span {
    width: 8px;
    height: 8px;
    background: var(--indotraq-blue-primary);
    border-radius: 50%;
    animation: loadingDot 1.4s ease-in-out infinite;
}

.message.loading span:nth-child(2) {
    animation-delay: 0.2s;
}

.message.loading span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingDot {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-messages {
        width: calc(100vw - 40px);
        right: 20px;
    }

    .input-wrapper:focus-within {
        min-width: 250px;
    }
}