/* ODB Chat Widget */
#odb-chat-widget {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 9999;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
}

#odb-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 25%;
    border: none;
    background: #fafaf8;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 0;
    overflow: hidden;
}

#odb-chat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

#odb-chat-btn img {
    width: 60px;
    height: 60px;
    max-width: none;
    object-fit: cover;
    border-radius: 25%;
}

#odb-chat-box {
    display: none;
    flex-direction: column;
    width: 360px;
    height: 500px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    border: 1px solid #e0e0e0;
    position: relative;
}

#odb-chat-header {
    background: #0f0e2e;
    color: #fff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
}

#odb-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

#odb-chat-close:hover {
    opacity: 0.7;
}

#odb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f9f9fb;
}

.odb-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.odb-msg-bot {
    align-self: flex-start;
    background: #e8ecf4;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
    text-align: right;
}

.odb-msg-user {
    align-self: flex-end;
    background: #1c1965;
    color: #fff;
    border-bottom-right-radius: 4px;
    text-align: right;
}

.odb-msg a {
    color: #4a90e2;
    text-decoration: underline;
    word-break: break-all;
}

.odb-msg-user a {
    color: #a5d0ff;
}

/* LTR when English is active */
html[lang="en"] #odb-chat-widget {
    direction: ltr;
}

html[lang="en"] #odb-chat-input {
    direction: ltr;
}

html[lang="en"] .odb-msg-bot,
html[lang="en"] .odb-msg-user {
    text-align: left;
}

#odb-chat-input-area {
    display: flex;
    flex-direction: row-reverse;
    padding: 10px 12px;
    border-top: 1px solid #eee;
    gap: 8px;
    background: #fff;
}

#odb-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    direction: rtl;
    font-family: inherit;
}

#odb-chat-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.15);
}

#odb-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #0f0e2e;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

#odb-chat-send:hover {
    background: #1a1952;
}

/* Typing indicator */
.odb-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px !important;
}

.odb-typing span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: odbTyping 1.2s infinite;
}

.odb-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.odb-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes odbTyping {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    #odb-chat-widget {
        bottom: 70px;
        right: 12px;
    }

    #odb-chat-box {
        width: calc(100vw - 24px);
        height: 60vh;
        max-height: 450px;
        right: 0;
        position: fixed;
        bottom: 70px;
        left: 12px;
        right: 12px;
    }

    #odb-chat-btn {
        width: 52px;
        height: 52px;
    }
}


/* Consent screen — matches plugin style */
#odb-chat-consent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 10;
    text-align: center;
    direction: rtl;
}

#odb-chat-consent p {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin: 0 0 16px;
}

#odb-chat-consent>a {
    color: #4a90e2;
    text-decoration: underline;
    font-size: 13px;
    margin-bottom: 8px;
}

.odb-consent-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.odb-consent-buttons button {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.odb-consent-buttons button:hover {
    opacity: 0.85;
}

#odb-consent-accept {
    background: #0f0e2e;
    color: white;
}

#odb-consent-decline {
    background: #e0e0e0;
    color: #333;
}

/* Quick question chips */
.odb-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}

.odb-quick-chip {
    background: #fff;
    border: 1px solid #4a90e2;
    color: #4a90e2;
    border-radius: 16px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
    direction: rtl;
}

.odb-quick-chip:hover {
    background: #4a90e2;
    color: #fff;
}

/* Transparency footer — matches plugin style */
#odb-chat-transparency {
    padding: 0 16px 10px;
    text-align: center;
    font-size: 11px;
    color: #999;
    line-height: 1.4;
    direction: rtl;
}

#odb-chat-transparency a {
    color: #999;
    text-decoration: underline;
    margin-inline-start: 4px;
    font-size: 11px;
}

html[lang="en"] #odb-chat-consent {
    direction: ltr;
}

html[lang="en"] #odb-chat-transparency {
    direction: ltr;
}