﻿.chat-icon {
    position: fixed;
    right: 10px;
    bottom: 20px;
    min-width: 64px;
    height: 64px;
    padding: 8px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    z-index: 999;
    /*    background: linear-gradient(135deg,#4f46e5,#06b6d4);*/
    background-color: #0081fb;
    box-shadow: 0 8px 26px rgba(14,22,37,0.28);
    transition: transform .12s ease, box-shadow .12s ease;
    border: none;
}

    .chat-icon:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 30px rgba(14,22,37,0.32);
    }

    .chat-icon .logo {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        background-color: #0081fb;
    }

        .chat-icon .logo svg {
            width: 30px;
            height: 30px;
            fill: #fff;
/*            fill: #0081fb;*/
        }

    .chat-icon .start-label {
        color: #fff;
        font-weight: 500;
        font-size: 16px;
        white-space: nowrap;
        user-select: none;
        padding-right: 6px;
    }

    .chat-icon .caret {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 8px;
        background: rgba(255,255,255,0.12);
    }

        .chat-icon .caret svg {
            width: 16px;
            height: 16px;
            fill: #fff;
        }


.chat-modal .modal-dialog {
    max-width: 420px;
    width: calc(100% - 40px);
}

.chat-modal .modal-content {
    height: 450px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(8,10,15,0.12);
    display: flex;
    flex-direction: column;
    z-index:1299;
}

.chat-header {
    /*    background: linear-gradient(90deg,#0b1220,#0f1724);*/
    background-color: #0081fb;
    color: #fff;
/*    padding: 0.6rem 0.9rem;*/
}

    .chat-header small {
        color: rgba(255,255,255,0.78);
        display: block;
        font-weight: 400;
    }

.chat-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0.9rem;
    background: #f6f8fa;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.chat-row {
    display: flex;
    width: 100%;
    align-items: flex-end;
}

    .chat-row.ai {
        justify-content: flex-start;
    }

    .chat-row.user {
        justify-content: flex-end;
    }

.chat-bubble {
    display: block;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.35;
    box-shadow: 0 1px 0 rgba(15,23,42,0.03);
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
    opacity: 0;
    transform: translateY(6px);
    animation: bubbleIn .14s ease forwards;
}

    .chat-bubble.ai {
        background: #fff;
        color: #0f1724;
        border: 1px solid rgba(15,23,42,0.04);
    }

    .chat-bubble.user {
        background: #1d4ed8;
        color: #fff;
    }

