.chat-header,
.chat-toggle-btn {
    color: var(--white);
    display: flex;
    align-items: center;
}
:root {
    --primary-color: #4b3ec9;
    --primary-dark: #2f24a3;
    --accent-color: #ff9d00;
    --accent-light: #ffaa2c;
    --white: #ffffff;
    --gray-light: #f8f9fb;
    --gray-medium: #e6e8ec;
    --gray-dark: #6b7280;
    --text-dark: #111827;
    --success: #10b981;
    --danger: #ef4444;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.4);
}
.floating-chat-container {
    position: fixed;
    bottom: 79px;
    right: 10px;
    z-index:  1000;
}
.chat-toggle-btn {
    height: 50px;
    width: 50px;
    border: none;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    animation: 2s infinite pulse;
    background: 0 0;
    position: fixed;
    right: 9px;
    bottom: 78px;
}
.chat-toggle-btn img {
    height: 59px;
    width: auto;
}
.chat-toggle-btn:hover .tooltip-accessibility {
    opacity: 1;
    transform: translateY(-50%) translateX(-8px);
}
.chat-toggle-btn::before {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #fff0 var(--primary-dark) #fff0 #fff0;
    opacity: 0;
    transition: opacity 0.4s;
}
.chat-toggle-btn.show-tooltip::after,
.chat-toggle-btn.show-tooltip::before,
.chat-toggle-btn:hover::after,
.chat-toggle-btn:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
.chat-toggle-btn:hover {
    transform: scale(1.08);
}
.chat-toggle-btn i {
    font-size: 1.6rem;
}

.chat-window {
    width: 359px;
    height: 580px;
    border-radius: 18px;
    background: rgb(255 255 255);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 12px 35px rgb(0 0 0 / 0.15);
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 16px;
    display: none;
    transition: 0.4s ease-in-out;
}

