/* =========================================================
   Garudachal AI - Public Chatbot
   File: assets/css/chatbot.css
   ========================================================= */


/* =========================================================
   Root
   ========================================================= */

.garudachal-ai {
    --ai-primary: #ff6b00;
    --ai-primary-dark: #e85f00;
    --ai-primary-light: #fff3e8;

    --ai-blue: #123b63;
    --ai-blue-dark: #0b2946;

    --ai-white: #ffffff;
    --ai-bg: #f7f9fc;
    --ai-border: #e6eaf0;

    --ai-text: #172033;
    --ai-muted: #6b7280;

    --ai-success: #20a464;

    --ai-shadow:
        0 20px 60px rgba(15, 31, 51, 0.20),
        0 8px 24px rgba(15, 31, 51, 0.10);

    --ai-radius: 20px;

    font-family:
        "Poppins",
        "Noto Sans Devanagari",
        Arial,
        sans-serif;

    position: relative;
    z-index: 99990;
}


/* =========================================================
   Screen Reader Only
   ========================================================= */

.garudachal-ai-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}


/* =========================================================
   Floating Button
   ========================================================= */

.garudachal-ai-button {
    position: fixed;

    right: 24px;
    bottom: 24px;

    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 190px;
    height: 66px;

    padding: 8px 18px 8px 8px;

    border: 0;
    border-radius: 40px;

    background:
        linear-gradient(
            135deg,
            var(--ai-primary),
            #ff8a32
        );

    color: var(--ai-white);

    cursor: pointer;

    box-shadow:
        0 12px 30px rgba(255, 107, 0, 0.30),
        0 5px 14px rgba(0, 0, 0, 0.10);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;

    z-index: 99999;

    font-family: inherit;

    -webkit-tap-highlight-color: transparent;
}


.garudachal-ai-button:hover {
    transform: translateY(-4px);

    box-shadow:
        0 18px 38px rgba(255, 107, 0, 0.34),
        0 8px 18px rgba(0, 0, 0, 0.12);
}


.garudachal-ai-button:active {
    transform: translateY(-1px) scale(0.98);
}


.garudachal-ai-button:focus-visible {
    outline: 3px solid rgba(255, 107, 0, 0.28);
    outline-offset: 4px;
}


/* =========================================================
   Floating Button Icon
   ========================================================= */

.garudachal-ai-button-icon {
    width: 50px;
    height: 50px;

    flex: 0 0 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.96);

    color: var(--ai-primary);

    font-size: 22px;

    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.10);

    position: relative;
}


.garudachal-ai-button-icon i {
    transition: transform 0.3s ease;
}


.garudachal-ai-button:hover
.garudachal-ai-button-icon i {
    transform: rotate(-8deg) scale(1.08);
}


/* =========================================================
   Button Text
   ========================================================= */

.garudachal-ai-button-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    line-height: 1.2;

    white-space: nowrap;
}


.garudachal-ai-button-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.1px;
}


.garudachal-ai-button-subtitle {
    margin-top: 3px;

    font-size: 11px;
    font-weight: 400;

    opacity: 0.88;
}


/* =========================================================
   Notification Pulse
   ========================================================= */

.garudachal-ai-button::after {
    content: "";

    position: absolute;

    left: 8px;
    top: 8px;

    width: 50px;
    height: 50px;

    border-radius: 50%;

    border: 2px solid rgba(255, 255, 255, 0.70);

    animation:
        garudachal-ai-pulse 2.5s infinite;

    pointer-events: none;
}


@keyframes garudachal-ai-pulse {

    0% {
        transform: scale(0.95);
        opacity: 0.75;
    }

    70% {
        transform: scale(1.35);
        opacity: 0;
    }

    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}


/* =========================================================
   Chat Window
   ========================================================= */

.garudachal-ai-window {
    position: fixed;

    right: 24px;
    bottom: 102px;

    width: min(410px, calc(100vw - 32px));

    height: min(680px, calc(100vh - 130px));

    min-height: 480px;

    display: flex;
    flex-direction: column;

    background: var(--ai-white);

    border:
        1px solid rgba(18, 59, 99, 0.08);

    border-radius: var(--ai-radius);

    overflow: hidden;

    box-shadow: var(--ai-shadow);

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(20px)
        scale(0.96);

    transform-origin:
        bottom right;

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;

    z-index: 99998;
}


.garudachal-ai-window.is-open {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0)
        scale(1);

    pointer-events: auto;
}


/* =========================================================
   Chat Header
   ========================================================= */

.garudachal-ai-header {
    min-height: 78px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px 16px;

    background:
        linear-gradient(
            135deg,
            var(--ai-blue-dark),
            var(--ai-blue)
        );

    color: var(--ai-white);

    position: relative;
}


