/* ===============================================
   LHG Chatbot Widget - Liviat Chen Jewelry
   =============================================== */

/* Chat Button (Floating) */
.chatbot-toggle {
    position: fixed;
    bottom: 100px;
    left: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.5);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    fill: white;
}

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

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

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

/* Chat Container */
.chatbot-container {
    position: fixed;
    bottom: 180px;
    left: 25px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 220px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Heebo', sans-serif;
}

.chatbot-container.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

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

.chatbot-header .info p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-header .status-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    display: inline-block;
    margin-left: 6px;
}

.chatbot-header .status-dot.offline {
    background: #ff9800;
}

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

/* Message Bubbles */
.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

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

.chat-message.bot {
    background: white;
    color: #333;
    align-self: flex-start;
    border-bottom-right-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-message.user {
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    color: white;
    align-self: flex-end;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #D4AF37;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

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

/* Quick Reply Buttons */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.quick-reply-btn {
    background: white;
    border: 2px solid #D4AF37;
    color: #B8941F;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Heebo', sans-serif;
}

.quick-reply-btn:hover {
    background: #D4AF37;
    color: white;
}

/* Chat Input Area */
.chatbot-input {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 14px;
    font-family: 'Heebo', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

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

.chatbot-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

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

.chatbot-input button svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* RTL: Flip send button arrow for Hebrew */
[dir="rtl"] .chatbot-input button svg {
    transform: scaleX(-1);
}

/* Inquiry Form (inside chat) */
.inquiry-form {
    background: white;
    padding: 12px;
    border-radius: 12px;
    margin-top: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.inquiry-form input,
.inquiry-form textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: 'Heebo', sans-serif;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.inquiry-form textarea {
    resize: none;
    height: 60px;
}

.inquiry-form button {
    width: 100%;
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Heebo', sans-serif;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-container {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
        border-radius: 16px 16px 0 0;
    }

    .chatbot-toggle {
        bottom: 80px;
        left: 15px;
        width: 55px;
        height: 55px;
    }
}
