/* =========================================================
   ASK BIHAR — PREMIUM AI CHATBOT
   ========================================================= */

.ask-bihar-launcher {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 1500;

    width: 54px;
    height: 54px;

    border: 1px solid rgba(212, 160, 23, .55);
    border-radius: 50%;

    background:
        linear-gradient(
            145deg,
            #8B4513,
            #5f2f0d
        );

    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;

    box-shadow:
        0 14px 35px rgba(0, 0, 0, .28),
        0 0 0 5px rgba(212, 160, 23, .08);

    cursor: pointer;

    transition:
        transform .3s ease,
        box-shadow .3s ease;
}


.ask-bihar-launcher:hover {
    transform: translateY(-4px);

    box-shadow:
        0 18px 42px rgba(0, 0, 0, .32),
        0 0 0 7px rgba(212, 160, 23, .10);
}


.ask-bihar-launcher::after {
    content: "";

    position: absolute;

    right: 2px;
    top: 2px;

    width: 12px;
    height: 12px;

    background: #D4A017;

    border: 2px solid #fff;

    border-radius: 50%;
}


/* =========================================================
   CHAT WINDOW
   ========================================================= */

.ask-bihar-window {
    position: fixed;

    right: 28px;
    bottom: 105px;

    z-index: 1499;

    width: min(360px, calc(100vw - 32px));
    height: min(540px, calc(100vh - 150px));

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: #fffaf2;

    border: 1px solid rgba(139, 69, 19, .18);

    box-shadow:
        0 30px 80px rgba(36, 22, 12, .28);

    border-radius: 24px;

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(20px)
        scale(.96);

    transform-origin: bottom right;

    transition:
        opacity .3s ease,
        visibility .3s ease,
        transform .3s ease;
}


.ask-bihar-window.active {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0)
        scale(1);
}


/* =========================================================
   HEADER
   ========================================================= */

.ask-bihar-header {
    position: relative;

    padding: 20px 20px 18px;

    color: #fff;

    background:
        linear-gradient(
            135deg,
            #3b2114,
            #6f3717
        );

    flex-shrink: 0;
}


.ask-bihar-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.ask-bihar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}


.ask-bihar-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background: rgba(212, 160, 23, .18);

    border: 1px solid rgba(212, 160, 23, .35);

    color: #D4A017;

    font-size: 19px;
}


.ask-bihar-brand strong {
    display: block;

    font-family: "Playfair Display", serif;

    font-size: 18px;
    line-height: 1.1;
}


.ask-bihar-status {
    display: flex;
    align-items: center;
    gap: 5px;

    margin-top: 5px;

    font-family: "Poppins", sans-serif;

    font-size: 9px;
    font-weight: 700;

    letter-spacing: .13em;

    text-transform: uppercase;

    color: rgba(255,255,255,.62);
}


.ask-bihar-status-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #62c174;
}


.ask-bihar-close {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255,255,255,.15);

    border-radius: 50%;

    background: rgba(255,255,255,.06);

    color: rgba(255,255,255,.8);

    cursor: pointer;

    transition: .25s ease;
}


.ask-bihar-close:hover {
    background: rgba(255,255,255,.14);
    color: #fff;
}


/* =========================================================
   MESSAGES
   ========================================================= */

.ask-bihar-messages {
    flex: 1;

    overflow-y: auto;

    padding: 22px 17px;

    scrollbar-width: thin;

    background:
        radial-gradient(
            circle at top right,
            rgba(212,160,23,.08),
            transparent 35%
        ),
        #fffaf2;
}


.ask-bihar-message {
    display: flex;

    margin-bottom: 15px;

    animation:
        askMessageIn .3s ease;
}


