
* {
    box-sizing: border-box;
}

/* Chat Button */
#frappe-chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0089FF 0%, #0066CC 100%);
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 9999;
    border: none;
}

#frappe-chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#frappe-chatbot-button:active {
    transform: scale(0.95);
}

/* Preview Message Popup */
#frappe-chatbot-preview {
    position: fixed;
    background: white;
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 9998;
    max-width: 280px;
    animation: slideInBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.3s ease;
}

#frappe-chatbot-preview:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

#frappe-chatbot-preview.hidden {
    display: none;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.preview-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0089FF 0%, #0066CC 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.preview-name {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.preview-close {
    margin-left: auto;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.preview-close:hover {
    color: #1f2937;
}

.preview-message {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.4;
    margin: 0;
}

.preview-emoji {
    margin-left: 4px;
}

@keyframes slideInBounce {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    50% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chat Window */
#frappe-chatbot-window {
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUpBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpBounce {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    50% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header - WotNot Style */
.chatbot-header {
    /* padding: 16px 20px; */
    padding: 0 20px 10px 20px;
    height: 30px;

    background: #000000;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    min-height: 64px;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* Back Button - Exact WotNot Style */
.chatbot-back {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
    border-radius: 8px;
    font-weight: 300;
}

.chatbot-back:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
}

.chatbot-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0;
    flex: 1;
    text-align: center;
    line-height: 1.2;
    color:white;
}

.chatbot-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    position: relative;
}

.chatbot-menu-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    border-radius: 8px;
}

.chatbot-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Dropdown Menu */
.chatbot-menu {
    position: absolute;
    top: 44px;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.chatbot-menu.active {
    display: block;
    animation: menuSlide 0.2s ease;
}

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

.chatbot-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-menu-item:hover {
    background: #f5f7fa;
}

/* Messages Container - WotNot Style */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 26px 26px;
    background: #f7f8fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

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

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

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

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Message Bubbles - Exact WotNot Style */
.chatbot-message {
    display: flex;
    width: 100%;
    margin-bottom: 0;
}

.bot-message {
    justify-content: flex-start;
    align-items: flex-start;
    padding-left: 0;
}

.user-message {
    justify-content: flex-end;
    align-items: flex-start;
    padding-right: 0;
}

.message-content {
    max-width: 75%;
    padding: 14px 18px;
    margin: 6px 10px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    position: relative;
}

/* Bot Messages - Left Aligned */
.bot-message .message-content {
    background: #ffffff;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    text-align: left;
    margin-left: 8px;
    position: relative;
}

/* User Messages - Right Aligned */
.user-message .message-content {
    background: linear-gradient(135deg, #0089FF 0%, #0066CC 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    text-align: left;
    margin-right: 8px;
}

/* Quick Reply Buttons */
.quick-replies {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 10px 10px 10px;
    animation: fadeInUp 0.5s ease;
}

.quick-reply-btn {
    padding: 12px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #1f2937;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-reply-btn:hover {
    background: linear-gradient(135deg, #0089FF 0%, #0066CC 100%);
    color: white;
    border-color: #0089FF;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 137, 255, 0.25);
}

.quick-reply-btn:active {
    transform: translateY(0) scale(0.98);
}

.quick-reply-icon {
    font-size: 16px;
}

/* Animations */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* AI Writing Effect */
.message-content.typing-effect {
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Welcome Animation */
.welcome-animation {
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Typing Indicator - WotNot Style */
.typing-indicator-wrapper {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 0;
}

.typing-indicator-bubble {
    background: #ffffff;
    padding: 10px 14px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    margin: 6px 10px;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

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

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

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

/* Input Container - WotNot Style */
.chatbot-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 11px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    background: #f9fafb;
}

.chatbot-input:focus {
    border-color: #0089FF;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 137, 255, 0.1);
}

.chatbot-input::placeholder {
    color: #9ca3af;
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #0089FF 0%, #0066CC 100%);
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send-btn:hover:not(:disabled) {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0, 137, 255, 0.4);
}

.chatbot-send-btn:active {
    transform: scale(0.95);
}

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

/* Typing cursor effect */
.typing-cursor::after {
    content: '|';
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #frappe-chatbot-window {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        top: 0 !important;
    }
    
    #frappe-chatbot-button {
        width: 56px;
        height: 56px;
        font-size: 24px;
        bottom: 16px;
        right: 16px;
    }

    .chatbot-header {
        /* padding: 14px 16px; */
        padding: 0 20px 10px 20px;
        height: 30px;
    }

    .chatbot-title {
        font-size: 16px;
    }

    .chatbot-back,
    .chatbot-menu-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .message-content {
        max-width: 80%;
    }
    
    .chatbot-messages {
        padding: 16px 12px;
    }

    .quick-replies {
        margin: 10px 5px;
    }
}
.quick-replies-title {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
    padding-left: 6px;
}


.chatbot-messages {
    padding-left: 16px;
    padding-right: 16px;
    /* padding: 15px; */
}

/* Prevent text selection on buttons */
#frappe-chatbot-button,
.chatbot-back,
.chatbot-menu-btn,
.chatbot-send-btn,
.chatbot-menu-item,
.quick-reply-btn {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -webkit-tap-highlight-color: transparent;
}


.message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 5px 0;
    line-height: 1.6;
}

.message-content strong {
    font-weight: bold;
    color: #1a1a1a;
}

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

.message-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.message-content pre {
    background: #f4f4f4;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-content pre code {
    background: none;
    padding: 0;
}

.message-content a {
    color: #007bff;
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.message-content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 15px;
    margin: 10px 0;
    color: #666;
    font-style: italic;
}

.message-content h1, 
.message-content h2, 
.message-content h3, 
.message-content h4, 
.message-content h5, 
.message-content h6 {
    margin: 15px 0 10px 0;
    font-weight: bold;
}

.message-content hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 15px 0;
}