/**
 * Chatbot Styles for واتش اب
 */

/* ===== Chatbot Container ===== */
.watchapp-chatbot {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    font-family: 'Cairo', sans-serif;
}

[dir="rtl"] .watchapp-chatbot {
    left: auto;
    right: 20px;
}

/* ===== Toggle Button ===== */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(233, 30, 99, 0.6);
}

.chatbot-toggle.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}

.chatbot-toggle i {
    font-size: 28px;
    color: #fff;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ===== Chat Window ===== */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 380px;
    height: 550px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s ease;
}

[dir="rtl"] .chatbot-window {
    left: auto;
    right: 0;
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ===== Chat Header ===== */
.chatbot-header {
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    color: #fff;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-avatar i {
    font-size: 24px;
}

.chatbot-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    display: inline-block;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ===== Messages Area ===== */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #e91e63;
    border-radius: 10px;
}

/* ===== Chat Message ===== */
.chat-message {
    display: flex;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    color: #fff;
}

.user-message .message-avatar {
    background: #2196f3;
    color: #fff;
    order: 2;
}

.user-message {
    flex-direction: row-reverse;
}

.message-content {
    max-width: 70%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message-content p {
    background: #fff;
    padding: 12px 16px;
    border-radius: 15px;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.user-message .message-content p {
    background: #e91e63;
    color: #fff;
    border-radius: 15px 15px 0 15px;
}

.bot-message .message-content p {
    border-radius: 15px 15px 15px 0;
}

.message-time {
    font-size: 11px;
    color: #999;
    padding: 0 5px;
}

/* ===== Typing Indicator ===== */
.typing-indicator {
    align-items: center;
}

.typing-dots {
    background: #fff;
    padding: 12px 20px;
    border-radius: 15px 15px 15px 0;
    display: flex;
    gap: 5px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #e91e63;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* ===== Quick Replies ===== */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-reply {
    background: #fff;
    border: 2px solid #e91e63;
    color: #e91e63;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.quick-reply:hover {
    background: #e91e63;
    color: #fff;
    transform: translateY(-2px);
}

/* ===== Input Area ===== */
.chatbot-input {
    padding: 15px 20px;
    background: #fff;
    border-radius: 0 0 20px 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #eee;
}

#chatbot-input-field {
    flex: 1;
    border: 2px solid #eee;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
}

#chatbot-input-field:focus {
    outline: none;
    border-color: #e91e63;
}

#chatbot-send {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
    
    [dir="rtl"] .chatbot-window {
        left: 10px;
        right: 10px;
    }
}
