/**
 * Oelewunder doTERRA Chatbot - Clean Modern Design
 */

:root {
    --chatbot-primary: #5d4e8c;
    --chatbot-primary-dark: #4a3d70;
    --chatbot-bg: #ffffff;
    --chatbot-text: #333333;
    --chatbot-border: #e0e0e0;
}

/* Widget Container */
.chatbot-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.chatbot-bottom-right {
    bottom: 24px;
    right: 24px;
}

.chatbot-bottom-left {
    bottom: 24px;
    left: 24px;
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5d4e8c 0%, #7c6aab 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(93, 78, 140, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(93, 78, 140, 0.5);
}

.chatbot-toggle .chatbot-icon-close {
    display: none;
}

.chatbot-toggle.is-open .chatbot-icon-chat {
    display: none;
}

.chatbot-toggle.is-open .chatbot-icon-close {
    display: block;
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 75px;
    width: 370px;
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--chatbot-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.chatbot-bottom-right .chatbot-window {
    right: 0;
}

.chatbot-bottom-left .chatbot-window {
    left: 0;
}

.chatbot-window.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #5d4e8c 0%, #7c6aab 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-title {
    font-weight: 600;
    font-size: 15px;
}

.chatbot-subtitle {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-subtitle::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
}

.chatbot-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
}

.chatbot-close:hover {
    background: rgba(255,255,255,0.25);
}

/* Disclaimer */
.chatbot-disclaimer {
    background: #fef3c7;
    color: #92400e;
    padding: 10px 14px;
    font-size: 11px;
    border-bottom: 1px solid #fde68a;
}

.chatbot-disclaimer:empty {
    display: none;
}

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fafafa;
}

.chatbot-message {
    display: flex;
    max-width: 85%;
}

.chatbot-message-user {
    align-self: flex-end;
}

.chatbot-message-bot {
    align-self: flex-start;
}

.chatbot-message-content {
    padding: 11px 15px;
    border-radius: 16px;
    word-wrap: break-word;
    line-height: 1.5;
}

.chatbot-message-user .chatbot-message-content {
    background: linear-gradient(135deg, #5d4e8c 0%, #7c6aab 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-message-bot .chatbot-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.chatbot-message-content a {
    color: #5d4e8c;
    text-decoration: underline;
}

.chatbot-message-user .chatbot-message-content a {
    color: white;
}

.chatbot-message-content .disclaimer {
    display: block;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 11px;
    opacity: 0.7;
}

/* Typing */
.chatbot-typing .typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.chatbot-typing .typing-dots span {
    width: 8px;
    height: 8px;
    background: #5d4e8c;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.chatbot-typing .typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.chatbot-typing .typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input */
.chatbot-input-wrapper {
    padding: 12px;
    border-top: 1px solid #eee;
    background: white;
}

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

.chatbot-input {
    flex: 1;
    padding: 11px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #5d4e8c;
}

.chatbot-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5d4e8c 0%, #7c6aab 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s;
}

.chatbot-send:hover {
    transform: scale(1.05);
}

/* Mobile */
@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 16px;
        right: 16px;
    }
    
    .chatbot-toggle {
        width: 56px;
        height: 56px;
    }
    
    .chatbot-window {
        position: fixed;
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 85px;
        right: 16px;
        left: 16px;
    }
}

/* Scrollbar */
.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

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

/* Emoji Icons */
.chatbot-toggle .chatbot-icon-chat,
.chatbot-toggle .chatbot-icon-close {
    font-size: 26px;
    line-height: 1;
}

.chatbot-toggle .chatbot-icon-close {
    font-size: 24px;
    font-weight: bold;
    font-style: normal;
}

/* Send Button Icon */
.chatbot-send {
    font-size: 20px;
    color: white;
    padding-left: 2px;
}

/* Product Cards */
.chatbot-products {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.chatbot-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chatbot-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.chatbot-product-image {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f5f5f5;
}

.chatbot-product-info {
    flex: 1;
    min-width: 0;
}

.chatbot-product-title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin: 0 0 4px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chatbot-product-price {
    font-size: 14px;
    color: #5d4e8c;
    font-weight: 700;
    margin: 0;
}

.chatbot-product-price::before {
    content: "ab ";
    font-weight: 400;
    font-size: 12px;
}

.chatbot-product-btn {
    background: linear-gradient(135deg, #5d4e8c 0%, #7c6aab 100%);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s;
}

.chatbot-product-btn:hover {
    transform: scale(1.05);
}

/* Mobile adjustments for cards */
@media (max-width: 480px) {
    .chatbot-product-card {
        padding: 8px;
        gap: 10px;
    }
    
    .chatbot-product-image {
        width: 60px;
        height: 60px;
    }
    
    .chatbot-product-title {
        font-size: 12px;
    }
    
    .chatbot-product-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Operator Footer */
.chatbot-footer {
    padding: 8px 15px;
    font-size: 11px;
    color: #888;
    text-align: center;
    border-top: 1px solid #eee;
    background: #fafafa;
}
.chatbot-footer strong {
    color: #666;
}

