/* CHAT WINDOW */
#chatWidget {
    /*position: fixed;
    bottom: 15px;
    right: 65px;
    width: 360px;
    max-height: 500px;
    background: #ffffff;
    border-radius: 16px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    z-index: 999991 !important;*/

    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    border-radius: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    z-index: 999991 !important;
    /*height: 92.4vh;*/
}

/* HEADER */
.chat-header {
    background: #2aa7e8;
    color: #ffffff;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.chat-header-left img{
    border: 1px solid white;
}

.chat-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

/* MESSAGES */
#chatMessages {
    flex: 1;
    padding: 12px;
    background: #f5f9ff;
    overflow-y: auto;
    /*height: 79.5vh;*/
}

/* MESSAGE ROW */
.chat-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.chat-row.user {
    flex-direction: row-reverse;
}

/* MESSAGE BUBBLE */
.chat-bubble {
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
}

/* USER MESSAGE */
.chat-row.user .chat-bubble {
    background: #2aa7e8;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}
.chat-bubble p{
    margin-bottom: 0.5rem !important;
}
.chat-bubble p:last-child{
    margin-bottom: 0rem !important;
}

/* BOT MESSAGE */
.chat-row.bot .chat-bubble {
    background: #ffffff;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

/* AVATAR */
.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* NAME */
.chat-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
    color: #6b7280;
}

/* INPUT */
.chat-input {
    display: flex;
    gap: 20px;
    padding: 10px 20px;
    border-top: 1px solid #e5e7eb;
}

.chat-input input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 14px;
}

.chat-input button {
    background: #2aa7e8;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 600;
}

.chat-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.chat-close-btn i {
    font-size: 14px;
}

.chat-typing {
    display: flex;
    gap: 4px;
    padding: 10px 12px;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    background: #6b7280;
    border-radius: 50%;
    animation: chatTyping 1.4s infinite both;
}

.chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

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

@keyframes chatTyping {
    0% { opacity: 0.3; }
    20% { opacity: 1; }
    100% { opacity: 0.3; }
}

.chat-quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.chat-quick-options button {
    background: #f1f5f9;
    border: 1px solid #dbe3ec;
    border-radius: 14px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
}

.chat-quick-options button:hover {
    background: #e8f2ff;
}

.chat-typing {
    display: flex;
    gap: 4px;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: blink 1.4s infinite both;
}

.chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

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

@keyframes blink {
    0% { opacity: .2; }
    20% { opacity: 1; }
    100% { opacity: .2; }
}

/* =========================
   MODERN CHAT ENHANCEMENTS
   ========================= */

@keyframes pulse {
    0% { transform: scale(1); opacity: .7; }
    70% { transform: scale(1.6); opacity: 0; }
    100% { opacity: 0; }
}

/* Chat open animation */
.chat-animate {
    animation: chatOpen .25s ease-out;
}

@keyframes chatOpen {
    from {
        opacity: 0;
        transform: translateY(15px) scale(.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Glass effect */
#chatWidget {
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,.95);
}

/* Header polish */
.chat-header {
    background: linear-gradient(135deg, #2aa7e8, #5b86e5);
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.15);
}

/* Messages smoother */
#chatMessages {
    scrollbar-width: thin;
}

#chatMessages::-webkit-scrollbar {
    width: 6px;
}
#chatMessages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.15);
    border-radius: 6px;
}

/* Message bubble depth */
.chat-bubble {
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
    animation: msgIn .2s ease-out;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* User bubble gradient */
.chat-row.user .chat-bubble {
    background: linear-gradient(135deg, #2aa7e8, #5b86e5);
}

/* Input modern feel */
.chat-input input {
    transition: border .2s ease, box-shadow .2s ease;
}

.chat-input input:focus {
    outline: none;
    border-color: #2aa7e8;
    box-shadow: 0 0 0 3px rgba(42,167,232,.25);
}

/* Send button hover */
.chat-input img,
.chat-input button {
    transition: transform .15s ease, box-shadow .15s ease;
}

.chat-input img:hover,
.chat-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(42,167,232,.4);
}

/* Typing indicator softer */
.chat-typing span {
    background: #2aa7e8;
}

/* Avatar ring */
.chat-avatar,
.chat-avatar-sm {
    box-shadow: 0 0 0 2px #ffffff, 0 4px 12px rgba(0,0,0,.15);
}

.chat-row + .chat-row.user .chat-bubble {
    border-top-right-radius: 14px;
}

.chat-row + .chat-row.bot .chat-bubble {
    border-top-left-radius: 14px;
}
.chat-typing {
    position: relative;
}

.chat-typing::before {
    content: "";
    position: absolute;
    inset: -6px;
    background: radial-gradient(circle, rgba(42,167,232,.25), transparent 70%);
    filter: blur(8px);
    opacity: .6;
}
#chatWidget {
    background:
        linear-gradient(
            rgba(255,255,255,.92),
            rgba(255,255,255,.92)
        ),
        radial-gradient(
            circle at top right,
            rgba(42,167,232,.15),
            transparent 40%
        );
}
.chat-input img:active,
.chat-input button:active {
    transform: scale(.96);
}
.chat-avatar-sm {
    transition: transform .2s ease;
}

