/* ==========================================================================
   CGI AGENCY CHATBOT (INSUR / AAA STYLE)
   ========================================================================== */

/* Floating Launcher Button */
.cgi-chat-launcher {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 62px;
    height: 62px;
    background: linear-gradient(135deg, #0056b3 0%, #003366 100%);
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(0, 51, 102, 0.35);
    cursor: pointer;
    z-index: 999990;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #ffffff;
}

.cgi-chat-launcher:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 51, 102, 0.45);
}

.cgi-chat-launcher-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #f26522;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid #ffffff;
    animation: cgiChatPulse 2s infinite;
}

@keyframes cgiChatPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.cgi-chat-launcher svg {
    width: 30px;
    height: 30px;
    fill: #ffffff;
    transition: transform 0.3s ease;
}

.cgi-chat-launcher.is-active svg.cgi-chat-icon-open {
    display: none;
}
.cgi-chat-launcher:not(.is-active) svg.cgi-chat-icon-close {
    display: none;
}

/* Chatbot Window Container */
.cgi-chatbot-box {
    position: fixed;
    bottom: 98px;
    right: 25px;
    width: 390px;
    max-width: calc(100vw - 30px);
    height: 620px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 15px 45px rgba(0, 30, 60, 0.22);
    border: 1px solid rgba(0, 51, 102, 0.12);
    z-index: 999995;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.96);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cgi-chatbot-box.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Header (Royal Blue matching reference screenshot) */
.cgi-chat-header {
    background: #004b93;
    background: linear-gradient(90deg, #003e7d 0%, #0056b3 100%);
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    flex-shrink: 0;
}

.cgi-chat-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cgi-chat-logo {
    height: 30px;
    width: auto;
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 5px;
}

.cgi-chat-title-group {
    display: flex;
    flex-direction: column;
}

.cgi-chat-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: #ffffff;
    line-height: 1.2;
}

.cgi-chat-status {
    font-size: 11px;
    color: #a8d5ff;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.cgi-chat-status-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #22c55e;
}

.cgi-chat-close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.cgi-chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cgi-chat-close-btn svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
    stroke-width: 2.2;
}

/* Chat Body */
.cgi-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 18px;
    background: #fbfcfe;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

/* Scrollbar */
.cgi-chat-body::-webkit-scrollbar {
    width: 5px;
}
.cgi-chat-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Big Heading like reference: "How can we help you today?" */
.cgi-chat-greeting-title {
    font-size: 27px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin: 4px 0 10px 0;
    color: #003e7d;
}

.cgi-chat-greeting-title .cgi-highlight {
    background: linear-gradient(135deg, #7c1d56 0%, #b91c1c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Notice / Disclaimer Bubble */
.cgi-chat-disclaimer {
    background: #ebf4fc;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 12.5px;
    color: #334155;
    line-height: 1.45;
    border: 1px solid #d3e5f5;
}

.cgi-chat-disclaimer a {
    color: #0056b3;
    text-decoration: underline;
    font-weight: 600;
}

/* Bot Message Bubble */
.cgi-chat-bubble {
    background: #ebf4fc;
    color: #1e293b;
    padding: 13px 15px;
    border-radius: 14px 14px 14px 2px;
    font-size: 13.5px;
    line-height: 1.5;
    max-width: 90%;
    align-self: flex-start;
    border: 1px solid #ddecfa;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

/* User Message Bubble */
.cgi-chat-bubble-user {
    background: #0056b3;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 14px 14px 2px 14px;
    font-size: 13.5px;
    line-height: 1.45;
    max-width: 85%;
    align-self: flex-end;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.25);
}

/* Interactive Pill Quick-Replies (Matches screenshot) */
.cgi-chat-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 4px;
}

.cgi-chat-pill {
    background: #ffffff;
    border: 1.5px solid #b8d7f5;
    border-radius: 30px;
    padding: 11px 18px;
    color: #004b93;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 75, 147, 0.06);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.cgi-chat-pill:hover {
    border-color: #0056b3;
    background: #f0f7ff;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 75, 147, 0.14);
    color: #003366;
}

.cgi-chat-pill .cgi-pill-icon {
    font-size: 16px;
    margin-left: 8px;
}

/* Typing Indicator Animation */
.cgi-chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #ebf4fc;
    padding: 10px 14px;
    border-radius: 14px;
    align-self: flex-start;
    width: fit-content;
}
.cgi-chat-typing span {
    width: 6px;
    height: 6px;
    background: #0056b3;
    border-radius: 50%;
    animation: cgiTyping 1.4s infinite ease-in-out both;
}
.cgi-chat-typing span:nth-child(1) { animation-delay: -0.32s; }
.cgi-chat-typing span:nth-child(2) { animation-delay: -0.16s; }
@keyframes cgiTyping {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
.cgi-chat-footer {
    padding: 12px 16px 14px 16px;
    background: #ffffff;
    border-top: 1px solid #eef2f6;
    flex-shrink: 0;
}

.cgi-chat-input-wrapper {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 30px;
    padding: 4px 6px 4px 18px;
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
}

.cgi-chat-input-wrapper:focus-within {
    background: #ffffff;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.12);
}

.cgi-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 13.5px;
    color: #0f172a;
    font-family: inherit;
    padding: 8px 0;
}

.cgi-chat-input::placeholder {
    color: #94a3b8;
}

.cgi-chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #0056b3;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cgi-chat-send-btn:hover {
    background: #003e7d;
    transform: scale(1.05);
}

.cgi-chat-send-btn svg {
    width: 17px;
    height: 17px;
    fill: #ffffff;
}

/* Disclaimer text at bottom */
.cgi-chat-footer-note {
    font-size: 10.5px;
    text-align: center;
    color: #64748b;
    margin-top: 8px;
    line-height: 1.35;
}

.cgi-chat-footer-note a {
    color: #0056b3;
    text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .cgi-chatbot-box {
        bottom: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .cgi-chat-launcher {
        bottom: 18px;
        right: 18px;
        width: 56px;
        height: 56px;
    }
}
