.ldcb-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex !important;
    flex-direction: column;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

.ldcb-chat-header {
    padding: 15px;
    background: #0073aa;
    color: white;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    position: relative;
    min-height: 60px;
    flex-shrink: 0;
}

.ldcb-chat-header h3 {
    margin: 0 0 0 15px;
    font-size: 18px;
    color: white;
    flex-grow: 1;
}

.ldcb-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.ldcb-minimize {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    margin-left: auto;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.ldcb-minimize:hover {
    opacity: 1;
}

.ldcb-minimize-icon {
    position: relative;
    width: 12px;
    height: 2px;
    background-color: #fff;
    transition: transform 0.3s ease;
}

.minimized .ldcb-minimize-icon {
    transform: rotate(180deg);
}

.ldcb-minimize-icon:before {
    content: '';
    position: absolute;
    width: 12px;
    height: 2px;
    background-color: #fff;
    top: -4px;
    left: 0;
}

.ldcb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: calc(100% - 140px);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

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

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

.ldcb-chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.ldcb-message {
    margin-bottom: 0;
    max-width: 80%;
    animation: messageAppear 0.3s ease-out;
}

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

.ldcb-bot {
    margin-right: auto;
}

.ldcb-user {
    margin-left: auto;
    text-align: right;
}

.ldcb-message p {
    margin: 0;
    padding: 12px 18px;
    border-radius: 18px;
    display: inline-block;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.ldcb-bot p {
    background: white;
    border: 1px solid #e0e0e0;
}

.ldcb-user p {
    background: #0073aa;
    color: white;
}

.ldcb-chat-input {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 0 0 10px 10px;
    flex-shrink: 0;
}

.ldcb-chat-input textarea {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 15px;
    margin-right: 10px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    max-height: 100px;
    min-height: 38px;
}

.ldcb-send {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    white-space: nowrap;
}

.ldcb-send:hover {
    background: #005177;
}

/* Typing indicator */
.ldcb-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ldcb-typing-dot {
    width: 4px;
    height: 4px;
    background: #666;
    border-radius: 50%;
    opacity: 0.3;
    animation: typing-dot 1.4s infinite;
}

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

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

@keyframes typing-dot {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Message content */
.ldcb-message-content {
    line-height: 1.5;
}

.ldcb-message-content a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

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

/* Minimized state */
.ldcb-chatbot-container.minimized {
    height: auto;
    width: auto;
    min-width: 60px;
    border-radius: 50%;
    overflow: hidden;
}

.ldcb-chatbot-container.minimized .ldcb-chat-messages,
.ldcb-chatbot-container.minimized .ldcb-chat-input {
    display: none;
}

.ldcb-chatbot-container.minimized .ldcb-chat-header {
    padding: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
}

.ldcb-chatbot-container.minimized .ldcb-chat-header h3 {
    display: none;
}

.ldcb-chatbot-container.minimized .ldcb-avatar {
    margin: 5px;
    width: 50px;
    height: 50px;
}

.ldcb-chatbot-container.minimized .ldcb-minimize {
    display: none;
}

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

    .ldcb-chat-header {
        border-radius: 0;
    }
    
    .ldcb-avatar {
        width: 40px;
        height: 40px;
    }

    .ldcb-chat-messages {
        height: calc(100% - 120px);
    }
}