.garudachal-ai-header::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 3px;

    background:
        linear-gradient(
            90deg,
            var(--ai-primary),
            #ff9d52,
            var(--ai-primary)
        );
}


/* =========================================================
   Header Left
   ========================================================= */

.garudachal-ai-header-left {
    display: flex;
    align-items: center;
    gap: 11px;

    min-width: 0;
}


.garudachal-ai-avatar {
    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #edf2f7
        );

    color: var(--ai-primary);

    font-size: 20px;

    position: relative;

    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.16);
}


.garudachal-ai-online-dot {
    position: absolute;

    width: 11px;
    height: 11px;

    right: 1px;
    bottom: 1px;

    border-radius: 50%;

    background: var(--ai-success);

    border: 2px solid var(--ai-blue-dark);
}


/* =========================================================
   Header Information
   ========================================================= */

.garudachal-ai-header-info {
    min-width: 0;
}


.garudachal-ai-header-info h2 {
    margin: 0;

    font-size: 16px;
    font-weight: 700;

    color: #ffffff;

    line-height: 1.3;
}


.garudachal-ai-header-info p {
    margin: 4px 0 0;

    display: flex;
    align-items: center;
    gap: 5px;

    font-size: 10px;

    color: rgba(255, 255, 255, 0.76);

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;
}


.garudachal-ai-status-dot {
    width: 6px;
    height: 6px;

    flex: 0 0 6px;

    border-radius: 50%;

    background: #45d483;
}


/* =========================================================
   Header Actions
   ========================================================= */

.garudachal-ai-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}


.garudachal-ai-header-btn {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 9px;

    background: rgba(255, 255, 255, 0.08);

    color: rgba(255, 255, 255, 0.88);

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;

    font-size: 13px;
}


.garudachal-ai-header-btn:hover {
    background: rgba(255, 255, 255, 0.17);
    color: #ffffff;

    transform: translateY(-1px);
}


.garudachal-ai-header-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 2px;
}


/* =========================================================
   Messages Area
   ========================================================= */

.garudachal-ai-messages {
    flex: 1;

    min-height: 0;

    overflow-y: auto;

    padding: 20px 15px 14px;

    background:
        radial-gradient(
            circle at top right,
            rgba(255, 107, 0, 0.035),
            transparent 35%
        ),
        #f8fafc;

    scroll-behavior: smooth;

    scrollbar-width: thin;
    scrollbar-color:
        rgba(18, 59, 99, 0.20)
        transparent;
}


.garudachal-ai-messages::-webkit-scrollbar {
    width: 6px;
}


.garudachal-ai-messages::-webkit-scrollbar-track {
    background: transparent;
}


.garudachal-ai-messages::-webkit-scrollbar-thumb {
    background: rgba(18, 59, 99, 0.18);

    border-radius: 20px;
}


.garudachal-ai-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(18, 59, 99, 0.28);
}


/* =========================================================
   Message Row
   ========================================================= */

.garudachal-ai-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;

    margin-bottom: 15px;

    animation:
        garudachal-ai-message-in
        0.25s
        ease
        both;
}


@keyframes garudachal-ai-message-in {

    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   Assistant Message
   ========================================================= */

.garudachal-ai-message-assistant {
    justify-content: flex-start;
}


/* =========================================================
   User Message
   ========================================================= */

.garudachal-ai-message-user {
    justify-content: flex-end;
}


/* =========================================================
   Message Avatar
   ========================================================= */

.garudachal-ai-message-avatar {
    width: 30px;
    height: 30px;

    flex: 0 0 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background:
        linear-gradient(
            145deg,
            #fff7f0,
            #ffe9d7
        );

    color: var(--ai-primary);

    font-size: 12px;
}


/* =========================================================
   Message Content
   ========================================================= */

.garudachal-ai-message-content {
    max-width: 82%;

    display: flex;
    flex-direction: column;
}


.garudachal-ai-message-user
.garudachal-ai-message-content {
    align-items: flex-end;
}


/* =========================================================
   Message Bubble
   ========================================================= */

.garudachal-ai-message-bubble {
    padding: 11px 13px;

    border-radius: 15px;

    font-size: 13px;

    line-height: 1.65;

    color: var(--ai-text);

    word-wrap: break-word;
    overflow-wrap: anywhere;
}


.garudachal-ai-message-assistant
.garudachal-ai-message-bubble {

    background: #ffffff;

    border:
        1px solid var(--ai-border);

    border-top-left-radius: 5px;

    box-shadow:
        0 2px 8px rgba(15, 31, 51, 0.035);
}


.garudachal-ai-message-user
.garudachal-ai-message-bubble {

    background:
        linear-gradient(
            135deg,
            var(--ai-primary),
            #ff8126
        );

    color: #ffffff;

    border-top-right-radius: 5px;

    box-shadow:
        0 4px 12px rgba(255, 107, 0, 0.18);
}


/* =========================================================
   Bubble Typography
   ========================================================= */

.garudachal-ai-message-bubble p {
    margin: 0 0 8px;
}


.garudachal-ai-message-bubble p:last-child {
    margin-bottom: 0;
}


.garudachal-ai-message-bubble strong {
    font-weight: 700;
}


.garudachal-ai-message-assistant
.garudachal-ai-message-bubble strong {
    color: var(--ai-blue);
}


/* =========================================================
   Message Time
   ========================================================= */

.garudachal-ai-message-time {
    margin-top: 4px;

    font-size: 9px;

    color: #9aa2ad;
}


/* =========================================================
   Quick Questions
   ========================================================= */

.garudachal-ai-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    padding:
        2px
        4px
        12px
        38px;
}