.chat-header:hover .chat-avatar-sm {
    transform: rotate(-6deg) scale(1.05);
}


.main-chat-section{
    width: 100% !important;
    display: flex;
    /*height: 100%;*/
}
.main-chat-section .left-chat{
    width: 333px;
    /*height: 100%;*/
    /*opacity: 1;*/
    transition: 0.1s ease-in-out;
}
.main-chat-section .left-chat.toggle{
    width: 62px !important;
    /*animation: msgIn .2s ease-out;*/
    /*opacity: 0.95;*/
}
.main-chat-section .right-chat{
    width: 100% !important;
    /*height: 100%;*/
}
#chatWidget .left-chat.toggle .conversion-section{
    border-right: 0 !important;
}
.main-chat-section .sidebar {
    width: 100%;
    /*background: #ffffff;*/
    background: transparent;
    border-right: 1px solid #e5e7eb;
    padding: 12px;
    /*height: 100%;*/
    padding-right: 0;
}

.main-chat-section .sidebar-header {
    /*display: flex;
    gap: 14px;
    padding: 11px 6px 18px;
    border-bottom: 1px solid #e5e7eb;*/
    /*display: flex;*/
    display: block;
    align-items: center;
    gap: 10px;
    /*padding: 8px;*/
    padding: 0px 0px 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.main-chat-section .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.main-chat-section .icon-btn i {
    font-size: 14px;
    color: #374151;
}

.main-chat-section .icon-btn:hover {
    background: #ffffff;
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.main-chat-section .icon-btn:active {
    transform: scale(0.96);
}
.main-chat-section .sidebar-header i {
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
}

.main-chat-section .sidebar-header i:hover {
    opacity: 0.7;
}

.main-chat-section .sidebar-section {
    margin-top: 16px;
}

.main-chat-section .section-title {
    font-size: 12px;
    color: #6b7280;
    margin: 8px 6px;
    text-transform: capitalize;
    padding: 0 !important;
    text-align: left !important;
    font-weight: 600 !important;
}

.main-chat-section .sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-chat-section .sidebar-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.main-chat-section .sidebar-list li:hover {
    background: #f3f4f6;
}

.main-chat-section .sidebar-list i {
    font-size: 14px;
    color: #374151;
    min-width: 18px;
}

.main-chat-section .sidebar-list span {
    font-size: 14px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#chatSendBtn {
    border-radius: 50% !important;
    padding: 0 3px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
}
#chatSendBtn i{
    font-size: 33px;
}
.chat-input .mick{
    padding: 5px 0;
    cursor: pointer;
}
.chat-input .mick img{

}


/*welcome card */

.welcome {
    padding: 24px;
    max-width: 100%;
}

.welcome-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.welcome-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.wave {
    font-size: 18px;
}

.welcome-sub {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 18px;
}

.welcome-title {
    font-size: 32px;
    line-height: 1.2;
    font-weight: 600;
    margin-bottom: 24px;
}

.welcome-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.welcome-card {
    /*background: #f9fafb;*/
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #4cb0e8;
    /*border-radius: 8px;
    padding: 8px 10px;*/
    color: white !important;
}

.welcome-card:hover {
    background: #ffffff;
    border-color: #d1d5db;
    transform: translateY(-2px);
}

.card-icon img{
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 14px;
    margin-bottom: 40px;
}

.welcome-card p {
    font-size: 14px;
    /*color: #111827;*/
    color: white !important;
    margin: 0;
    line-height: 1.4;
}
.welcome-card:hover p {
    color: #111827 !important;
}
/*welcome card end*/

#chatWidget .active {
    background: #f0f0f0;
    font-weight: 600;
}
#chatWidget .conversion-section{
    overflow-y: auto;
    /*height: 86vh;*/
    scrollbar-width: thin;
}
#chatWidget .conversion-section::-webkit-scrollbar {
    width: 6px;
}
#chatWidget .conversion-section::-webkit-scrollbar-thumb {
    background: #2aa7e8;
    border-radius: 6px;
}
#sidebarToggleBtn{
    /*margin-right: 12px;*/
}
.main-chat-section .left-chat.toggle .sidebar-header {
    border-bottom: 0 !important;
}
.scroll-top{
    z-index: 1111 !important;
}

/* Session item */
.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.session-item:hover {
    background: #f4f6f8;
}

/* Left side (icon + title) */
.session-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.session-icon {
    font-size: 14px;
    color: #6b7280;
}

.session-title {
    font-size: 14px;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right side actions */
.session-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.session-item:hover .session-actions {
    opacity: 1;
}

.session-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    color: #6b7280;
}

.session-actions button:hover {
    background: #e5e7eb;
}

.session-delete {
    color: #dc2626;
}

