@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

/* ── Trigger ── */
.bokrr-chat-trigger {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16,1,0.3,1),
                transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.bokrr-chat-trigger.visible {
    opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
.bokrr-chat-trigger.hidden {
    opacity: 0; transform: translateY(20px) scale(0.9); pointer-events: none;
}

.bokrr-chat-label {
    background: #1a1a1a;
    color: #fff;
    padding: 10px 18px;
    border-radius: 24px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    animation: bokrrLabelPulse 3s ease-in-out infinite;
    position: relative;
}
.bokrr-chat-label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #1a1a1a;
}
@keyframes bokrrLabelPulse {
    0%,100% { box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
    50%      { box-shadow: 0 4px 28px rgba(0,0,0,0.28); }
}

.bokrr-chat-btn {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a, #333);
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s;
    flex-shrink: 0;
}
.bokrr-chat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 30px rgba(0,0,0,0.3);
}
.bokrr-chat-btn svg { width: 26px; height: 26px; fill: #fff; }

.bokrr-chat-dot {
    position: absolute; top: -2px; right: -2px;
    width: 14px; height: 14px;
    background: #e85d75; border-radius: 50%;
    border: 2.5px solid #fff;
    animation: bokrrDotBounce 2s ease-in-out infinite;
}
@keyframes bokrrDotBounce {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.2); }
}

/* ── Chat Window ── */
.bokrr-chat-window {
    position: fixed;
    bottom: 100px; right: 28px;
    width: 390px;
    max-height: 560px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
    z-index: 9999;
    display: flex; flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16,1,0.3,1),
                transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.bokrr-chat-window.open {
    opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}

/* Header */
.bokrr-chat-header {
    background: #1a1a1a;
    padding: 18px 20px;
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.bokrr-chat-header-left { display: flex; align-items: center; gap: 12px; }
.bokrr-chat-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #e85d75, #f0a0b0);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; font-size: 15px;
    font-family: 'DM Sans', sans-serif;
}
.bokrr-chat-header-info h4 {
    margin: 0; color: #fff; font-size: 14.5px; font-weight: 600;
    font-family: 'DM Sans', sans-serif;
}
.bokrr-chat-header-info span {
    color: rgba(255,255,255,0.55); font-size: 12px;
    display: flex; align-items: center; gap: 5px;
    font-family: 'DM Sans', sans-serif;
}
.bokrr-chat-header-info span::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: #5cd47f; display: inline-block;
}
/* Test mode badge */
.bokrr-test-badge {
    display: inline-block;
    background: #e85d75;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 5px;
    font-family: 'DM Sans', sans-serif;
}

/* Language Toggle */
.bokrr-lang-toggle {
    display: flex;
    gap: 4px;
    margin-right: 8px;
}
.bokrr-lang-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.5);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}
.bokrr-lang-btn:hover,
.bokrr-lang-btn.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-color: rgba(255,255,255,0.6);
}

.bokrr-chat-close {
    background: rgba(255,255,255,0.1); border: none;
    width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.bokrr-chat-close:hover { background: rgba(255,255,255,0.2); }
.bokrr-chat-close svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 2; }

/* Messages */
.bokrr-chat-messages {
    flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 10px;
    overflow-y: auto; background: #faf9f7;
    scroll-behavior: smooth;
}
.bokrr-chat-messages::-webkit-scrollbar { width: 4px; }
.bokrr-chat-messages::-webkit-scrollbar-track { background: transparent; }
.bokrr-chat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.bokrr-msg {
    max-width: 88%; padding: 12px 16px;
    border-radius: 16px;
    font-size: 13.5px; line-height: 1.55;
    font-family: 'DM Sans', sans-serif;
    opacity: 0; transform: translateY(8px);
    animation: bokrrMsgIn 0.4s cubic-bezier(0.16,1,0.3,1) forwards;
}
.bokrr-msg.bot {
    background: #fff; color: #2a2a2a;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.bokrr-msg.user {
    background: #1a1a1a; color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.bokrr-msg .msg-name {
    font-size: 10.5px; font-weight: 700;
    color: #e85d75; margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: 0.6px;
}
@keyframes bokrrMsgIn { to { opacity:1; transform:translateY(0); } }