.chat-meta {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

.conversation-ended {
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    margin-top: 8px;
    opacity: 0;
    animation: fadeIn .22s ease forwards;
}

.chat-footer {
    padding: 0.4rem 0.5rem;
    background: #ffffff;
}

    .chat-footer .form-control {
        height: 32px; 
        font-size: 13px;
        padding: 0 10px;
        border-radius: 8px;
        background-color: #f3f4f6;
        border: 1px solid #e5e7eb;
    }

        .chat-footer .form-control:focus {
            background-color: #ffffff;
            border-color: #0081fb;
            box-shadow: 0 0 0 1px rgba(0,129,251,0.25);
        }

    .chat-footer .btn-send {
        height: 32px;
        font-size: 13px;
        padding: 0 12px;
        border-radius: 8px;
    }

    .chat-footer .btn-outline-secondary,
    .chat-footer .btn-end {
        height: 32px;
        width: 32px;
        padding: 0;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .chat-footer button svg {
        width: 18px;
        height: 18px;
    }

    .chat-footer .input-group > .form-control {
        flex: 1 1 auto;
    }


.input-group .form-control {
    border-right: 0;
}

.btn-send {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    min-width: 78px;
}

.btn-end {
    margin-left: 8px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-mic-muted {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
}

#connection-badge {
    font-size: 1rem; 
    padding: 0.5rem 0.75rem; 
    border-radius: 999px; 
    font-weight: 500;
    line-height: 1;
}

    #connection-badge .status-dot {
        width: 13px;
        height: 13px;
        border-radius: 50%;
        display: inline-block;
    }


@keyframes bubbleIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.chat-modal.minimized .modal-dialog .modal-content {
    height: auto;
    max-height: none;
}

.chat-modal.minimized .chat-body,
.chat-modal.minimized .chat-footer {
    display: none;
}

.chat-modal.minimized .modal-dialog {
    width: auto;
    min-width: 220px;
}

.chat-modal .modal-dialog.position-fixed {
    bottom: 60px !important;
}

.tc-modal {
    z-index: 1099;
}

.tc-modal .modal-dialog.position-fixed,
.tc-modal .modal-dialog.position-fixed.bottom-0.end-0,
.tc-modal .modal-dialog.position-fixed.bottom-0.end-0.mb-5.me-3 {
    max-width: 420px;
    width: calc(100% - 40px);
    margin: 0;
    bottom: 60px !important; 
    right: 20px !important;
    transition: transform .12s ease, opacity .12s ease;
}

.tc-modal .modal-content {
    height: auto; 
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(8,10,15,0.12);
    display: flex;
    flex-direction: column;
}

.tc-modal .modal-body {
    padding: 0.9rem 1rem;
    font-size: 14px;
    color: #333;
    line-height: 1.45;
    background: #f6f8fa; 
}

.tc-modal .modal-header {
    background: linear-gradient(90deg,#0b1220,#0f1724);
    color: #fff;
    padding: 0.6rem 0.9rem;
    border-bottom: none;
}

.tc-modal .modal-footer {
    border-top: 1px solid rgba(15,23,42,0.04);
    padding: .6rem .75rem;
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}


.tc-header {
    background-color: #0081fb; 
    color: #fff;
    padding: 0.4rem 0.6rem; 
    display: flex;
    align-items: center;
    min-height: 36px;
}

    .tc-header .modal-title {
        margin: 0;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.2;
    }


.tc-modal .modal-content > .tc-header {
    background-color: #0081fb !important;
    color: #fff !important;
    padding: 0.4rem 0.6rem !important;
    min-height: 36px;
    display: flex;
    align-items: center;
}

    .tc-modal .modal-content > .tc-header .modal-title {
        margin: 0;
        font-size: 14px;
        font-weight: 500;
    }

/* Footer */
.tc-modal .modal-content > .tc-footer {
    background: #ffffff !important;
    padding: 0.4rem 0.5rem !important;
    border-top: 1px solid rgba(15,23,42,0.04);
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

    .tc-modal .modal-content > .tc-footer .btn {
        height: 32px;
        font-size: 13px;
        padding: 0 12px;
        border-radius: 8px;
    }



.userdetails-modal .modal-dialog.position-fixed {
    max-width: 420px;
    width: calc(100% - 40px);
    margin: 0;
    bottom: 570px !important;
    right: 20px;
    z-index: 1199; /* above chat modal */
    transition: transform .12s ease, opacity .12s ease;
    position: fixed; 
}

.userdetails-modal .modal-content {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(8,10,15,0.12);
    display: flex;
    flex-direction: column;
}

    .userdetails-modal .modal-content > .ud-header {
        background-color: #0081fb !important;
        color: #fff !important;
        padding: 0.4rem 0.6rem !important;
        min-height: 36px;
        display: flex;
        align-items: center;
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
    }

        .userdetails-modal .modal-content > .ud-header .modal-title {
            margin: 0 !important;
            font-size: 14px;
            font-weight: 500;
            line-height: 1.2;
        }

.user-details {
    font-size: 14px;
    line-height: 1.5;
}

    .user-details strong {
        font-weight: 600;
    }


@media (max-width:576px) {
    .chat-modal .modal-dialog.position-fixed {
        bottom: 40px !important;
        width: calc(100% - 24px);
    }

    .btn-send {
        min-width: 64px;
    }

    .chat-icon {
        right: 12px;
        bottom: 12px;
        padding: 6px 8px;
        min-width: 56px;
        height: 56px;
        gap: 8px;
    }

        .chat-icon .start-label {
            display: none; 
        }

    .tc-modal .modal-dialog.position-fixed {
        bottom: 140px !important;
        width: calc(100% - 24px);
        right: 12px !important;
    }

    .userdetails-modal .modal-dialog.position-fixed {
        bottom: 560px !important;
        right: 12px !important;
        width: calc(100% - 24px);
    }
}
