/* Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 110px;
    z-index: 998;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(139, 21, 56, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: var(--transition);
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 35px rgba(139, 21, 56, 0.6);
}

.chatbot-toggle .fa-times {
    display: none;
}

.chatbot-toggle.active .fa-comments {
    display: none;
}

.chatbot-toggle.active .fa-times {
    display: block;
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 20%;
    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);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.chatbot-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 360px;
    height: 500px;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.chatbot-window.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 20px;
}

.chatbot-header-text h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chatbot-header-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    margin-right: 5px;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    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: var(--primary-color);
    border-radius: 3px;
}

.chat-message {
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.bot {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 16px;
    flex-shrink: 0;
}

.chat-message.user .message-avatar {
    background: var(--accent-color);
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.chat-message.bot .message-content {
    background: var(--white);
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chat-message.user .message-content {
    background: var(--primary-color);
    color: var(--white);
    border-bottom-right-radius: 5px;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-reply-btn {
    background: var(--white);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.quick-reply-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

.chatbot-input-area {
    padding: 15px;
    background: var(--white);
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chatbot-send-btn {
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
}

.chatbot-send-btn:hover {
    background: var(--accent-color);
    transform: scale(1.05);
}

.chatbot-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: var(--white);
    border-radius: 15px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.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(-10px);
    }
}

/* RTL Support */
[dir="rtl"] .chatbot-container {
    right: auto;
    left: 110px;
}

[dir="rtl"] .chat-message.bot {
    align-self: flex-end;
}

[dir="rtl"] .chat-message.user {
    align-self: flex-start;
}

[dir="rtl"] .chat-message.bot .message-content {
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 5px;
}

[dir="rtl"] .chat-message.user .message-content {
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 15px;
}

[dir="rtl"] .chatbot-window {
    right: auto;
    left: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 100px;
        right: 15px;
        left: auto;
    }
    
    [dir="rtl"] .chatbot-container {
        right: auto;
        left: 15px;
    }

    .chatbot-window {
        width: calc(100vw - 40px);
        height: 450px;
        right: 0;
        left: auto;
    }
    
    [dir="rtl"] .chatbot-window {
        right: auto;
        left: 0;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: 400px;
    }
}