.garudachal-ai-quick-question {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    min-height: 34px;

    padding: 7px 11px;

    border:
        1px solid rgba(255, 107, 0, 0.22);

    border-radius: 20px;

    background: #ffffff;

    color: var(--ai-blue);

    font-family: inherit;

    font-size: 10px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.garudachal-ai-quick-question i {
    color: var(--ai-primary);

    font-size: 10px;
}


.garudachal-ai-quick-question:hover {
    background: var(--ai-primary);

    border-color: var(--ai-primary);

    color: #ffffff;

    transform: translateY(-1px);
}


.garudachal-ai-quick-question:hover i {
    color: #ffffff;
}


/* =========================================================
   Typing Indicator
   ========================================================= */

.garudachal-ai-typing {
    display: flex;
    align-items: center;
    gap: 8px;

    padding:
        5px
        15px
        10px;

    background: #f8fafc;
}


.garudachal-ai-typing[hidden] {
    display: none;
}


.garudachal-ai-typing-avatar {
    width: 30px;
    height: 30px;

    flex: 0 0 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #fff1e5;

    color: var(--ai-primary);

    font-size: 12px;
}


.garudachal-ai-typing-content {
    display: flex;
    align-items: center;
    gap: 4px;

    padding: 9px 11px;

    background: #ffffff;

    border:
        1px solid var(--ai-border);

    border-radius: 14px;
    border-top-left-radius: 5px;
}


.garudachal-ai-typing-content span {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: var(--ai-primary);

    animation:
        garudachal-ai-typing-dot
        1.2s
        infinite
        ease-in-out;
}


.garudachal-ai-typing-content span:nth-child(2) {
    animation-delay: 0.15s;
}


.garudachal-ai-typing-content span:nth-child(3) {
    animation-delay: 0.30s;
}


@keyframes garudachal-ai-typing-dot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}


.garudachal-ai-typing-text {
    font-size: 9px;

    color: #8b939f;
}


/* =========================================================
   Input Area
   ========================================================= */

.garudachal-ai-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;

    padding: 10px 12px;

    background: #ffffff;

    border-top:
        1px solid var(--ai-border);
}


/* =========================================================
   Input Wrapper
   ========================================================= */

.garudachal-ai-input-wrapper {
    flex: 1;

    min-width: 0;

    display: flex;
    align-items: flex-end;

    border:
        1px solid #dfe4eb;

    border-radius: 14px;

    background: #f9fafc;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


.garudachal-ai-input-wrapper:focus-within {
    background: #ffffff;

    border-color:
        rgba(255, 107, 0, 0.60);

    box-shadow:
        0 0 0 3px rgba(255, 107, 0, 0.08);
}


/* =========================================================
   Textarea
   ========================================================= */

.garudachal-ai-input-wrapper textarea {
    flex: 1;

    width: 100%;

    min-height: 42px;
    max-height: 100px;

    padding: 11px 8px 11px 13px;

    border: 0;
    outline: 0;

    resize: none;

    background: transparent;

    color: var(--ai-text);

    font-family: inherit;

    font-size: 12px;

    line-height: 1.45;
}


.garudachal-ai-input-wrapper textarea::placeholder {
    color: #9ba3af;
}


.garudachal-ai-input-wrapper textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* =========================================================
   Emoji Button
   ========================================================= */

.garudachal-ai-input-action {
    width: 34px;
    height: 38px;

    flex: 0 0 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;

    background: transparent;

    color: #8a94a3;

    cursor: pointer;

    font-size: 15px;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}


.garudachal-ai-input-action:hover {
    color: var(--ai-primary);

    transform: scale(1.08);
}


/* =========================================================
   Send Button
   ========================================================= */

.garudachal-ai-send {
    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            var(--ai-primary),
            #ff8126
        );

    color: #ffffff;

    cursor: pointer;

    font-size: 14px;

    box-shadow:
        0 6px 14px rgba(255, 107, 0, 0.20);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}


