/* chatbot.css - Luxury AI Chatbot Styling */
.chatbot-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
}

.chatbot-btn {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #ff4e00, #cc1100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(255, 78, 0, 0.4);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 2px solid rgba(255,255,255,0.2);
}

.chatbot-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 12px 40px rgba(255, 78, 0, 0.6);
}

.chatbot-btn .badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: white;
    color: #cc1100;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 900;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.chatbot-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 380px;
    height: 550px;
    background: #0f1218;
    border-radius: 24px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    transition: 0.3s;
    transform-origin: bottom right;
}

.chatbot-window.active {
    display: flex;
    animation: slideUp 0.4s ease;
}

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

.chatbot-header {
    padding: 1.25rem;
    background: linear-gradient(90deg, #1c110c, #320a05);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent, #ff4e00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 2px solid rgba(255,255,255,0.2);
}

.bot-status-info h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.bot-status-info span {
    font-size: 0.75rem;
    color: #22c55e;
    display: flex;
    align-items: center;
    gap: 4px;
}

.bot-status-info span::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
}

.chatbot-messages {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.msg {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.msg-bot {
    background: rgba(255,255,255,0.05);
    color: #e5e7eb;
    align-self: flex-start;
    border-bottom-right-radius: 4px;
}

.msg-user {
    background: #ff4e00;
    color: white;
    align-self: flex-end;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(255, 78, 0, 0.2);
}

.chatbot-input-area {
    padding: 1.25rem;
    background: rgba(0,0,0,0.2);
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.chatbot-input-area input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px 15px;
    color: white;
    outline: none;
    transition: 0.3s;
}

.chatbot-input-area input:focus {
    border-color: #ff4e00;
    background: rgba(255,255,255,0.08);
}

.chatbot-send-btn {
    width: 42px;
    height: 42px;
    background: #ff4e00;
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

.chatbot-send-btn:hover {
    background: #cc1100;
    transform: scale(1.05);
}

/* AI Product Card within chat */
.ai-product-card {
    background: #1c110c;
    border: 1px solid rgba(255, 78, 0, 0.2);
    border-radius: 15px;
    overflow: hidden;
    margin-top: 10px;
    width: 240px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.ai-product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.ai-p-info {
    padding: 12px;
}

.ai-p-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-p-price {
    color: #ff4e00;
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.ai-add-btn {
    width: 100%;
    background: #ff4e00;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.ai-add-btn:hover {
    background: #cc1100;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    width: fit-content;
}

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

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

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@media (max-width: 480px) {
    .chatbot-window {
        width: 320px;
        height: 500px;
        bottom: 80px;
        right: -10px;
    }
}

/* Mobile: keep chatbot below the more-sheet (z-index 9989) and bottom bar (9990) */
@media (max-width: 768px) {
    .chatbot-wrapper {
        z-index: 9988;
        bottom: 80px;
    }
}
