/* Floating Launcher Button */
.chatbot-launcher {
    position: fixed;
    width: 214px;
    height: 47px;
    right: 40px;
    bottom: -2px;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-launcher:hover {
    filter: drop-shadow(0 4px 15px rgba(241, 101, 34, 0.4));
}

.chatbot-launcher svg {
    display: block;
    width: 100%;
    height: 100%;
}

.chatbot-launcher svg path {
    transition: fill-opacity 0.3s ease;
}

.chatbot-launcher:hover svg path:nth-child(1),
.chatbot-launcher:hover svg path:nth-child(2) {
    fill-opacity: 0.85;
}

/* Full-Screen Glassmorphic Search Overlay */
.chatbot-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 242, 223, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    font-family: "Montserrat", sans-serif;
    overflow-x: hidden;
}

.chatbot-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Close Button */
.chatbot-close-btn {
    position: absolute;
    top: 40px;
    right: 50px;
    background: transparent;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.chatbot-close-btn svg path {
    fill: #404040 !important;
    transition: fill 0.2s ease;
}

.chatbot-close-btn:hover svg path {
    fill: #f16522 !important;
}

/* Search/Chat Container */
.chatbot-search-container {
    width: 100%;
    max-width: 80vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}


.chatbot-welcome-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start;
    flex-grow: 1;
    text-align: center;
    transition: opacity 0.25s ease;
    margin-top: 40px;
    opacity: 1;
}

.chatbot-welcome-area.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.chatbot-logo {
    height: 80px;
    margin-bottom: 20px;
    display: inline-block;
}

.chatbot-welcome-title {
    font-family: "Montserrat", sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #f16522;
    margin: 0 0 10px 0;
}

.chatbot-welcome-subtitle {
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    color: #555555;
    max-width: 500px;
    line-height: 1.5;
    margin: 0;
}

/* Chat Logs Area */
.chatbot-chat-logs {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-right: 10px;
    margin-bottom: 20px;
}

/* Scrollbar */
.chatbot-chat-logs::-webkit-scrollbar {
    width: 6px;
}
.chatbot-chat-logs::-webkit-scrollbar-track {
    background: transparent;
}
.chatbot-chat-logs::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* User Message Bubble */
.chatbot-msg-user {
    align-self: flex-end;
    max-width: 75%;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    padding: 20px;
    color: #404040;
    font-size: 15px;
    line-height: 1.5;
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.01),
        inset 2px 2px 10px rgba(0, 0, 0, 0.01),
        inset -2px -2px 12px rgba(255, 255, 255, 0.9);
    animation: chatbot-fade-up 0.3s ease forwards;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Bot Message Bubble */
.chatbot-msg-bot {
    align-self: flex-start;
    width: 100%;
    max-width: 85%;

    /* 1. Transparent glass base using your exact color hex */
    background: #F165221F;

    /* 2. Softened border color to mimic Figma's clean edge blend */
    border: 1px solid rgba(241, 101, 34, 0.08);
    border-radius: 10px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;

    /* 3. Extremely minimal bevel/emboss:
       Reduced the top white highlight down to an ultra-faint 0.2 opacity and removed the dark drop shadow entirely */
    box-shadow:
        inset 0 1px 0px rgba(255, 255, 255, 0.2);

    /* 4. Enhanced frosted glass effect (essential for the glassy vibe over your gradients) */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    /* Animation & Text Wrapping */
    animation: chatbot-fade-up 0.3s ease forwards;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.chatbot-bot-text {
    color: #404040;
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Chat Results Cards */
.chatbot-chat-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chatbot-chat-card {
    background: #ffffff;
    border: 1px solid rgba(241, 101, 34, 0.15);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.chatbot-chat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 101, 34, 0.1);
}

.chatbot-card-img {
    width: 80px;
    height: 105px;
    object-fit: cover;
    border-radius: 6px;
    background: #eaeaea;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chatbot-card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chatbot-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-card-tag {
    background: rgba(241, 101, 34, 0.1);
    color: #f16522;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.chatbot-card-sector-date {
    color: #707070;
    font-size: 12px;
}

.chatbot-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #303030;
    margin: 0;
    line-height: 1.4;
}

.chatbot-card-desc {
    font-size: 13px;
    color: #606060;
    margin: 0;
    line-height: 1.4;
}

.chatbot-card-link {
    color: #f16522;
    font-size: 13px;
    font-weight: 600;
    margin-top: 5px;
    display: inline-block;
    text-decoration: underline;
}

/* Copy Toast Notification */
.chatbot-toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #404040;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100000;
    pointer-events: none;
}
.chatbot-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Pills Row (Positioned above input container) */
.chatbot-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    transition: opacity 0.3s ease;
}

.chatbot-pill {
    background: #ffffff;
    border: 1px solid #f16522;
    border-radius: 100px;
    padding: 8px 16px;
    color: black;
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chatbot-pill:hover {
    background: #f16522;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(241, 101, 34, 0.2);
}

/* Bottom Input Area */
.chatbot-input-area {
    width: 100%;
    flex-shrink: 0;
}

.chatbot-input-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    position: relative;
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.01),
        inset 2px 2px 10px rgba(0, 0, 0, 0.1),
        inset -2px -2px 6px rgba(255, 255, 255, 0.9);
    border: 1px solid rgb(255, 255, 255);
    height: 125px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.chatbot-input-field {
    width: calc(100% - 110px);
    border: none;
    outline: none;
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    line-height: 20px;
    color: #404040;
    background: transparent;
    padding: 0;
    height: 40px;
    max-height: 85px;
    resize: none;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    word-break: break-word;
    scrollbar-width: none;
}

