/* Britts Imperial — sample chat assistant */
.bi-chat-root {
    font-family: var(--bi-font, 'Poppins', 'Open Sans', sans-serif);
    z-index: 10000;
}

#enquiryFab.bi-chat-fab,
button.bi-chat-fab,
.bi-chat-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, var(--bi-gold, #c9a227), #ddb52e) !important;
    color: var(--bi-navy-dark, #081e33) !important;
    font-size: 22px;
    border: none !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 25px rgba(201, 162, 39, 0.5);
    z-index: 10051 !important;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    padding: 0;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.bi-chat-fab:hover,
.bi-chat-fab:focus {
    transform: scale(1.08);
    color: var(--bi-navy-dark, #081e33) !important;
    outline: none;
}

.bi-chat-fab.is-open i::before {
    content: "\f00d";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

.bi-chat-panel {
    position: fixed !important;
    bottom: 96px;
    right: 25px;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 680px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--bi-border, #e2e8f0);
    box-shadow: 0 18px 50px rgba(12, 45, 74, 0.22);
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    z-index: 10050 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.bi-chat-panel.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) scale(1);
}

.bi-chat-header {
    background: linear-gradient(135deg, var(--bi-navy, #0c2d4a), var(--bi-navy-light, #134067));
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.bi-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bi-gold, #c9a227);
    color: var(--bi-navy-dark, #081e33);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.bi-chat-header-text {
    flex: 1;
    min-width: 0;
}

.bi-chat-header-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.bi-chat-header-text span {
    display: block;
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
}

.bi-chat-status i {
    font-size: 7px;
    color: #6ee7b7;
    margin-right: 4px;
    vertical-align: middle;
    animation: biStatusPulse 1.8s ease-in-out infinite;
}

@keyframes biStatusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.bi-chat-fab {
    animation: biFabPulse 2.4s ease-in-out infinite;
}

.bi-chat-fab.is-open,
.bi-chat-fab:hover {
    animation: none;
}

@keyframes biFabPulse {
    0%, 100% { box-shadow: 0 6px 25px rgba(201, 162, 39, 0.5); }
    50% { box-shadow: 0 6px 28px rgba(201, 162, 39, 0.75), 0 0 0 8px rgba(201, 162, 39, 0.15); }
}

.bi-chat-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
    opacity: 0.85;
    line-height: 1;
}

.bi-chat-close:hover {
    opacity: 1;
}

.bi-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    background: var(--bi-bg, #f4f7fb);
    -webkit-overflow-scrolling: touch;
}

.bi-chat-messages.is-busy {
    pointer-events: none;
}

.bi-chat-msg {
    display: flex;
    margin-bottom: 12px;
    max-width: 92%;
}

.bi-chat-msg.bot {
    align-self: flex-start;
}

.bi-chat-msg.user {
    margin-left: auto;
    justify-content: flex-end;
}

.bi-chat-enter {
    animation: biMsgBotIn 0.35s ease both;
}

.bi-chat-enter-user {
    animation: biMsgUserIn 0.28s ease both;
}

@keyframes biMsgBotIn {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes biMsgUserIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

.bi-chat-bubble {
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.bi-chat-msg.bot .bi-chat-bubble {
    background: #fff;
    color: #2d3748;
    border: 1px solid var(--bi-border, #e2e8f0);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(12, 45, 74, 0.04);
}

.bi-chat-msg.user .bi-chat-bubble {
    background: var(--bi-navy, #0c2d4a);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.bi-chat-typing-bubble {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    padding: 12px 16px !important;
    min-width: 56px;
}

.bi-chat-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bi-slate, #5a6b7d);
    opacity: 0.35;
    animation: biChatDot 1.2s ease-in-out infinite;
}

.bi-chat-dot:nth-child(2) { animation-delay: 0.18s; }
.bi-chat-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes biChatDot {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

.bi-chat-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--bi-teal, #0e4546);
    text-decoration: none;
}

.bi-chat-link:hover {
    color: var(--bi-gold-hover, #b08d1f);
    text-decoration: underline;
}

.bi-chat-prompt {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--bi-slate, #5a6b7d);
    margin: 2px 2px 8px;
}

.bi-chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 10px;
    padding: 0 2px;
}

.bi-chat-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid var(--bi-border, #e2e8f0);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--bi-navy, #0c2d4a);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
    font-family: inherit;
    line-height: 1.4;
    opacity: 1;
}

.bi-chat-option-enter {
    animation: biOptionIn 0.32s ease forwards;
}

.bi-ask-actions .bi-chat-option {
    opacity: 1 !important;
}

@keyframes biOptionIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.bi-chat-option:hover {
    border-color: var(--bi-gold, #c9a227);
    background: #fffdf6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(12, 45, 74, 0.08);
}

.bi-chat-option-num,
.bi-chat-option-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bi-bg, #f4f7fb);
    color: var(--bi-navy, #0c2d4a);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.bi-chat-option-icon {
    font-size: 10px;
    color: var(--bi-slate, #5a6b7d);
}

.bi-chat-option-label {
    flex: 1;
    min-width: 0;
}

.bi-chat-option.not-listed {
    border-style: dashed;
    color: var(--bi-slate, #5a6b7d);
    font-weight: 500;
}

.bi-chat-actions {
    display: flex;
    gap: 14px;
    padding: 0 2px 10px;
    flex-wrap: wrap;
    opacity: 0;
}

.bi-chat-actions.bi-chat-enter {
    animation: biOptionIn 0.32s ease forwards;
}

.bi-chat-action-btn {
    background: transparent;
    border: none;
    color: var(--bi-slate, #5a6b7d);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
    transition: color 0.2s;
}

.bi-chat-action-btn:hover {
    color: var(--bi-navy, #0c2d4a);
}

.bi-chat-form-wrap {
    display: none;
    padding: 12px 14px 16px;
    background: #fff;
    border-top: 1px solid var(--bi-border, #e2e8f0);
    flex-shrink: 0;
    max-height: 70%;
    overflow-y: auto;
}

.bi-chat-form-wrap.is-visible {
    display: block;
}

.bi-chat-form-wrap.bi-chat-form-slide {
    animation: biFormSlide 0.35s ease both;
}

@keyframes biFormSlide {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.bi-chat-form-wrap h4 {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--bi-navy, #0c2d4a);
    font-weight: 600;
}

.bi-chat-form-wrap > p {
    margin: 0 0 12px;
    font-size: 12px;
    color: var(--bi-slate, #5a6b7d);
}

.bi-chat-field {
    margin-bottom: 10px;
}

.bi-chat-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--bi-navy, #0c2d4a);
    margin-bottom: 4px;
}

.bi-chat-field input,
.bi-chat-field textarea {
    width: 100%;
    border: 1px solid var(--bi-border, #e2e8f0);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    color: #2d3748;
    box-sizing: border-box;
    background: #fff;
}

.bi-chat-field input:focus,
.bi-chat-field textarea:focus {
    outline: none;
    border-color: var(--bi-gold, #c9a227);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.bi-chat-field textarea {
    min-height: 72px;
    resize: vertical;
}

.bi-chat-form-error {
    display: none;
    font-size: 12px;
    color: #c53030;
    margin-bottom: 8px;
}

.bi-chat-form-error.is-visible {
    display: block;
}

.bi-chat-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.bi-chat-submit,
.bi-chat-cancel {
    flex: 1;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.bi-chat-submit {
    background: var(--bi-navy, #0c2d4a);
    color: #fff;
}

.bi-chat-submit:hover {
    background: var(--bi-navy-light, #134067);
}

.bi-chat-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.bi-chat-cancel {
    background: #f1f5f9;
    color: var(--bi-slate, #5a6b7d);
}

.bi-chat-cancel:hover {
    background: #e2e8f0;
}

.bi-chat-footer-note {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 10px;
    color: var(--bi-slate, #5a6b7d);
    text-align: center;
    background: #fff;
    border-top: 1px solid var(--bi-border, #e2e8f0);
}

/* Left Ask FAB */
.bi-ask-fab,
#askFab.bi-ask-fab {
    position: fixed;
    bottom: 25px;
    left: 25px;
    right: auto;
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, var(--bi-navy, #0c2d4a), var(--bi-navy-light, #134067)) !important;
    color: var(--bi-gold, #c9a227) !important;
    font-size: 20px;
    border: none !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 25px rgba(12, 45, 74, 0.45);
    z-index: 10051;
    cursor: pointer;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

.bi-ask-fab.is-open i::before {
    content: "\f00d";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

.bi-ask-panel {
    left: 25px !important;
    right: auto !important;
}

.bi-ask-composer {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--bi-border, #e2e8f0);
    background: #fff;
    flex-shrink: 0;
}

.bi-ask-composer input {
    flex: 1;
    border: 1px solid var(--bi-border, #e2e8f0);
    border-radius: 20px;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}

.bi-ask-composer input:focus {
    border-color: var(--bi-gold, #c9a227);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.bi-ask-composer button {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--bi-navy, #0c2d4a);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.bi-ask-composer button:hover {
    background: var(--bi-navy-light, #134067);
}

.bi-ask-match-cat {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bi-gold, #c9a227);
    margin-bottom: 4px;
}

.bi-ask-actions {
    margin: 6px 0 12px;
    padding: 0 2px;
}

@media (max-width: 575px) {
    .bi-chat-panel:not(.bi-ask-panel) {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 84px;
        height: min(680px, calc(100vh - 90px));
        max-width: none;
    }

    .bi-ask-panel {
        left: 12px !important;
        right: 12px !important;
        width: auto;
        bottom: 84px;
        height: min(680px, calc(100vh - 90px));
        max-width: none;
    }

    .bi-chat-fab {
        bottom: 18px;
        right: 18px;
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .bi-ask-fab,
    #askFab.bi-ask-fab {
        bottom: 18px;
        left: 18px;
        width: 52px;
        height: 52px;
        font-size: 18px;
    }
}
