:root {
    --chatbot-font-family: "Prometo", "Segoe UI", Arial, sans-serif;
    --chatbot-primary: #4d8fcb;
    --chatbot-primary-dark: #4482bf;
    --chatbot-launcher-size: 76px;
    --chatbot-panel-width: 390px;
    --chatbot-frame-min-height: 406px;
    --chatbot-layer: 1055;
}

.chatbot-modal,
.floating-chat-btn {
    font-family: var(--chatbot-font-family);
}

.floating-chat-btn {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: var(--chatbot-launcher-size);
    height: var(--chatbot-launcher-size);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff 0%, #f4fbff 100%);
    box-shadow: 0 14px 34px rgba(14, 73, 120, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    z-index: var(--chatbot-layer);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.floating-chat-btn::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 2px solid rgba(70, 140, 201, 0.22);
}

.floating-chat-btn:hover,
.floating-chat-btn:focus {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 18px 38px rgba(14, 73, 120, 0.28);
    outline: none;
}

.floating-chat-btn img {
    position: relative;
    z-index: 1;
    width: 88%;
    height: 88%;
    object-fit: cover;
    border-radius: 50%;
}

.floating-chat-btn.active {
    box-shadow: 0 20px 42px rgba(70, 140, 201, 0.35);
}

.chatbot-modal-ar + .floating-chat-btn {
    right: auto;
    left: 28px;
}

.chatbot-modal {
    padding: 18px !important;
}

body.chatbot-panel-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

body.chatbot-panel-open .modal-backdrop,
.chatbot-modal-en.show ~ .modal-backdrop,
.chatbot-modal-ar.show ~ .modal-backdrop {
    display: none !important;
    pointer-events: none !important;
}

.chatbot-modal-en,
.chatbot-modal-ar {
    pointer-events: none;
}

.chatbot-modal .modal-dialog {
    width: min(826px, calc(100vw - 36px));
    max-width: 826px;
    margin: 0 auto;
}

.chatbot-modal-en .modal-dialog {
    position: fixed;
    right: 28px;
    bottom: 112px;
    width: min(var(--chatbot-panel-width), calc(100vw - 56px));
    max-width: var(--chatbot-panel-width);
    min-height: 0;
    display: block;
    margin: 0;
    pointer-events: auto;
}

.chatbot-modal-ar .modal-dialog {
    position: fixed;
    right: auto;
    left: 28px;
    bottom: 112px;
    width: min(var(--chatbot-panel-width), calc(100vw - 56px));
    max-width: var(--chatbot-panel-width);
    min-height: 0;
    display: block;
    margin: 0;
    pointer-events: auto;
}

.chatbot-modal .modal-content {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

.chatbot-shell {
    position: relative;
    border-radius: 36px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(239, 248, 255, 0.4) 0%, rgba(239, 248, 255, 0) 20%),
        linear-gradient(180deg, #f6fbff 0%, #ffffff 68%);
    box-shadow: 0 24px 80px rgba(32, 77, 119, 0.24);
}

.chatbot-modal-en .chatbot-shell {
    border-radius: 24px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.chatbot-modal-ar .chatbot-shell {
    border-radius: 24px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.chatbot-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    color: #4a8aca;
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
    z-index: 4;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-close:hover,
.chatbot-close:focus {
    transform: scale(1.05);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
    outline: none;
}

.chatbot-hero {
    height: 230px;
    background:
        linear-gradient(180deg, rgba(10, 39, 67, 0.1) 0%, rgba(10, 39, 67, 0.32) 100%);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.chatbot-modal-en .chatbot-hero {
    display: none;
}

.chatbot-modal-ar .chatbot-hero {
    display: none;
}

.chatbot-branding {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 24px 0;
}

.chatbot-branding img {
    width: clamp(118px, 16vw, 190px);
    max-width: 100%;
    height: auto;
}

.chatbot-modal-en .chatbot-branding {
    display: none;
}

.chatbot-modal-ar .chatbot-branding {
    display: none;
}

.chatbot-modal-en .chatbot-branding img {
    width: 118px;
}

.chatbot-welcome-card {
    width: min(396px, calc(100% - 48px));
    margin: -132px auto 0;
    padding: 22px 26px;
    border-radius: 34px;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 24px 36px rgba(59, 121, 180, 0.22);
    position: relative;
    z-index: 2;
}

.chatbot-modal-en .chatbot-welcome-card {
    width: 100%;
    margin-top: 0;
    padding: 16px 50px 16px 18px;
    border-radius: 24px 24px 18px 18px;
    gap: 12px;
}

.chatbot-modal-ar .chatbot-welcome-card {
    width: 100%;
    margin-top: 0;
    padding: 16px 18px 16px 50px;
    border-radius: 24px 24px 18px 18px;
    gap: 12px;
}

.chatbot-welcome-avatar {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-modal-en .chatbot-welcome-avatar {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
    padding: 4px;
}

.chatbot-modal-ar .chatbot-welcome-avatar {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
    padding: 4px;
}

.chatbot-welcome-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: #ffffff;
}

.chatbot-welcome-copy {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.18;
}

.chatbot-welcome-copy .eyebrow {
    display: block;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.chatbot-modal-en .chatbot-welcome-copy .eyebrow {
    font-size: 15px;
    margin-bottom: 3px;
}

.chatbot-modal-ar .chatbot-welcome-copy .eyebrow {
    font-size: 15px;
    margin-bottom: 3px;
}

.chatbot-welcome-copy strong,
.chatbot-welcome-copy span:last-child {
    display: block;
    font-size: 17px;
    font-weight: 400;
    opacity: 0.98;
}

.chatbot-modal-en .chatbot-welcome-copy strong,
.chatbot-modal-en .chatbot-welcome-copy span:last-child {
    font-size: 13px;
}

.chatbot-modal-ar .chatbot-welcome-copy strong,
.chatbot-modal-ar .chatbot-welcome-copy span:last-child {
    font-size: 13px;
}

.chatbot-welcome-toggle {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chatbot-modal-en .chatbot-welcome-toggle {
    display: none;
}

.chatbot-modal-ar .chatbot-welcome-toggle {
    display: none;
}

.chatbot-modal-en .chatbot-close {
    top: 22px;
    right: 18px;
    width: 34px;
    height: 34px;
    background: transparent;
    color: #ffffff;
    font-size: 26px;
    box-shadow: none;
}

.chatbot-modal-ar .chatbot-close {
    top: 22px;
    right: auto;
    left: 18px;
    width: 34px;
    height: 34px;
    background: transparent;
    color: #ffffff;
    font-size: 26px;
    box-shadow: none;
}

.chatbot-panel {
    padding: 0 34px 34px;
}

.chatbot-modal-en .chatbot-panel {
    padding: 14px 14px 16px;
}

.chatbot-modal-ar .chatbot-panel {
    padding: 14px 14px 16px;
}

.chatbot-panel-surface {
    background: #ffffff;
    border-radius: 38px;
    box-shadow: 0 20px 44px rgba(68, 90, 112, 0.16);
    padding: 22px;
    min-height: 560px;
}

.chatbot-modal-en .chatbot-panel-surface {
    border-radius: 22px;
    min-height: 430px;
    padding: 12px;
}

.chatbot-modal-ar .chatbot-panel-surface {
    border-radius: 22px;
    min-height: 430px;
    padding: 12px;
}

.chatbot-panel-frame {
    overflow: hidden;
    border-radius: 28px;
    background: #f7f9fc;
    height: 100%;
    min-height: 516px;
}

.chatbot-modal-en .chatbot-panel-frame {
    border-radius: 16px;
    min-height: var(--chatbot-frame-min-height);
}

.chatbot-modal-ar .chatbot-panel-frame {
    border-radius: 16px;
    min-height: var(--chatbot-frame-min-height);
}

.chatbot-modal iframe {
    width: 100%;
    min-height: 516px;
    height: 100%;
    border: 0;
    background: #ffffff;
}

.chatbot-modal-en iframe {
    min-height: var(--chatbot-frame-min-height);
}

.chatbot-modal-ar iframe {
    min-height: var(--chatbot-frame-min-height);
}

.chatbot-modal.fade .modal-dialog {
    transform: translateY(18px) scale(0.98);
    transition: transform 0.28s ease-out;
}

.chatbot-modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}

.chatbot-modal-en.fade .modal-dialog {
    transform: translateY(12px) scale(0.98);
}

.chatbot-modal-en.show .modal-dialog {
    transform: translateY(0) scale(1);
}

.chatbot-modal-ar.fade .modal-dialog {
    transform: translateY(12px) scale(0.98);
}

.chatbot-modal-ar.show .modal-dialog {
    transform: translateY(0) scale(1);
}

.modal-backdrop.show {
    opacity: 0.62;
}

@media (max-width: 991px) {
    .chatbot-modal {
        padding: 12px !important;
    }

    .chatbot-hero {
        height: 190px;
    }

    .chatbot-branding {
        padding: 8px 18px 0;
    }

    .chatbot-panel {
        padding: 0 18px 20px;
    }

    .chatbot-panel-surface {
        padding: 16px;
        border-radius: 30px;
        min-height: 480px;
    }

    .chatbot-panel-frame,
    .chatbot-modal iframe {
        min-height: 440px;
    }

    .chatbot-modal-en .modal-dialog {
        right: 18px;
        bottom: 98px;
        width: min(340px, calc(100vw - 36px));
        max-width: 340px;
    }

    .chatbot-modal-ar .modal-dialog {
        right: auto;
        left: 18px;
        bottom: 98px;
        width: min(340px, calc(100vw - 36px));
        max-width: 340px;
    }

    .chatbot-modal-en .chatbot-panel-surface {
        min-height: 430px;
    }

    .chatbot-modal-ar .chatbot-panel-surface {
        min-height: 430px;
    }

    .chatbot-modal-en .chatbot-panel-frame,
    .chatbot-modal-en iframe {
        min-height: 406px;
    }

    .chatbot-modal-ar .chatbot-panel-frame,
    .chatbot-modal-ar iframe {
        min-height: 406px;
    }
}

@media (max-width: 767px) {
    .floating-chat-btn {
        right: 18px;
        bottom: 18px;
        width: 68px;
        height: 68px;
    }

    .chatbot-modal-ar + .floating-chat-btn {
        right: auto;
        left: 18px;
    }

    .chatbot-shell {
        border-radius: 26px;
    }

    .chatbot-close {
        top: 12px;
        right: 12px;
        width: 46px;
        height: 46px;
        font-size: 21px;
    }

    .chatbot-hero {
        height: 148px;
        background-position: center top;
    }

    .chatbot-branding {
        justify-content: flex-start;
        padding: 8px 14px 0;
    }

    .chatbot-branding img {
        width: min(120px, 34vw);
    }

    .chatbot-welcome-card {
        width: min(324px, calc(100% - 24px));
        margin-top: -90px;
        padding: 18px 18px;
        border-radius: 28px;
        gap: 14px;
    }

    .chatbot-welcome-avatar {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
    }

    .chatbot-welcome-copy .eyebrow {
        font-size: 16px;
    }

    .chatbot-welcome-copy strong,
    .chatbot-welcome-copy span:last-child {
        font-size: 14px;
    }

    .chatbot-panel {
        padding: 20px 20px 12px 12px;
    }

    .chatbot-panel-surface {
        min-height: 420px;
        border-radius: 24px;
    }

    .chatbot-panel-frame,
    .chatbot-modal iframe {
        min-height: 388px;
        border-radius: 20px;
    }

    .chatbot-modal-en .modal-dialog {
        right: 18px;
        bottom: 92px;
        width: min(340px, calc(100vw - 36px));
        max-width: 340px;
    }

    .chatbot-modal-ar .modal-dialog {
        right: auto;
        left: 18px;
        bottom: 92px;
        width: min(340px, calc(100vw - 36px));
        max-width: 340px;
    }

    .chatbot-modal-en .chatbot-shell {
        border-radius: 22px;
        max-height: calc(100vh - 116px);
    }

    .chatbot-modal-ar .chatbot-shell {
        border-radius: 22px;
        max-height: calc(100vh - 116px);
    }

    .chatbot-modal-en .chatbot-close {
        top: 18px;
        right: 14px;
        width: 32px;
        height: 32px;
        font-size: 24px;
    }

    .chatbot-modal-ar .chatbot-close {
        top: 18px;
        right: auto;
        left: 14px;
        width: 32px;
        height: 32px;
        font-size: 24px;
    }

    .chatbot-modal-en .chatbot-hero {
        display: none;
    }

    .chatbot-modal-ar .chatbot-hero {
        display: none;
    }

    .chatbot-modal-en .chatbot-welcome-card {
        width: 100%;
        margin-top: 0;
        padding: 14px 46px 14px 14px;
        border-radius: 22px 22px 18px 18px;
    }

    .chatbot-modal-ar .chatbot-welcome-card {
        width: 100%;
        margin-top: 0;
        padding: 14px 14px 14px 46px;
        border-radius: 22px 22px 18px 18px;
    }

    .chatbot-modal-en .chatbot-panel {
        padding: 12px;
    }

    .chatbot-modal-ar .chatbot-panel {
        padding: 12px;
    }

    .chatbot-modal-en .chatbot-panel-surface {
        min-height: 390px;
        padding: 10px;
        border-radius: 20px;
    }

    .chatbot-modal-ar .chatbot-panel-surface {
        min-height: 390px;
        padding: 10px;
        border-radius: 20px;
    }

    .chatbot-modal-en .chatbot-panel-frame,
    .chatbot-modal-en iframe {
        min-height: 370px;
        border-radius: 16px;
    }

    .chatbot-modal-ar .chatbot-panel-frame,
    .chatbot-modal-ar iframe {
        min-height: 370px;
        border-radius: 16px;
    }
}
