/* PM Chatbot Frontend Styles */

:root {
    --pmcb-primary-color: #2563eb;
    --pmcb-primary-dark: #1d4ed8;
    --pmcb-primary-light: #93c5fd;
}

/* Widget Container */
.pmcb-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.pmcb-bottom-right {
    bottom: 20px;
    right: 20px;
}

.pmcb-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Toggle Button */
.pmcb-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--pmcb-primary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.pmcb-toggle-btn:hover {
    background: var(--pmcb-primary-dark);
    transform: scale(1.05);
}

.pmcb-toggle-btn svg {
    width: 28px;
    height: 28px;
}

/* Chat Window */
.pmcb-chat-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pmcb-bottom-right .pmcb-chat-window {
    right: 0;
}

.pmcb-bottom-left .pmcb-chat-window {
    left: 0;
}

/* Chat Header */
.pmcb-chat-header {
    background: var(--pmcb-primary-color);
    color: #fff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pmcb-chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.pmcb-status-indicator {
    display: flex;
    align-items: center;
    font-size: 12px;
    opacity: 0.9;
}

.pmcb-status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    margin-right: 6px;
}

/* Chat Messages */
.pmcb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
}

.pmcb-message {
    display: flex;
    margin-bottom: 16px;
    animation: pmcb-fadeIn 0.3s ease;
}

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

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

.pmcb-message-assistant {
    justify-content: flex-start;
}

.pmcb-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
}

.pmcb-message-user .pmcb-message-content {
    background: var(--pmcb-primary-color);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.pmcb-message-assistant .pmcb-message-content {
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.pmcb-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}

.pmcb-typing-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: pmcb-bounce 1.4s infinite ease-in-out both;
}

.pmcb-typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

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

@keyframes pmcb-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Chat Input */
.pmcb-chat-input-container {
    display: flex;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    gap: 10px;
}

.pmcb-chat-input-container input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
	color: #545454; 
}

.pmcb-chat-input-container input:focus {
    border-color: var(--pmcb-primary-color);
}

.pmcb-chat-input-container input::placeholder {
    color: #94a3b8;
}

#pmcb-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--pmcb-primary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.2s ease;
}

#pmcb-chat-send:hover {
    background: var(--pmcb-primary-dark);
}

#pmcb-chat-send:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Chat Footer */
.pmcb-chat-footer {
    padding: 8px 16px;
    text-align: center;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.pmcb-chat-footer small {
    color: #94a3b8;
    font-size: 11px;
}

/* Embedded Chat */
.pmcb-embedded-chat {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.pmcb-embedded-chat .pmcb-chat-messages {
    min-height: 300px;
}

.pmcb-embedded-messages {
    height: auto !important;
    min-height: 300px;
}

/* Error Message */
.pmcb-error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin: 10px 0;
}

/* Responsive */
@media (max-width: 480px) {
    .pmcb-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 80px;
    }

    .pmcb-bottom-right .pmcb-chat-window,
    .pmcb-bottom-left .pmcb-chat-window {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .pmcb-widget {
        left: 50%;
        transform: translateX(-50%);
    }

    .pmcb-bottom-right,
    .pmcb-bottom-left {
        left: auto;
        right: 20px;
        transform: none;
    }
}

/* Scrollbar */
.pmcb-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

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