: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: 85px;
    right: 10px;
    z-index: 1000;
}

.chat-toggle-btn {
	 position: fixed;
    height: 50px;
    width: 50px;
    border-radius: 50%;
    background: linear-gradient(90deg, rgb(132 162 219) 1%, rgb(70 89 135) 100%);
    color: var(--white);
    border: none;
    box-shadow: 0 6px 20px rgba(75, 62, 201, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
	right: 10px;
  bottom: 25px;
}


.chat-toggle-btn::after {
    content: "Chat with us anytime!";
    position: absolute;
    right: 110%;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
      background: linear-gradient(90deg, rgb(189 208 244) 1%, rgb(70 89 135) 100%);
    color: var(--white);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    white-space: nowrap;
    max-width: 180px;
    line-height: 1.4;
    text-align: left;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 999;
}

.chat-toggle-btn::before {  
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent var(--primary-dark) transparent transparent;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.chat-toggle-btn:hover::after,
.chat-toggle-btn:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.chat-toggle-btn.show-tooltip::after,
.chat-toggle-btn.show-tooltip::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.chat-toggle-btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.chat-toggle-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 24px rgba(75, 62, 201, 0.5);
}

.chat-toggle-btn i {
    font-size: 1.6rem;
}

.chat-window {
    width: 370px;
    height: 580px;
    border-radius: 18px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 16px;
    display: none;
    transition: all 0.4s ease-in-out;
    position: relative;
    z-index: 10000;
}

.chat-window.show {
    display: flex;
    animation: fadeIn 0.4s ease;
}

.chat-window.expanded {
    width: 480px;
    height: 720px;
    transition: all 0.4s ease;
}

.chat-header {
    background: rgb(97 122 168);
    color: var(--white);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(75, 62, 201, 0.3);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--white);
    background-color: #b8c1d5;
}

.chat-title {
    font-size: 0.95rem;
    color: white !important;
    font-weight: 600;
}

.status-indicator {
    width: 10px;
    height: 10px;
    background-color: var(--success);
    border-radius: 50%;	
    box-shadow: 0 0 6px var(--success);
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 6px var(--success);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 15px var(--success);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 6px var(--success);
    }
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.start-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgb(234 234 232 / 98%);
    color: var(--white);
    text-align: center;
    animation: fadeIn 0.4s ease;
}

.start-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 24px;
    color: #626262 !important;
}

.start-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.25);
    margin-bottom: 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.input-group {
    max-width: 280px;
    width: 100%;
    margin-bottom: 20px;
}

.input-group-text {
    background: var(--white);
    border: none;
    color: var(--gray-dark);
}

.form-control {
    border-radius: 10px;
    border: 1px solid var(--gray-medium);
    padding: 12px 16px;
    font-size: 0.9rem;
    transition: 0.3s;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px rgba(255, 157, 0, 0.3);
}

.record-btn {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    cursor: pointer;
}

.record-btn:hover {
    background: var(--gray-dark);
    color: var(--white);
}

.record-btn.recording {
    background: var(--danger);
    color: var(--white);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.start-btn {
    flex: 1;
    height: 50px;
    padding: 0px 76px;
    border-radius: 10px;
      background: linear-gradient(90deg, #6177ab, #bbcef2);
    border: none;
    color: var(--white);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.start-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 157, 0, 0.4);
}

.chat-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.messages-container {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    padding: 18px;
    background-color: var(--gray-light);
    display: flex;
    flex-direction: column;
    gap: 16px;
    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: fadeInUp 0.3s ease;
}

.bot-message .message-content {
    background: linear-gradient(120deg, #88a2e1, #c6baff);
    color: #000000;
    border-radius: 18px 18px 18px 6px;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.user-message .message-content {
    background: #b4ccff;
    color: var(--text-dark);
    border: 1px solid var(--gray-medium);
    border-radius: 18px 18px 6px 18px;
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 0 8px;
}

.message-content {
    padding: 12px 16px;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); /* increases tracking (text width) */
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--gray-dark);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin: 0 8px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    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: typingBounce 1.4s ease-in-out infinite;
}

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

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

.input-bar {
    display: flex;
    /* position: fixed; */
    bottom: 0px;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background-color: var(--white);
    border-top: 1px solid var(--gray-medium);
}

.send-btn {
    width: 55px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--primary-dark)
    );
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    cursor: pointer;
}

.send-btn:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

.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%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@media (max-width: 576px) {
    .floating-chat-container {
        right: 10px;
        /* text-align: right; */
        right: 10px;
        bottom: 83px;
			width:85%;
    }

    .chat-window,
    .chat-window.expanded {
        width: 100%;
        height: auto;
    }
	
	
	
}

.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 image setup */
    background-image: url(../images/chatbot-bg1.jpg);
    background-repeat: repeat;
    background-size: 150px 150px;
    background-position: top left;
    background-attachment: fixed;
}

.messages-container > * {
    position: relative;
    z-index: 1;
}

.messages-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

.messages-container > * {
    position: relative;
    z-index: 2;
}

.dropdown-toggle::after {
    display: none !important;
}

.icon-btn i {
    margin: 0;
}

.dropdown-item::before {
    display: none !important;
    content: none !important;
}

.chat-header .dropdown-menu {
    right: -59px !important;
    top: 3px !important;
    left: auto !important;
}

@media (max-width: 576px) {
    .chat-header .dropdown-menu {
        right: 0 !important;
        top: 3px !important;
    }
}

button,
input {
    margin: 0px 0 !important;
}

.rating-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    animation: fadeIn 0.3s ease;
}

.rating-box {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.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 {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    width: 100%;
    text-align: center;
}

#rating-emoji {
    display: inline-block;
    transition: transform 0.2s ease;
}

#rating-emoji:not(:empty) {
    animation: bounce 0.4s ease;
}

@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: transparent;
    border: 1px solid var(--gray-medium);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 12px rgba(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);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
}

.suggestions-list {
    padding: 8px;
}

.suggestion-item {
    padding: 10px 12px;
    margin-bottom: 6px;
    background: var(--gray-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.suggestion-item:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-1px);
}

.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: shake 0.5s ease;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.input-shake {
    animation: shake 0.5s ease;
    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 rgba(0, 0, 0, 0.15);
    z-index: 20;
    padding: 10px;
    max-height: 284px;
    overflow-y: auto;
    animation: fadeIn 0.2s ease-in-out;
}

.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: none;
    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;
}

.suggestion-item:hover {
    background-color: #2f24a3;
}

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

/* Read more And less */

.message-time {
    display: block;
    font-size: 0.75rem;
    color: black;
    margin-top: 4px;
    text-align: right;
    opacity: 0.7;
}

.user-message .message-time {
    text-align: right;
}

.bot-message .message-time {
    text-align: right;
}

/* Add to your existing CSS */
.message-content {
    position: relative;
    word-wrap: break-word;
}

.message-content.long-text {
    max-height: 80px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.message-content.expanded {
    max-height: none;
}

.read-more-btn {
    background: rgba(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 ease;
}

.read-more-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.user-message .read-more-btn {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
}

.user-message .read-more-btn:hover {
    background: rgba(0, 0, 0, 0.15);
}

.show-more-btn {
    background: none;
    text-align: right;
    border: none;
    color: #fff;
    font-weight: 300;
    cursor: pointer;
    padding: 3px 0;
    transition: color 0.2s ease;
}

.animated-message {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

#rating-close i {
    transition: color 0.2s ease;
}
#rating-close:hover i {
    color: #000;
}