/* Typing dots */
.bokrr-typing {
    display: flex; gap: 4px;
    padding: 14px 18px;
    background: #fff; border-radius: 16px; border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.bokrr-typing span {
    width: 7px; height: 7px; border-radius: 50%; background: #c5c5c5;
    animation: bokrrTypeDot 1.4s ease-in-out infinite;
}
.bokrr-typing span:nth-child(2) { animation-delay: 0.15s; }
.bokrr-typing span:nth-child(3) { animation-delay: 0.30s; }
@keyframes bokrrTypeDot {
    0%,60%,100% { transform:translateY(0); opacity:0.4; }
    30%          { transform:translateY(-5px); opacity:1; }
}

/* Option buttons */
.bokrr-options { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.bokrr-option-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 15px;
    background: #f6f4f1;
    border: 1.5px solid #ebe8e4;
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px; font-weight: 500;
    color: #333; cursor: pointer;
    transition: all 0.2s;
    text-align: left; width: 100%;
}
.bokrr-option-btn:hover {
    background: #1a1a1a; color: #fff; border-color: #1a1a1a;
    transform: translateX(4px);
}
.bokrr-option-btn .opt-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }

/* CTA button */
.bokrr-cta-btn {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 10px; padding: 11px 20px;
    background: #1a1a1a; color: #fff;
    border: none; border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: background 0.25s, transform 0.2s;
}
.bokrr-cta-btn:hover { background: #333; transform: translateY(-1px); color: #fff; }
.bokrr-cta-btn svg {
    width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 2.5;
    transition: transform 0.2s;
}
.bokrr-cta-btn:hover svg { transform: translateX(3px); }

/* Highlight block */
.bokrr-highlight {
    background: #f6f4f1;
    border-left: 3px solid #e85d75;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    margin: 8px 0 4px;
    font-size: 13px; line-height: 1.5;
}

/* Input Area */
.bokrr-chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
    border-top: 1px solid #f0eeec;
    flex-shrink: 0;
}
.bokrr-custom-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #e8e5e2;
    border-radius: 22px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    color: #2a2a2a;
    background: #faf9f7;
    outline: none;
    transition: border-color 0.2s;
}
.bokrr-custom-input:focus {
    border-color: #1a1a1a;
    background: #fff;
}
.bokrr-custom-input::placeholder { color: #bbb; }
.bokrr-send-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #1a1a1a;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}
.bokrr-send-btn:hover { background: #333; transform: scale(1.05); }
.bokrr-send-btn svg { width: 16px; height: 16px; stroke: #fff; }
.bokrr-send-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; }

/* Footer */
.bokrr-chat-footer {
    padding: 12px 20px;
    background: #fff;
    border-top: 1px solid #f0eeec;
    text-align: center;
    flex-shrink: 0;
}
.bokrr-chat-footer span { font-size: 11px; color: #aaa; font-family: 'DM Sans', sans-serif; }
.bokrr-chat-footer a { color: #888; text-decoration: none; font-weight: 600; }

/* Contact Form */
.bokrr-contact-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.bokrr-contact-input {
    padding: 10px 14px;
    border: 1.5px solid #e8e5e2;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #2a2a2a;
    outline: none;
    transition: border-color 0.2s;
    background: #faf9f7;
}
.bokrr-contact-input:focus { border-color: #7771D6; background: #fff; }
.bokrr-contact-input::placeholder { color: #bbb; }
.bokrr-contact-submit {
    padding: 11px;
    background: #7771D6;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 2px;
}
.bokrr-contact-submit:hover { background: #5f5bb8; }
.bokrr-contact-error {
    color: #e85d75;
    font-size: 12px;
    display: none;
    margin-top: 2px;
}

/* Mobile */
@media (max-width: 480px) {
    .bokrr-chat-window {
        right: 8px; left: 8px; bottom: 88px;
        width: auto; max-height: 75vh;
    }
    .bokrr-chat-trigger { right: 16px; bottom: 16px; }
    .bokrr-chat-label { display: none; }
}
