/* --- AI Chatbot Styles --- */
.ai-chatbot-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    right: auto;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.chatbot-toggle {
    background: linear-gradient(135deg, var(--accent), #b45309);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(217, 119, 6, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.chatbot-toggle:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 30px rgba(217, 119, 6, 0.5);
}

.chatbot-toggle-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-label {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.chatbot-window {
    width: 380px;
    height: 550px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: all 0.4s ease;
    transform-origin: bottom left;
}

.chatbot-window.hidden {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
}

@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        height: 60vh;
        left: 20px;
        bottom: 90px;
    }
}

.chatbot-header {
    background: linear-gradient(135deg, var(--navy-secondary, #1e293b), var(--accent));
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: white;
    color: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chatbot-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.online-status {
    font-size: 0.75rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.online-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #25d366;
    border-radius: 50%;
    display: inline-block;
}

.close-chatbot {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-chatbot:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.4);
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.bot-message {
    align-self: flex-start;
    background: white;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-message {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-typing {
    padding: 10px;
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 4px;
    height: 4px;
    background: #64748b;
    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%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    50% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

.chatbot-input-area {
    padding: 15px;
    background: white;
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

#chatbot-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 10px;
    outline: none;
    font-size: 0.9rem;
}

#chatbot-input:focus {
    border-color: var(--accent);
}

#send-chat {
    background: var(--accent);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rtl .ai-chatbot-container {
    left: auto;
    right: 30px;
    align-items: flex-end;
}

.rtl .chatbot-toggle {
    flex-direction: row-reverse;
}

.rtl .chatbot-header-info {
    flex-direction: row-reverse;
}

/* Chatbot Link and Action Styles */
.chatbot-link {
    color: var(--accent);
    text-decoration: underline;
    font-weight: 600;
}

.item-number-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.chatbot-item-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid rgba(217, 119, 6, 0.3);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    margin-top: 5px;
    text-decoration: none;
    background: linear-gradient(to right, rgba(217, 119, 6, 0.05), rgba(217, 119, 6, 0.1));
}

.chatbot-item-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.chatbot-item-btn i {
    width: 16px;
    height: 16px;
}

.copy-item-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-item-num:hover {
    background: var(--navy-secondary);
    color: white;
    border-color: var(--navy-secondary);
}

.copy-item-num i {
    width: 14px;
    height: 14px;
}

/* Suggestions Chips */
.chatbot-suggestions {
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
    justify-content: center;
    /* Center align like premium apps */
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    animation: fadeIn 0.4s ease;
}

.suggestion-chip {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    /* Full pill shape */
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: #fff;
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
}

.suggestion-chip:active {
    transform: translateY(0);
}

/* RTL Support for suggestions */
.rtl .chatbot-suggestions {
    flex-direction: row-reverse;
}