/* Chatbot Styles */
.chatbot-toggle {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow: visible;
    margin-bottom: 0;
    padding-bottom: 0;
}

[dir="rtl"] .chatbot-toggle {
    right: auto;
    left: 30px;
}

.chatbot-toggle:hover {
    background: var(--accent-dark);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

.chatbot-toggle.active {
    display: none;
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: var(--accent-color);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid #ffffff;
}

[dir="rtl"] .chatbot-badge {
    right: auto;
    left: -5px;
}

.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0;
    padding-bottom: 0;
}

[dir="rtl"] .chatbot-container {
    right: auto;
    left: 30px;
}

.chatbot-container.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.chatbot-container.minimized {
    height: 60px;
}

.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.chatbot-info {
    flex: 1;
    min-width: 0;
}

.chatbot-name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #ffffff;
    line-height: 1.2;
}

.chatbot-status {
    font-size: 12px;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.chatbot-minimize,
.chatbot-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-minimize:hover,
.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f9fafb;
    min-height: 0;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.chatbot-message {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 75%;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message-bot {
    align-self: flex-start;
}

.chatbot-message-user {
    align-self: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
}

.chatbot-message-bot .message-content {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.chatbot-message-user .message-content {
    background: var(--primary-color);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

[dir="ltr"] .chatbot-message-bot .message-content {
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}

[dir="ltr"] .chatbot-message-user .message-content {
    border-bottom-right-radius: 18px;
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin: 0;
    word-wrap: break-word;
}

.message-time {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
    padding: 0 4px;
}

.chatbot-message-user .message-time {
    text-align: right;
}

[dir="ltr"] .chatbot-message-user .message-time {
    text-align: left;
}

.chatbot-input-container {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 15px;
    flex-shrink: 0;
}

.chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.quick-reply-btn {
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.chatbot-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.chatbot-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(11, 106, 50, 0.1);
}

.chatbot-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
    font-family: inherit;
    padding: 4px 8px;
}

.chatbot-input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.chatbot-send {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: var(--primary-dark);
    transform: scale(1.1) rotate(15deg);
}

.chatbot-send:active {
    transform: scale(0.95) rotate(15deg);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .chatbot-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 0;
        top: 0;
    }

    [dir="rtl"] .chatbot-container {
        left: 0;
        right: 0;
    }

    .chatbot-toggle {
        bottom: 100px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 22px;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    [dir="rtl"] .chatbot-toggle {
        right: auto;
        left: 20px;
    }
}

@media (max-width: 480px) {
    .chatbot-toggle {
        bottom: 90px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    [dir="rtl"] .chatbot-toggle {
        right: auto;
        left: 15px;
    }

    .chatbot-header {
        padding: 15px;
    }

    .chatbot-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .chatbot-name {
        font-size: 15px;
    }

    .chatbot-messages {
        padding: 15px;
    }
}