.chatbot-input-field::-webkit-scrollbar {
    display: none;
}

.chatbot-input-field::placeholder {
    color: #404040;
    opacity: 0.9;
}

.chatbot-send-btn {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 98px;
    height: 34px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
}

.chatbot-stop-btn {
    position: absolute;
    background: transparent;
    right: 20px;
    bottom: 20px;
    width: 98px;
    height: 34px;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
}

.chatbot-send-btn:hover {
    transform: scale(1.02);
}

.chatbot-send-btn:active {
    transform: scale(0.98);
}

.chatbot-send-bg-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.chatbot-send-bg-svg path {
    fill: #f16522 !important;
    transition: fill 0.2s ease;
}

.chatbot-send-btn:hover .chatbot-send-bg-svg path {
    fill: #d85215 !important;
}

.chatbot-send-text-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    color: #ffffff;
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    line-height: 20px;
    font-weight: 400;
}

.chatbot-send-icon-svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Spinner & Animations */
.chatbot-loading-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 10px 0;
}
.chatbot-dot {
    width: 8px;
    height: 8px;
    background: #f16522;
    border-radius: 50%;
    animation: chatbot-dot-bounce 1.4s infinite ease-in-out both;
}
.chatbot-dot:nth-child(1) {
    animation-delay: -0.32s;
}
.chatbot-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes chatbot-dot-bounce {
    0%,
    80%,
    100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

@keyframes chatbot-fade-up {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Report Card (Frame 251) */
.chatbot-report-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
    gap: 10px;
    width: 100%;
    max-width: 663.17px;
    height: auto;
    min-height: 125px;
    background: rgba(241, 101, 34, 0.12);
    border-radius: 10px;
    box-sizing: border-box;
    text-decoration: none;
    margin-top: 15px;
    margin-bottom: 5px;
    align-self: flex-start;
    animation: chatbot-fade-up 0.3s ease forwards;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    overflow-x: hidden;
}

.chatbot-report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(241, 101, 34, 0.08);
}

.chatbot-report-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    height: auto;
    box-sizing: border-box;
}

.chatbot-report-img-wrapper {
    width: 79px;
    height: 105px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-report-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chatbot-report-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    gap: 5px;
    width: calc(100% - 90px);
    box-sizing: border-box;
}

.chatbot-report-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
}

.chatbot-report-type {
    font-family: "Montserrat", sans-serif;
    font-size: 10px;
    font-weight: 400;
    line-height: 12px;
    color: #404040;
}

.chatbot-report-title {
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 17px;
    color: #404040;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chatbot-report-meta {
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 17px;
    color: #404040;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chatbot-report-knowmore {
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 17px;
    color: #f16522;
}

/* Chatbot Markdown Response Styling */
.chatbot-bot-text p {
    margin: 0 0 10px 0;
}
.chatbot-bot-text p:last-child {
    margin-bottom: 0;
}
.chatbot-bot-text ul,
.chatbot-bot-text ol {
    margin: 8px 0 12px 20px;
    padding: 0;
}
.chatbot-bot-text li {
    margin-bottom: 6px;
    line-height: 1.5;
}
.chatbot-bot-text strong,
.chatbot-bot-text b {
    font-weight: 700;
    color: #303030;
}
.chatbot-bot-text a {
    color: #f16522;
    text-decoration: underline;
}
.chatbot-bot-text a:hover {
    color: #d85215;
}
.chatbot-bot-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}
.chatbot-bot-text th,
.chatbot-bot-text td {
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px;
    text-align: left;
}
.chatbot-bot-text th {
    background-color: rgba(241, 101, 34, 0.05);
    font-weight: 600;
}

/* small screen fixes */
@media (max-width: 576px) {
    .chatbot-launcher {
        width: 150px;
        height: 150px;
        bottom: -58px;
        right: 30px;
        fill-opacity: 0.8;
    }

    .chatbot-window {
        width: 100%;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
    }
    .chatbot-header {
        border-radius: 0;
    }
    .chatbot-main-content {
        border-radius: 0;
    }
}

.view-prev-conversation-btn {
    display: block;
    background: transparent;
    border: 0px;
    color: #f16522;
    padding: 6px 16px 0px 0px;
    font-family: "Montserrat", sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 0 0 auto;
    position: relative;
}

.view-prev-conversation-btn::after {
    content: "";
    position: absolute;
    left: 0px;
    right: 16px;
    bottom: 0px;
    height: 1px;
    background-color: #f16522;
    opacity: 0;
    transition: all 0.2s ease;
}

.view-prev-conversation-btn:hover::after {
    opacity: 1;
}

.chatbot-stop-btn {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 98px;
    height: 34px;
    border: none;
    background: transparent;
    padding: 0;
    transition: transform 0.2s ease;
}

.chatbot-stop-bg-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}
.chatbot-stop-bg-svg path {
    fill: #f16522 !important;
    transition: fill 0.2s ease;
}

.chatbot-stop-btn:hover .chatbot-send-bg-svg path {
    fill: #d85215 !important;
}
