﻿/* chatbot.css - التصميم الكامل للبوت الذكي - نسخة معدلة مع خط كبير وغامق أثناء الكتابة فقط */

/* ⭐⭐ الحاوية الرئيسية ⭐⭐ */
.floating-chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    direction: rtl;
    transition: all 0.3s ease !important;
}

/* ⭐⭐ كلمة "المساعد الذكي" ⭐⭐ */
.assistant-label {
    position: absolute;
    bottom: 90px;
    right: 0;
    background: #1976D2;
    color: white;
    padding: 10px 25px;
    border-radius: 40px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(25, 118, 210, 0.3);
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: all 0.3s ease;
}

.assistant-label:hover {
    background: #1565C0;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(25, 118, 210, 0.4);
}

/* ⭐⭐ أيقونة البوت الرئيسية ⭐⭐ */
.chatbot-icon {
    position: relative;
    width: 70px;
    height: 70px;
    background: #1976D2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(25, 118, 210, 0.3);
    transition: all 0.3s ease;
    z-index: 10000;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(25, 118, 210, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(25, 118, 210, 0);
    }
}

.chatbot-icon i {
    color: white;
    font-size: 2.2rem;
    transition: all 0.3s ease;
}

.chatbot-icon:hover {
    transform: scale(1.1) rotate(5deg);
    background: #1565C0;
    box-shadow: 0 6px 25px rgba(25, 118, 210, 0.4);
}

/* ⭐⭐ نافذة المحادثة ⭐⭐ */
.chatbot-window {
    position: absolute;
    bottom: 100px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    direction: rtl;
    z-index: 10001;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ⭐⭐ رأس النافذة ⭐⭐ */
.chatbot-header {
    background: #1976D2;
    color: white;
    padding: 15px 20px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-avatar i {
    font-size: 1.8rem;
    color: white;
}

.header-info {
    flex: 1;
}

.header-info h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
}

.header-info p {
    margin: 5px 0 0;
    font-size: 0.85rem;
    opacity: 0.9;
    font-family: 'Tajawal', sans-serif;
}

.header-actions .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.header-actions .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ⭐⭐ منطقة الرسائل ⭐⭐ */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ⭐⭐ الرسائل ⭐⭐ */
.message {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    animation: messageAppear 0.3s ease-out;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    flex-direction: row-reverse;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.user-avatar {
    background: #1976D2;
    color: white;
}

.bot-avatar {
    background: #e9ecef;
    color: #1976D2;
}

.message-bubble {
    max-width: 75%;
    padding: 12px 15px;
    border-radius: 15px;
    position: relative;
    word-wrap: break-word;
}

.user-bubble {
    background: #1976D2;
    color: white;
    border-bottom-left-radius: 5px;
}

.bot-bubble {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-right-radius: 5px;
}

.message-text {
    font-size: 1rem;
    line-height: 1.5;
    font-family: 'Tajawal', sans-serif;
}

.message-time {
    font-size: 0.7rem;
    margin-top: 5px;
    opacity: 0.7;
    text-align: left;
}

/* ⭐⭐ منطقة الإدخال مع خط أكبر وغامق أثناء الكتابة فقط ⭐⭐ */
.chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e9ecef;
    border-radius: 30px;
    resize: none;
    font-family: 'Tajawal', sans-serif;
    font-size: 1.3rem !important;  /* خط أكبر أثناء الكتابة */
    font-weight: bold !important;    /* خط غامق أثناء الكتابة */
    outline: none;
    transition: all 0.3s ease;
    max-height: 100px;
    min-height: 45px;
}

.chat-input:focus {
    border-color: #1976D2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

/* ⭐⭐ زر الإرسال ⭐⭐ */
.send-btn {
    width: 45px;
    height: 45px;
    background: #1976D2;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #1565C0;
    transform: scale(1.1);
}

.send-btn i {
    font-size: 1.2rem;
}

/* ⭐⭐ مؤشر الكتابة ⭐⭐ */
.typing-indicator .typing-dots {
    display: flex;
    gap: 4px;
    padding: 5px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #1976D2;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.6;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ⭐⭐ تحسينات للشاشات الصغيرة ⭐⭐ */
@media (max-width: 480px) {
    .floating-chatbot-container {
        bottom: 20px;
        right: 20px;
    }
    
    .assistant-label {
        font-size: 0.9rem;
        padding: 8px 16px;
        bottom: 80px;
    }
    
    .chatbot-icon {
        width: 60px;
        height: 60px;
    }
    
    .chatbot-icon i {
        font-size: 1.8rem;
    }
    
    .chatbot-window {
        width: 340px;
        height: 450px;
        bottom: 90px;
    }
    
    /* تصغير الخط قليلاً في الشاشات الصغيرة مع بقائه غامق */
    .chat-input {
        font-size: 1.2rem !important;
    }
}

/* ⭐⭐ تأثيرات إضافية ⭐⭐ */
.assistant-label-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(10px) !important;
}