@keyframes askMessageIn {

    from {
        opacity: 0;
        transform: translateY(7px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}


.ask-bihar-message.ai {
    justify-content: flex-start;
}


.ask-bihar-message.user {
    justify-content: flex-end;
}


.ask-bihar-bubble {
    max-width: 82%;

    padding: 12px 14px;

    border-radius: 17px;

    font-family: "Poppins", sans-serif;

    font-size: 12px;

    line-height: 1.65;

    white-space: pre-line;
}


.ask-bihar-message.ai
.ask-bihar-bubble {

    color: #49372b;

    background: #fff;

    border:
        1px solid rgba(139,69,19,.10);

    border-bottom-left-radius: 5px;

    box-shadow:
        0 5px 18px rgba(56,34,19,.06);
}


.ask-bihar-message.user
.ask-bihar-bubble {

    color: #fff;

    background:
        linear-gradient(
            135deg,
            #8B4513,
            #6c3413
        );

    border-bottom-right-radius: 5px;

    box-shadow:
        0 6px 18px rgba(90,43,15,.16);
}


/* =========================================================
   QUICK PROMPTS
   ========================================================= */

.ask-bihar-quick {
    display: flex;

    gap: 7px;

    overflow-x: auto;

    padding: 0 17px 12px;

    scrollbar-width: none;

    background: #fffaf2;
}


.ask-bihar-quick::-webkit-scrollbar {
    display: none;
}


.ask-bihar-quick button {
    flex: 0 0 auto;

    padding: 7px 11px;

    border:
        1px solid rgba(139,69,19,.15);

    border-radius: 50px;

    background: #fff;

    color: #70401f;

    font-family: "Poppins", sans-serif;

    font-size: 10px;
    font-weight: 600;

    cursor: pointer;

    transition: .25s ease;
}


.ask-bihar-quick button:hover {
    background: #f5eadb;

    border-color:
        rgba(139,69,19,.28);
}


/* =========================================================
   INPUT
   ========================================================= */

.ask-bihar-input-area {
    padding: 13px 15px 15px;

    background: #fff;

    border-top:
        1px solid rgba(139,69,19,.10);
}


.ask-bihar-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;

    width: 100%;
    box-sizing: border-box;

    padding: 6px 6px 6px 14px;

    background: #faf6ef;

    border:
        1px solid rgba(139,69,19,.13);

    border-radius: 17px;

    transition: .25s ease;
}


.ask-bihar-input-wrapper:focus-within {
    border-color:
        rgba(139,69,19,.35);

    box-shadow:
        0 0 0 3px rgba(212,160,23,.08);
}


.ask-bihar-input {
    flex: 1;

    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 9px 0;

    box-sizing: border-box;

    max-height: 90px;

    resize: none;

    border: 0;
    outline: 0;

    background: transparent;

    color: #3e2d21;

    font-family: "Poppins", sans-serif;

    font-size: 12px;

    line-height: 1.5;
}


.ask-bihar-input::placeholder {
    color: #9b8e83;
}


.ask-bihar-send {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    align-self: flex-end;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;

    border-radius: 12px;

    background: #8B4513;

    color: #fff;

    cursor: pointer;

    transition: .25s ease;
}


.ask-bihar-send:hover {
    background: #6d3410;

    transform: translateY(-1px);
}


.ask-bihar-send:disabled {
    opacity: .45;

    cursor: not-allowed;

    transform: none;
}


.ask-bihar-note {
    margin-top: 7px;

    text-align: center;

    font-family: "Poppins", sans-serif;

    font-size: 8px;

    letter-spacing: .04em;

    color: #aa9c90;
}


/* =========================================================
   TYPING
   ========================================================= */

.ask-bihar-typing {
    display: inline-flex;

    align-items: center;

    gap: 4px;

    padding: 13px 15px;

    border-radius: 17px;

    border-bottom-left-radius: 5px;

    background: #fff;

    border:
        1px solid rgba(139,69,19,.10);
}


.ask-bihar-typing span {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: #8B4513;

    animation:
        askTyping 1.1s infinite;
}


.ask-bihar-typing span:nth-child(2) {
    animation-delay: .15s;
}


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


@keyframes askTyping {

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

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

}


/* =========================================================
   FALLBACK BADGE
   ========================================================= */

.ask-bihar-source {
    margin-top: 5px;

    font-family: "Poppins", sans-serif;

    font-size: 8px;

    color: #a28d7c;
}


.ask-bihar-source i {
    color: #D4A017;
}


/* =========================================================
   DARK MODE
   ========================================================= */

html.dark-mode
.ask-bihar-window {

    background: #1d1713;

    border-color:
        rgba(212,160,23,.18);

    box-shadow:
        0 30px 90px rgba(0,0,0,.55);
}


html.dark-mode
.ask-bihar-messages {

    background:
        radial-gradient(
            circle at top right,
            rgba(212,160,23,.07),
            transparent 35%
        ),
        #1d1713;
}


html.dark-mode
.ask-bihar-message.ai
.ask-bihar-bubble {

    color: #e9dfd5;

    background: #29211c;

    border-color:
        rgba(255,255,255,.07);
}


html.dark-mode
.ask-bihar-quick {

    background: #1d1713;
}


html.dark-mode
.ask-bihar-quick button {

    background: #29211c;

    color: #d9c5b2;

    border-color:
        rgba(255,255,255,.09);
}


html.dark-mode
.ask-bihar-input-area {

    background: #241c17;

    border-color:
        rgba(255,255,255,.07);
}


html.dark-mode
.ask-bihar-input-wrapper {

    background: #191410;

    border-color:
        rgba(255,255,255,.09);
}


html.dark-mode
.ask-bihar-input {

    color: #eee5dc;
}


html.dark-mode
.ask-bihar-input::placeholder {

    color: #81756b;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 575.98px) {

    .ask-bihar-launcher {

        right: 17px;
        bottom: 17px;

        width: 50px;
        height: 50px;

        font-size: 19px;

    }


    .ask-bihar-window {

        right: 10px;
        bottom: 82px;

        width: calc(100vw - 32px);

        height:
            min(540px, calc(100vh - 125px));

        border-radius: 20px;

    }

}


@media (max-height: 650px) {

    .ask-bihar-window {

        height:
            calc(100vh - 95px);

    }

}

/* =========================================================
   ASK BIHAR — MOVE ABOVE BACK TO TOP
   ========================================================= */

.ask-bihar-launcher {
    bottom: 95px !important;
}

.ask-bihar-window {
    bottom: 172px !important;
}


@media (max-width: 575.98px) {

    .ask-bihar-launcher {
        right: 17px !important;
        bottom: 82px !important;
    }

    .ask-bihar-window {
        right: 28px !important;
        bottom: 147px !important;

        width: calc(100vw - 56px);
        height: min(480px, calc(100vh - 220px));
    }

}

/* =========================================================
   DISTRICT CONTEXT
   ========================================================= */

.ask-bihar-district-context {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin: 0;
    padding: 10px 14px;

    background: rgba(212, 160, 23, 0.08);

    border-bottom: 1px solid rgba(212, 160, 23, 0.16);
}


/* Responsive launcher and chat window sizing */

.ask-bihar-launcher {
    right: clamp(12px, 2.7vw, 28px) !important;
    bottom: clamp(16px, 9vh, 95px) !important;
    width: clamp(46px, 5vw, 54px);
    height: clamp(46px, 5vw, 54px);
    font-size: clamp(17px, 2vw, 20px);
}

.ask-bihar-window {
    right: clamp(12px, 2.7vw, 28px) !important;
    bottom: calc(clamp(16px, 9vh, 95px) + clamp(46px, 5vw, 54px) + 16px) !important;
    width: min(360px, calc(100vw - 24px));
    height: min(540px, calc(100dvh - 190px));
    max-height: calc(100dvh - 190px);
}

@media (max-width: 575.98px) {
    .ask-bihar-launcher {
        right: 16px !important;
        bottom: 16px !important;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .ask-bihar-window {
        right: 24px !important;
        bottom: 82px !important;
        width: min(340px, calc(100vw - 48px));
        height: min(480px, calc(100dvh - 104px));
        max-height: calc(100dvh - 104px);
        border-radius: 20px;
    }
}

@media (max-height: 650px) and (min-width: 576px) {
    .ask-bihar-window {
        height: calc(100dvh - 190px);
        max-height: calc(100dvh - 190px);
    }
}


.ask-bihar-district-context.active {
    display: flex;
}


.ask-bihar-district-info {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 9px;
}


.ask-bihar-district-info > i {
    flex: 0 0 auto;

    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: rgba(212, 160, 23, 0.15);

    color: #D4A017;

    font-size: 13px;
}


.ask-bihar-district-info > div {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 1px;
}


.ask-bihar-district-info span {
    font-family: "Poppins", sans-serif;

    font-size: 8px;
    font-weight: 700;

    letter-spacing: 1.3px;

    color: rgba(255, 255, 255, 0.48);
}


.ask-bihar-district-info strong {
    display: block;

    max-width: 210px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-family: "Poppins", sans-serif;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.3px;

    color: #ffffff;
}


.ask-bihar-district-clear {
    flex: 0 0 auto;

    width: 25px;
    height: 25px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.05);

    color: rgba(255, 255, 255, 0.55);

    cursor: pointer;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease;
}


.ask-bihar-district-clear:hover {
    background: rgba(190, 70, 50, 0.22);

    border-color: rgba(190, 70, 50, 0.35);

    color: #ffffff;
}


/* =========================================================
   LIGHT MODE
   ========================================================= */

html:not(.dark-mode) .ask-bihar-district-context {
    background: rgba(139, 69, 19, 0.045);

    border-bottom-color: rgba(139, 69, 19, 0.10);
}


html:not(.dark-mode) .ask-bihar-district-info span {
    color: rgba(45, 35, 28, 0.48);
}


html:not(.dark-mode) .ask-bihar-district-info strong {
    color: #2d231c;
}


html:not(.dark-mode) .ask-bihar-district-info > i {
    background: rgba(212, 160, 23, 0.12);

    color: #8B4513;
}


html:not(.dark-mode) .ask-bihar-district-clear {
    border-color: rgba(45, 35, 28, 0.10);

    background: rgba(45, 35, 28, 0.04);

    color: rgba(45, 35, 28, 0.50);
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 575.98px) {

    .ask-bihar-district-context {
        padding: 9px 12px;
    }


    .ask-bihar-district-info {
        gap: 8px;
    }


    .ask-bihar-district-info > i {
        width: 28px;
        height: 28px;

        font-size: 12px;
    }


    .ask-bihar-district-info strong {
        max-width: 180px;

        font-size: 10px;
    }


    .ask-bihar-district-info span {
        font-size: 7px;
    }

}