/* ── Wrapper ─────────────────────────────────────────────────── */
#pdfp-chatbot-wrapper {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Attention Grabbing Pulse Animation ──────────────────────── */
@keyframes pdfp-pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 88, 233, 0.6), 0 4px 16px rgba(56, 88, 233, 0.22);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(56, 88, 233, 0), 0 4px 16px rgba(56, 88, 233, 0.22);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(56, 88, 233, 0), 0 4px 16px rgba(56, 88, 233, 0.22);
    }
}

/* ── Toggle Button ───────────────────────────────────────────── */
#pdfp-chatbot-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3858E9, #5472f7);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pdfp-pulse-glow 2s infinite;
}
#pdfp-chatbot-toggle:hover {
    background: linear-gradient(135deg, #2a49db, #3858E9);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(56, 88, 233, 0.4);
}
#pdfp-chatbot-toggle.pdfp-active {
    background: #1e293b;
    transform: rotate(90deg) scale(0.95);
    animation: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ── Chat Window ─────────────────────────────────────────────── */
#pdfp-chatbot-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 360px;
    height: 520px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}
#pdfp-chatbot-window.pdfp-open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/* ── Header ──────────────────────────────────────────────────── */
#pdfp-chatbot-header {
    background: linear-gradient(135deg, #3858E9, #5472f7);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
#pdfp-chatbot-header::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}
#pdfp-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}
#pdfp-chatbot-avatar {
    font-size: 24px;
    line-height: 1;
}
#pdfp-chatbot-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    letter-spacing: -0.2px;
}
#pdfp-chatbot-subtitle {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
    font-weight: 500;
}
#pdfp-chatbot-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.15s;
    line-height: 1;
    position: relative;
    z-index: 1;
}
#pdfp-chatbot-close:hover { opacity: 1; }

/* ── Messages ────────────────────────────────────────────────── */
#pdfp-chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.pdfp-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}
.pdfp-msg a {
    color: #3858E9;
    text-decoration: underline;
    font-weight: 500;
}
.pdfp-msg a:hover {
    color: #2a49db;
}
.pdfp-msg code {
    background: rgba(56, 88, 233, 0.08);
    color: #3858E9;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 12px;
    font-family: monospace;
}
.pdfp-msg--user {
    background: linear-gradient(135deg, #3858E9, #5472f7);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(56, 88, 233, 0.2);
}
.pdfp-msg--bot {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid rgba(226, 232, 240, 0.8);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ── Typing Indicator ────────────────────────────────────────── */
.pdfp-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}
.pdfp-typing span {
    width: 6px;
    height: 6px;
    background: #3858E9;
    border-radius: 50%;
    display: inline-block;
    animation: pdfp-bounce 1.2s infinite ease-in-out;
    opacity: 0.6;
}
.pdfp-typing span:nth-child(2) { animation-delay: 0.2s; }
.pdfp-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pdfp-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%           { transform: scale(1);   opacity: 1;   }
}

/* ── Feedback ────────────────────────────────────────────────── */
.pdfp-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}
.pdfp-fb-btn {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 1);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pdfp-fb-btn:hover {
    background: #f1f5f9;
    border-color: rgba(203, 213, 225, 1);
}
.pdfp-fb-thanks {
    font-size: 11px;
    color: #3858E9;
    font-weight: 600;
}

/* ── Suggestion Chips ────────────────────────────────────────── */
#pdfp-chatbot-suggestions {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    flex-shrink: 0;
}
.pdfp-suggestion-chip {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 1);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: #3858E9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}
.pdfp-suggestion-chip:hover {
    background: #3858E9;
    color: #ffffff;
    border-color: #3858E9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(56, 88, 233, 0.15);
}

/* ── Input Area ──────────────────────────────────────────────── */
#pdfp-chatbot-input-area {
    display: flex;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    padding: 12px;
    gap: 8px;
    background: #ffffff;
    flex-shrink: 0;
    align-items: center;
}
#pdfp-chatbot-input {
    flex: 1;
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
    background: #f8fafc;
    color: #1e293b;
}
#pdfp-chatbot-input:focus {
    border-color: #3858E9;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(56, 88, 233, 0.15);
}
#pdfp-chatbot-send {
    background: linear-gradient(135deg, #3858E9, #5472f7);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(56, 88, 233, 0.2);
}
#pdfp-chatbot-send:hover {
    background: linear-gradient(135deg, #2a49db, #3858E9);
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(56, 88, 233, 0.3);
}

/* ── Pro Feature Upgrade Call-to-Action ──────────────────────── */
.pdfp-pro-cta {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(56, 88, 233, 0.06);
    border: 1px solid rgba(56, 88, 233, 0.18);
    font-size: 13px;
    line-height: 1.5;
}
.pdfp-pro-cta a {
    font-weight: 600;
    white-space: nowrap;
}