.garudachal-ai-send:hover {
    transform: translateY(-2px);

    box-shadow:
        0 9px 18px rgba(255, 107, 0, 0.27);
}


.garudachal-ai-send:active {
    transform: translateY(0);
}


.garudachal-ai-send:disabled {
    opacity: 0.55;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;
}


.garudachal-ai-send:focus-visible {
    outline: 3px solid rgba(255, 107, 0, 0.20);

    outline-offset: 2px;
}


/* =========================================================
   Footer
   ========================================================= */

.garudachal-ai-footer {
    min-height: 30px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    padding: 5px 12px 7px;

    background: #ffffff;

    color: #9aa2ad;

    font-size: 8px;

    border-top:
        1px solid rgba(230, 234, 240, 0.65);
}


.garudachal-ai-footer span {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    white-space: nowrap;
}


.garudachal-ai-footer i {
    color: var(--ai-success);
}


/* =========================================================
   Error Message
   ========================================================= */

.garudachal-ai-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;

    margin: 5px 0 14px;

    padding: 10px 12px;

    border:
        1px solid #ffd5d5;

    border-radius: 12px;

    background: #fff7f7;

    color: #a33a3a;

    font-size: 11px;

    line-height: 1.5;
}


.garudachal-ai-error i {
    margin-top: 2px;

    color: #d9534f;
}


/* =========================================================
   Disabled State
   ========================================================= */

.garudachal-ai.is-disabled
.garudachal-ai-button {
    opacity: 0.65;

    cursor: not-allowed;
}


.garudachal-ai.is-disabled
.garudachal-ai-button:hover {
    transform: none;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 767px) {

    .garudachal-ai-button {

        right: 16px;
        bottom: 16px;

        min-width: 58px;

        width: 58px;
        height: 58px;

        padding: 4px;

        justify-content: center;

        border-radius: 50%;
    }


    .garudachal-ai-button-icon {

        width: 50px;
        height: 50px;

        flex-basis: 50px;
    }


    .garudachal-ai-button-text {
        display: none;
    }


    .garudachal-ai-button::after {

        left: 4px;
        top: 4px;

        width: 50px;
        height: 50px;
    }


    .garudachal-ai-window {

        left: 10px;
        right: 10px;

        bottom: 84px;

        width: auto;

        height:
            calc(100vh - 105px);

        max-height: 720px;

        min-height: 420px;

        border-radius: 18px;

        transform-origin: bottom center;
    }


    .garudachal-ai-header {

        min-height: 70px;

        padding: 12px;
    }


    .garudachal-ai-avatar {

        width: 42px;
        height: 42px;

        flex-basis: 42px;

        font-size: 17px;
    }


    .garudachal-ai-header-info h2 {
        font-size: 14px;
    }


    .garudachal-ai-header-info p {
        font-size: 9px;
    }


    .garudachal-ai-header-btn {

        width: 32px;
        height: 32px;
    }


    .garudachal-ai-messages {

        padding:
            16px
            11px
            12px;
    }


    .garudachal-ai-message-content {
        max-width: 86%;
    }


    .garudachal-ai-message-bubble {
        font-size: 12px;

        line-height: 1.6;
    }


    .garudachal-ai-quick-questions {

        padding-left: 37px;

        gap: 6px;
    }


    .garudachal-ai-quick-question {

        font-size: 9px;

        min-height: 32px;

        padding: 6px 9px;
    }


    .garudachal-ai-footer {

        font-size: 7px;

        padding-left: 10px;
        padding-right: 10px;
    }

}


/* =========================================================
   Small Mobile
   ========================================================= */

@media (max-width: 420px) {

    .garudachal-ai-window {

        left: 7px;
        right: 7px;

        bottom: 78px;

        height:
            calc(100vh - 90px);

        border-radius: 16px;
    }


    .garudachal-ai-message-content {
        max-width: 88%;
    }


    .garudachal-ai-footer span:last-child {
        display: none;
    }


    .garudachal-ai-input-area {

        padding:
            8px;
    }


    .garudachal-ai-send {

        width: 42px;
        height: 42px;

        flex-basis: 42px;
    }

}


/* =========================================================
   Very Small Devices
   ========================================================= */

@media (max-width: 360px) {

    .garudachal-ai-button {

        right: 12px;
        bottom: 12px;
    }


    .garudachal-ai-window {

        left: 4px;
        right: 4px;

        bottom: 76px;
    }


    .garudachal-ai-header-info p {
        max-width: 145px;
    }


    .garudachal-ai-quick-question {
        font-size: 8px;
    }

}


/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .garudachal-ai *,
    .garudachal-ai *::before,
    .garudachal-ai *::after {

        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;

        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
    }

}