/* Papatto Chatbot Minimal Style */

#papatto-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 500px;
    background-color: var(--papatto-chatbot-window-bg, #ffffff);
    color: var(--papatto-chatbot-text-color, #333333);
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    font-family: var(--papatto-chatbot-font-family, sans-serif);
    font-size: var(--papatto-chatbot-font-size, 14px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

#papatto-chatbot-container.papatto-chatbot-minimal {
    background-color: #f9f9f9;
}

#papatto-chatbot-header {
    background-color: var(--papatto-chatbot-primary-color, #007CBA);
    color: #fff;
    padding: 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.papatto-chatbot-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.papatto-chatbot-header-content h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.papatto-chatbot-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.papatto-chatbot-close-btn:hover {
    opacity: 0.8;
}

#papatto-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #fff;
}

.papatto-chatbot-message {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.papatto-chatbot-message-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.papatto-chatbot-message-content {
    background-color: #eee;
    padding: 10px 14px;
    border-radius: 6px;
    word-wrap: break-word;
    line-height: 1.4;
    max-width: 85%;
}

.papatto-chatbot-user-message .papatto-chatbot-message-content {
    background-color: var(--papatto-chatbot-message-bg-user, #007CBA);
    color: var(--papatto-chatbot-message-text-user, #ffffff);
    border-radius: 6px 0 6px 6px;
}

.papatto-chatbot-bot-message .papatto-chatbot-message-content {
    background-color: var(--papatto-chatbot-message-bg-bot, #f0f0f0);
    color: var(--papatto-chatbot-message-text-bot, #333333);
    border-radius: 0 6px 6px 6px;
}

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

.papatto-chatbot-user-message .papatto-chatbot-message-avatar {
    order: 2;
}

.papatto-chatbot-user-message .papatto-chatbot-message-content {
    order: 1;
    max-width: 85%;
}

/* Loading indicator */
.papatto-chatbot-loading .papatto-chatbot-message-content {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
}

.papatto-chatbot-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    animation: papatto-typing 1.4s infinite;
}

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

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

@keyframes papatto-typing {
    0%, 60%, 100% {
        opacity: 0.5;
    }
    30% {
        opacity: 1;
    }
}

.papatto-chatbot-input-area {
    padding: 12px;
    border-top: 1px solid #ddd;
    background-color: #fff;
    border-radius: 0 0 8px 8px;
}

#papatto-chatbot-form {
    display: flex;
    gap: 8px;
}

#papatto-chatbot-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    outline: none;
}

#papatto-chatbot-input:focus {
    border-color: var(--papatto-chatbot-primary-color, #007CBA);
}

.papatto-chatbot-send-btn {
    background-color: var(--papatto-chatbot-primary-color, #007CBA);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.papatto-chatbot-send-btn:hover {
    opacity: 0.9;
}

.papatto-chatbot-send-btn:active {
    opacity: 0.8;
}

/* Minimize state */
#papatto-chatbot-container.papatto-chatbot-minimized {
    height: 60px;
    width: 300px;
}

#papatto-chatbot-container.papatto-chatbot-minimized #papatto-chatbot-messages,
#papatto-chatbot-container.papatto-chatbot-minimized .papatto-chatbot-input-area {
    display: none;
}

/* Floating Button */
#papatto-chatbot-floating-btn {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--papatto-chatbot-primary-color, #007CBA);
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 9998;
    border: none;
    padding: 0;
    bottom: 20px !important;
    right: 20px !important;
}

#papatto-chatbot-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#papatto-chatbot-floating-btn:active {
    transform: scale(0.95);
}

.papatto-chatbot-floating-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.papatto-chatbot-floating-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--papatto-chatbot-primary-color, #007CBA);
    animation: papatto-pulse 2s infinite;
}

@keyframes papatto-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Position classes - Use calc() to apply offsets */
#papatto-chatbot-floating-btn.papatto-chatbot-floating-bottom-right {
    bottom: calc(20px + var(--papatto-chatbot-offset-v, 0px)) !important;
    right: calc(20px + var(--papatto-chatbot-offset-h, 0px)) !important;
    top: auto !important;
    left: auto !important;
}

#papatto-chatbot-floating-btn.papatto-chatbot-floating-bottom-left {
    bottom: calc(20px + var(--papatto-chatbot-offset-v, 0px)) !important;
    left: calc(20px + var(--papatto-chatbot-offset-h, 0px)) !important;
    top: auto !important;
    right: auto !important;
}

#papatto-chatbot-floating-btn.papatto-chatbot-floating-top-right {
    top: calc(20px - var(--papatto-chatbot-offset-v, 0px)) !important;
    right: calc(20px + var(--papatto-chatbot-offset-h, 0px)) !important;
    bottom: auto !important;
    left: auto !important;
}

#papatto-chatbot-floating-btn.papatto-chatbot-floating-top-left {
    top: calc(20px - var(--papatto-chatbot-offset-v, 0px)) !important;
    left: calc(20px + var(--papatto-chatbot-offset-h, 0px)) !important;
    bottom: auto !important;
    right: auto !important;
}

/* Size classes */
#papatto-chatbot-floating-btn.papatto-chatbot-floating-small {
    width: 50px;
    height: 50px;
    font-size: 24px;
}

#papatto-chatbot-floating-btn.papatto-chatbot-floating-medium {
    width: 60px;
    height: 60px;
    font-size: 28px;
}

#papatto-chatbot-floating-btn.papatto-chatbot-floating-large {
    width: 70px;
    height: 70px;
    font-size: 32px;
}

/* Active state */
#papatto-chatbot-floating-btn.papatto-chatbot-active {
    opacity: 0.7;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    #papatto-chatbot-container {
        width: 100%;
        height: 100%;
        max-width: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }

    #papatto-chatbot-floating-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 10px;
        right: 10px;
    }
}

/* Scrollbar styling */
#papatto-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

#papatto-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}
