/**
 * Chatbot Widget Styles
 * أنماط ويدجت الشات بوت
 */

/* Chatbot Widget Container */
.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    z-index: 9999;
    font-family: 'Cairo', 'Inter', sans-serif;
}

/* Chatbot Button */
.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chatbot-button.chatbot-active {
    background: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chatbot Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    left: auto;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.chatbot-window.chatbot-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.chatbot-header-content i {
    font-size: 20px;
}

.chatbot-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    transition: transform 0.2s ease;
}

.chatbot-close:hover {
    transform: rotate(90deg);
}

/* Chatbot Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8f9fa;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Chatbot Message */
.chatbot-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.chatbot-user {
    flex-direction: row-reverse;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.chatbot-bot .chatbot-avatar {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
}

.chatbot-user .chatbot-avatar {
    background: #e9ecef;
    color: #495057;
}

.chatbot-text {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chatbot-bot .chatbot-text {
    background: white;
    color: #333;
    border-top-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chatbot-user .chatbot-text {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    border-top-right-radius: 4px;
}

/* Typing Indicator */
.chatbot-typing .chatbot-text {
    background: white;
    padding: 12px 20px;
}

.typing-dots {
    display: inline-flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1a365d;
    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);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chatbot Input Container */
.chatbot-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chatbot-input:focus {
    border-color: #1a365d;
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.1);
}

.chatbot-send:active {
    transform: scale(0.95);
}

/* RTL Support - Keep on right side even in RTL */
[dir="rtl"] .chatbot-widget {
    right: 20px;
    left: auto;
}

[dir="rtl"] .chatbot-window {
    right: 0;
    left: auto;
}

[dir="rtl"] .chatbot-message.chatbot-user {
    flex-direction: row;
}

[dir="rtl"] .chatbot-bot .chatbot-text {
    border-top-left-radius: 12px;
    border-top-right-radius: 4px;
}

[dir="rtl"] .chatbot-user .chatbot-text {
    border-top-right-radius: 12px;
    border-top-left-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 90px;
        right: 10px;
        left: 10px;
        max-width: none;
        max-height: none;
    }
    
    [dir="rtl"] .chatbot-window {
        right: 10px;
        left: 10px;
    }
    
    .chatbot-button {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
}

