/* أنماط المحادثة */
.chat-icon {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background-color: #4e54c8;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

.chat-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.chat-icon i {
    font-size: 28px;
}

.chat-box {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.chat-box.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.chat-header {
    background: linear-gradient(135deg, #4e54c8, #8f94fb);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f5f7fb;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.message.sent {
    background: #4e54c8;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.message.received {
    background: #e3e5eb;
    color: #000;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.chat-footer {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    text-align: center;
}

.contact-team-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.contact-team-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.contact-team-btn i {
    font-size: 16px;
}

.notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    animation: slideUp 0.3s ease-out;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.notification.success {
    background-color: #4CAF50;
}

.notification.error {
    background-color: #f44336;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.chat-input {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    transition: border-color 0.3s;
}

.chat-input input:focus {
    border-color: #4e54c8;
}

.send-button {
    background: #4e54c8;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:hover {
    background: #3a3f9e;
}

/* مؤشر الكتابة */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 15px;
    background: #e3e5eb;
    border-radius: 18px;
    align-self: flex-start;
    margin-bottom: 15px;
}

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

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

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* التجاوب مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .chat-box {
        width: 90%;
        left: 5%;
        height: 70vh;
        bottom: 20px;
    }
    
    .chat-icon {
        left: 20px;
        bottom: 20px;
        width: 50px;
        height: 50px;
    }
    
    .chat-icon i {
        font-size: 24px;
    }
    
    .message {
        max-width: 90%;
    }
}