.avatar,
.icon-btn,
.status-indicator {
    border-radius: 50%;
}
.chat-window.show {
    display: flex;
    animation: 0.4s fadeIn;
}
.dropdown-item::before,
.dropdown-toggle::after {
    display: none !important;
}
.chat-window.expanded {
    width: 480px;
    height: 720px;
    transition: 0.4s;
}
.chat-header {
    background:
        linear-gradient(90deg, #ee6b25 0, #ef892cd1 100%) 118% 14%,
        url(../images/chatbot-header-bg.webp) 118% 14% / contain no-repeat;
    padding: 4px 18px;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgb(75 62 201 / 0.3);
}
.icon-btn,
.record-btn {
    display: flex;
    align-items: center;
}
.avatar {
    height: 54px;
    width: auto;
}
.chat-title {
    font-size: 0.95rem;
    color: #fff !important;
    font-weight: 600;
}
.status-indicator {
    width: 10px;
    height: 10px;
    background-color: var(--success);
    box-shadow: 0 0 6px var(--success);
    animation: 1.5s ease-in-out infinite pulse;
}
@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 6px var(--success);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 15px var(--success);
    }
}
.icon-btn {
    width: 34px;
    height: 34px;
    background: rgb(255 255 255 / 52%);
    border: none;
    color: #000;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}
.icon-btn:hover {
    background-color: rgb(255 255 255 / 0.3);
}
.start-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background:
        linear-gradient(180deg, #fff1b9 0, #ffffff00 50%, #ffecc6 100%) 0 23% / contain,
        url(../images/chatstart-bg.webp) 0 23% / contain no-repeat;
    color: var(--white);
    text-align: center;
    animation: 0.4s fadeIn;
}
.start-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 24px;
    color: #626262 !important;
}
.start-avatar {
    width: auto;
    height: 177px;
    border-radius: 50%;
}
.record-btn,
.start-btn {
    height: 50px;
    transition: 0.3s;
    cursor: pointer;
}
.chat-window .input-group {
    width: 100%;
    margin-bottom: 20px;
    position: relative;
}
.input-group-text {
    background: var(--white);
    border: none;
    color: var(--gray-dark);
}
.chat-window .form-control {
    border-radius: 10px;
    border: 1px solid #c8c8c8;
    padding: 12px 16px;
    font-size: 0.9rem;
    transition: 0.3s;
}
.chat-header .chat-lang-opt span {
    font-size: 14px;
    color: #000;
}
.chat-window .chat-header .dropdown-item {
    border-radius: 7px;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 14px;
}
.chat-window .chat-header .close-btn {
    color: #ff4000;
    /*padding-left: 65px !important;*/
}
.chat-window .chat-header .dropdown-item i {
    color: #477cc6;
    font-size: 16px;
}
.chat-window .chat-header .close-btn i {
    color: #ff4000;
}
.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px rgb(255 157 0 / 0.3);
}
.record-btn {
    width: 50px;
    border-radius: 10px;
    background: #fff;
    border: none;
    justify-content: center;
}
.start-btn,
.user-avatar {
    color: var(--white);
    display: flex;
    align-items: center;
}
.record-btn:hover {
    background: var(--gray-dark);
    color: var(--white);
}
.record-btn.recording {
    background: var(--danger);
    color: var(--white);
    box-shadow: 0 0 10px rgb(239 68 68 / 0.5);
}
.start-btn {
    text-transform: uppercase;
    padding: 0 76px;
    border-radius: 57px;
    background: linear-gradient(87.47deg, #f68618 0, #ed4513 100%);
    border: none;
    font-weight: 600;
    justify-content: center;
    gap: 8px;
    width: 100%;
}
.start-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(255 157 0 / 0.4);
}
.chat-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: 0.3s fadeIn;
}
.messages-container {
    flex: 1;
    padding: 18px;
    background-color: var(--gray-light);
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
}
.messages-container::-webkit-scrollbar {
    width: 6px;
}
.messages-container::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 10px;
}
.messages-container::-webkit-scrollbar-thumb:hover {
    background: #888;
}
.message {
    display: flex;
    align-items: flex-end;
    margin-bottom: 20px;
    max-width: 92%;
    line-height: 1.4;
    animation: 0.3s fadeInUp;
}
.bot-message .message-content {
    background: #fff;
    color: #000;
    border-radius: 18px 18px 18px 6px;
}
.user-message {
    align-self: flex-end;
}
.user-message .message-content {
    background: #ffedd3;
    color: var(--text-dark);
    border: 1px solid #ffcb7d;
    border-radius: 18px 18px 6px;
    text-align: right;
}
.message-avatar {
    height: 40px;
    border-radius: 50%;
    margin: 0 8px;
}
.message-content {
    padding: 12px 16px;
    font-size: 0.9rem;
    border: 1px solid #dedede;
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--gray-dark);
    justify-content: center;
    font-size: 0.8rem;
    margin: 0 8px;
}
.input-bar,
.typing-indicator {
    align-items: center;
    display: flex;
}
.typing-indicator {
    margin-top: 6px;
}
.typing-dots {
    background: var(--gray-medium);
    border-radius: 16px;
    padding: 12px 18px;
    display: flex;
    position: relative;
    gap: 6px;
}
.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-color);
    animation: 1.4s ease-in-out infinite typingBounce;
}
.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}
.input-bar {
    bottom: 0;
    gap: 10px;
    padding: 14px 16px;
    background-color: var(--white);
    border-top: 1px solid var(--gray-medium);
}
.send-btn {
    width: 55px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffa442, #ff7900);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    cursor: pointer;
}
.send-btn:hover {
    transform: scale(1.1);
    background: #ff5722;
}
.send-btn:disabled {
    background-color: var(--gray-medium);
    color: var(--gray-dark);
    cursor: not-allowed;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes typingBounce {
    0%,
    100%,
    80% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}
.chat-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.messages-container {
    position: relative;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    height: auto;
    max-height: calc(100% - 70px);
    background-repeat: repeat;
    background-size: 150px 150px;
    background-position: top left;
    background-attachment: fixed;
    background-color: #fcf9f8;
}
.messages-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgb(255 255 255 / 0.2);
    pointer-events: none;
}
.messages-container > * {
    position: relative;
    z-index: 2;
}
.icon-btn i {
    margin: 0;
}
.chat-bot-lang {
    height: 28px;
}
.dropdown-item::before {
    content: none !important;
}
.chat-window .chat-header .dropdown-menu {
    right: -59px !important;
    top: 47px !important;
    left: auto !important;
    border-radius: 20px;
    border: none;
    background-color: #fff !important;
    padding-left: 10px;
    padding-right: 10px;
}
.chat-header .dropdown-divider {
    margin-top: 3px;
    margin-bottom: 3px;
}
@media (max-width: 576px) {
    .floating-chat-container {
        right: 10px;
        bottom: 83px;
    }
    .chat-window,
    .chat-window.expanded {
        /* width: 100%; */
        height: 85vh;
    }
    .chat-header .dropdown-menu {
        right: 0 !important;
        top: 3px !important;
    }
}
.chat-window .chat-header .dropdown-menu::before {
    content: "";
    position: absolute;
    top: -10px;
    right: 64px;
    width: 0;
    height: 0;
    border-left: 10px solid #fff0;
    border-right: 10px solid #fff0;
    border-bottom: 10px solid #fff;
}
button,
input {
    margin: 0 !important;
}
.rating-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(10 10 10 / 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    animation: 0.3s fadeIn;
}
.rating-box {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 8px 25px rgb(0 0 0 / 0.3);
    animation: 0.3s slideUp;
}
.rating-box h5 {
    font-weight: 600;
    color: var(--primary-dark);
}
.stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 1.8rem;
    color: var(--gray-medium);
    cursor: pointer;
    transition: color 0.3s;
}
.stars i.active {
    color: var(--accent-color);
}
.rating-box textarea {
    resize: none;
    font-size: 0.9rem;
}
.rating-box button {
    border-radius: 8px;
    padding: 6px 16px;
    font-weight: 500;
}
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
#rating-emoji {
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    width: 100%;
    text-align: center;
    display: inline-block;
    transition: transform 0.2s;
}
#rating-emoji:not(:empty) {
    animation: 0.4s bounce;
}
@keyframes bounce {
    0% {
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}
.suggestions-container {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: 0 0;
    border: 1px solid var(--gray-medium);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 12px rgb(0 0 0 / 0.1);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}
.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--gray-light);
    border-bottom: 1px solid var(--gray-medium);
    color: var(--text-dark);
}
.suggestions-list {
    padding: 8px;
}
.suggestion-item {
    margin-bottom: 6px;
    background: var(--gray-light);
    font-size: 0.9rem;
    border: 1px solid #fff0;
}
.suggestion-item:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-1px);
    background-color: #2f24a3;
}
.suggestion-item:last-child {
    margin-bottom: 0;
}
.icon-btn.small {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
}
.input-bar {
    position: relative;
}
.validation-message {
    position: absolute;
    top: -30px;
    z-index: 10;
    left: 0;
    right: 0;
    background: var(--danger);
    color: var(--white);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    text-align: center;
    animation: 0.5s shake;
}
.bot-message .message-time,
.message-time,
.show-more-btn,
.user-message .message-time {
    text-align: right;
}
@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}
.input-shake {
    animation: 0.5s shake;
    border-color: var(--danger) !important;
}
#suggestions-container {
    position: absolute;
    bottom: 60px;
    left: 10px;
    right: 10px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgb(0 0 0 / 0.15);
    z-index: 20;
    padding: 10px;
    max-height: 284px;
    overflow-y: auto;
    animation: 0.2s ease-in-out fadeIn;
}
.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-bottom: 5px;
}
.close-suggestions-btn {
    background: 0 0;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #666;
}
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.suggestion-item {
    padding: 8px 10px;
    border-radius: 6px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: background 0.2s;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.message-time {
    display: block;
    font-size: 0.75rem;
    color: #000;
    margin-top: 4px;
    opacity: 0.7;
}
.message-content {
    position: relative;
    word-wrap: break-word;
}
.message-content.long-text {
    max-height: 80px;
    overflow: hidden;
    transition: max-height 0.3s;
}
.message-content.expanded {
    max-height: none;
}
.read-more-btn {
    background: rgb(255 255 255 / 0.2);
    border: none;
    color: inherit;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    margin-top: 8px;
    cursor: pointer;
    transition: background 0.3s;
}
#rating-close i,
.show-more-btn {
    transition: color 0.2s;
}
.read-more-btn:hover {
    background: rgb(255 255 255 / 0.3);
}
.user-message .read-more-btn {
    background: rgb(0 0 0 / 0.1);
    color: var(--text-dark);
}
.user-message .read-more-btn:hover {
    background: rgb(0 0 0 / 0.15);
}
.show-more-btn {
    background: 0 0;
    border: none;
    color: #ee6f29 !important;
    font-weight: 600;
    cursor: pointer;
    padding: 3px 0;
    font-size: 14px !important
}
.show-more-btn:hover {
    color:#000!important;
}
.animated-message {
    overflow: hidden;
    transition:
        max-height 0.4s,
        opacity 0.3s;
}
#rating-close:hover i, .bot-dialogue {
    color: #000;
    margin-bottom: 13px;
}
.bot-dialogue h5 {
    font-size: 20px;
    margin-bottom: 0;
    margin-top: 0;
    color: #111827;
    font-weight: 700;
}
.bot-dialogue h6 {
    font-weight: 700;
    color: #ee6b25;
    margin-bottom: 0;
    font-size: 17px;
}
.bot-dialogue p {
    color: #515151;
    margin-top: 0;
}
.start-screen .input-group-text {
    position: absolute;
    left: 10px;
    z-index: 6;
    background: 0 0;
    top: 11px;
    padding: 0;
}
.start-screen input {
    padding-left: 32px !important;
    border-radius: 10px !important;
    border: 1px solid #b9b9b9 !important;
}
#close-chatbot {
    font-size: 22px;
}
.chat-header .dropdown-toggle i {
    font-size: 15px;
}

.chat-lang-opt {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.chat-header .form-switch {
    padding-left: 0px;
}

.chat-window .chat-header .close-btn {
    background: #fef1e7;
    color: #ff4000;
    width: 100%;
    justify-content: left;
}

.chat-header .dropdown .dropdown-menu{
    width:11rem;
}


.chat-header .dropdown-menu{
    animation: .5s forwards foldIn;
}

@keyframes foldIn {
    0% {
      opacity: 0;
      transform: scaleY(0)
    }
    50% {
      opacity: 1;
      transform: scaleY(1.1)
    }
    100% {
      opacity: 1;
      transform: scaleY(1)
    }
  }