.session-delete:hover {
    background: #fee2e2;
}


/*update css*/
#chatWidget {
    position: fixed;
    bottom: 14px;
    right: 14px;
    width: 100%;
    background: #ffffff;
    border-radius: 10px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    z-index: 11111 !important;
    /*height: 88vh;*/
    /*height: 87.8vh;*/
    max-width: 70%;
}

#chatMessages {
    /*height: 74.8vh;*/
}

#chatWidget .conversion-section {
    /*height: 81.4vh;*/
}

.main-chat-section .sidebar-header {
    display: block;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(295deg, #2aa7e8, #5b86e5);
}
.main-chat-section .sidebar {
    padding: 0;
    border-right: 0;
}
#chatWidget .conversion-section {
    padding-left: 10px;
    padding-right: 10px;
}
#chatWidget .conversion-section {
    border-right: 1px solid #e5e7eb;
}
.main-chat-section .toggle .sidebar-header {
    background: linear-gradient(180deg, #2aa7e8, #5b86e5) !important;
}

.mick.listening img {
    filter: drop-shadow(0 0 6px #4caf50);
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.session-actions {
    gap: 0px;
}

.main-chat-section .left-chat {
    width: 300px;
    max-width: 300px;
}
.main-chat-section .right-chat {
    width: 100% !important;
    transition: 0.1s ease-in-out;
    /*height: 100%;*/
}
.chat-row.user .chat-bubble {
    border-radius: 14px;
    border-top-right-radius: 2px !important;
}
.chat-row.bot .chat-bubble {
    border-radius: 14px;
    border-top-left-radius: 2px !important;
}
.main-chat-section .sidebar-header{
    /*height: 6.2vh;*/
}
.chat-header{
    /*height: 6.1vh;*/
}
.chat-input {
    /*height: 6.9vh;*/
}

#chatWidget{
    /*height: 89dvh;*/
    height: 700px;
    width: 60%;
    background: unset;
}
.main-chat-section .sidebar-header {
    /*height: 6dvh;*/
    height: 56px;
    border: 0;
}
.chat-header {
    /*height: 5.9dvh;*/
    height: 56px;
}
#chatMessages {
    /*height: 76.3dvh;*/
    height: 585px;
}
#chatWidget .conversion-section {
    /*height: 82.9dvh;*/
    height: 644px;
    background: #FFFFFF;
}
.chat-input {
    /*height: 6.8vh;*/
    /*height: unset;*/
    background: #FFF;
    padding: 9px 20px;
    height: 61px;
}
.h-100-dvh {
    height: 100dvh !important;
}
.main-chat-section .sidebar-section {
    margin-top: 10px;
}
.main-chat-section .section-title {
    margin: 0 0 0 0;
    padding: 8px 10px !important;
    background: #f5f9ff;
}
.main-chat-section .sidebar-list {
    margin: 10px 0 0 0;
}

@media (max-width: 1070px) {
    #chatMessages {
        height: 583px;
    }
    #chatWidget {
        width: 95%;
        max-width: 100%;
    }
    .main-chat-section {
        width: 100% !important;
    }
    .chat-input input{
        width: 100% !important;
    }
    .chat-input {
        /*height: unset;*/
    }
}

@media (max-width: 450px) {
    /*#chatWidget {
        width: 94%;
        max-width: 100%;
    }
    .main-chat-section{
        width: 85% !important;
    }*/
}
.chat-error-message {
    font-size: 14px;
    line-height: 1.5;
}

.chat-error-message a {
    color: #1a73e8;
    text-decoration: underline;
}


.chat-action {
    /*margin-top: 8px;*/
    /*max-width: 200px;*/
    max-width: fit-content;
    background: #4cb0e8;
    border-radius: 8px;
    padding: 8px 10px;
    color: white !important;
    cursor: pointer !important;
    margin-bottom: 0.5rem !important;
}
.chat-action:last-child{
    margin-bottom: 0 !important;
}

.chat-action-btn {
    cursor: pointer;
    color: white !important;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer !important;
}

.chat-action-btn:hover {
    opacity: 0.85;
}
.card-icon img{
    margin-bottom: 5px !important;
}
.chat-suggestions{
    /*display: inline-flex;*/
    display: grid;
    /*gap: 10px;*/
}
#chatToggleBtn {
    position: fixed;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0px 0px 35px rgb(0 168 255);
    transition: transform .18s cubic-bezier(.34,1.56,.64,1);
    bottom: 15px !important;
    right: 80px !important;
    width: 140px !important;
    height: auto;
    background: #FFFFFF !important;
    z-index: 1;
    border-radius: 10px !important;
    padding: 10px 10px !important;
}
#chatToggleBtn:hover{
    box-shadow: 0px 0px 35px rgba(42, 167, 232, .45);
    transition: transform .40s cubic-bezier(.34,1.56,.64,1);
    transform: scale(1.03);
}
#chatToggleBtn img{
    width: 100%;
}
