/* =================================================================
   RS PROD AND EVENTS - Chatbot Styles
   أنماط الشات بوت
   ================================================================= */

.rs-chatbot {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: inherit;
}

[dir="rtl"] .rs-chatbot {
    right: auto;
    left: 30px;
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-gold), var(--light-gold));
    border: none;
    color: var(--rich-black);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.5);
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.7);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Chatbot Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: rgba(26, 26, 26, 0.98);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(212, 175, 55, 0.2);
    border: 2px solid rgba(212, 175, 55, 0.3);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[dir="rtl"] .chatbot-window {
    right: auto;
    left: 0;
}

.rs-chatbot.active .chatbot-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.rs-chatbot.active .chatbot-toggle {
    transform: rotate(90deg);
}

/* Header */
.chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(26, 26, 26, 0.95));
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 20px 20px 0 0;
}

.chatbot-header-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-gold);
}

.chatbot-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-white);
    margin: 0;
}

.chatbot-status {
    font-size: 0.8rem;
    color: var(--primary-gold);
}

.chatbot-close {
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px;
}

.chatbot-close:hover {
    color: var(--primary-gold);
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.05);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* Message */
.chatbot-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.user {
    align-items: flex-end;
}

.chatbot-message.bot {
    align-items: flex-start;
}

.message-content {
    background: rgba(212, 175, 55, 0.15);
    padding: 12px 16px;
    border-radius: 15px;
    max-width: 75%;
    word-wrap: break-word;
    color: var(--text-white);
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-line;
}

.chatbot-message.user .message-content {
    background: linear-gradient(135deg, var(--primary-gold), var(--light-gold));
    color: var(--rich-black);
    border-bottom-right-radius: 3px;
}

[dir="rtl"] .chatbot-message.user .message-content {
    border-bottom-right-radius: 15px;
    border-bottom-left-radius: 3px;
}

.chatbot-message.bot .message-content {
    border-bottom-left-radius: 3px;
}

[dir="rtl"] .chatbot-message.bot .message-content {
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 3px;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-gray);
    margin-top: 5px;
    padding: 0 5px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 15px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-gold);
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Quick Replies */
.chatbot-quick-replies {
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.quick-reply-btn {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--primary-gold);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--primary-gold);
    transform: translateY(-2px);
}

/* Input Area */
.chatbot-input {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    background: rgba(10, 10, 10, 0.5);
}

.chatbot-input input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 25px;
    padding: 12px 20px;
    color: var(--text-white);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.chatbot-input input:focus {
    border-color: var(--primary-gold);
    background: rgba(255, 255, 255, 0.08);
}

.chatbot-input input::placeholder {
    color: var(--text-gray);
}

.chatbot-input button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-gold), var(--light-gold));
    border: none;
    color: var(--rich-black);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-input button:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.5);
}

.chatbot-input button:active {
    transform: scale(0.95);
}

/* Footer */
.chatbot-footer {
    padding: 10px 20px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-gray);
    background: rgba(10, 10, 10, 0.5);
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 0 0 20px 20px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .rs-chatbot {
        bottom: 20px;
        right: 20px;
    }
    
    [dir="rtl"] .rs-chatbot {
        right: auto;
        left: 20px;
    }
    
    .chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 150px);
        bottom: 80px;
        right: -20px;
    }
    
    [dir="rtl"] .chatbot-window {
        right: auto;
        left: -20px;
    }
    
    .chatbot-toggle {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .message-content {
        max-width: 85%;
        font-size: 0.9rem;
    }
    
    .quick-reply-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* Tablet */
@media (max-width: 768px) and (min-width: 481px) {
    .chatbot-window {
        width: 350px;
        height: 550px;
    }
}

/* Accessibility */
.chatbot-toggle:focus,
.chatbot-input button:focus,
.quick-reply-btn:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}
