/* =========================================
   GENERAL CHATBOT STYLES & LAYOUT FIXES
========================================= */
.custom-d-none { display: none; }
.banner-video { width: 100%; height: auto; opacity: 0.3; }
.text-ai-orange { color: #ff9100; }
.text-primary { color: #197aef; }
.login-btn-margin { margin: 4px; }
.pdf-download-icon { margin-left: 10px; cursor: pointer; }
.font-weight-bold { font-weight: bold; }

/* Translated Text Styles */
.translated-text {
    position: relative;
    background-color: #e6f7ff;
    border: 1px solid #b3d8ff;
    border-radius: 6px;
    padding: 10px 30px 10px 10px;
    margin-top: 8px;
    color: #004085;
    font-style: italic;
    font-size: 14px;
}
.translated-close {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
    font-size: 16px;
    color: #888;
}
.translated-close:hover {
    color: #ff0000;
}

/* Chat Messages Structural Styles */
.message-row {
    display: flex;
    align-items: flex-start;
}
.message-side-panel {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 5px;
}
.side-audio-btn,
.side-translate-btn {
    background: #007bff;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}
.side-audio-btn:hover,
.side-translate-btn:hover {
    background: #0056b3;
}
.lang-select {
    font-size: 10px;
}

/* Modal Overlay & Elements */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.modal-content {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mic-icon {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}
.mic-icon i {
    font-size: 40px;
    color: #3498db;
    z-index: 2;
    position: relative;
    margin-top: 10px;
}
.pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #3498db;
    animation: pulse 1.2s infinite;
    opacity: 0.6;
    z-index: 1;
}
@keyframes pulse {
    0%   { transform: scale(1); opacity: 0.6; }
    50%  { transform: scale(1.5); opacity: 0.3; }
    100% { transform: scale(1); opacity: 0.6; }
}
.modal-text {
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

/* Chat Buttons & Options Container */
.operator-message {
    font-size: 12px;
    color: #1a1ef5;
    margin-top: 10px;
}
.options-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 5px;
    box-sizing: border-box;
}
.option_btn {
    width: 100%;
    max-width: 100%;
    min-width: auto;
    padding: 12px 16px;
    font-size: 13px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: linear-gradient(65deg, #24bcedc4, rgba(20, 158, 149, 0.4));
    color: black;
    font-weight: bold;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    height: auto;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin-bottom: 10px;
}
.option_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}
.option_btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.option_btn.yes_btn {
    background: linear-gradient(145deg, #56e39f, #2c9f4b);
}
.option_btn.no_btn {
    background: linear-gradient(145deg, #f76c6c, #d32f2f);
}

/* Chatbox layout */
.chatbot {
    width: 10%;
}
.chatbot img {
    width: 62px;
    background: #4089e7;
    float: right;
    border-radius: 50%;
    height: 62px;
    object-fit: contain;
    position: fixed;
    right: 79px;
    z-index: 99999;
    bottom: 60px;
    border: 2px solid #007b95;
}
.chatbox {
    position: fixed;
    right: 0;
    bottom: 5px;
    max-width: 400px;
    width: 100%;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: rgba(50, 50, 93, 0.25) 0px 30px 60px -12px, rgba(0, 0, 0, 0.3) 0px 18px 36px -18px;
    z-index: 99999;
    display: none;
}
.chatbox__support {
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    height: 600px;
    width: 100%;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    overflow: hidden;
    transition: all 0.5s ease-in-out;
    transform: translateY(0);
    opacity: 1;
}
.chatbox--active .chatbox__support {
    transform: translateY(-40px);
    z-index: 123456;
}
.chatbox__header {
    background: linear-gradient(90deg, #0078D4, #2CB5B5);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 20px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0px 10px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
}
.chatbox__image--header {
    width: 11%;
    height: 100%;
    border: 1px solid #000;
    background: #f5eb5c;
    border-radius: 50%;
    margin-right: 10px;
}
.chatbox__image--header img {
    width: 100%;
    border-radius: 50%;
}
.chatbox__heading--header {
    font-size: 1.2rem;
    color: #fff;
    margin: 0;
}

/* Chat Background loaded relative to CSS directory */
.chatbox__messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    height: calc(100% - 142px);
    background-image: url('../../poc-image/chat_background3.png');
    background-size: cover;
    border-bottom: 1px solid #ccc;
}
.messages__wrapper {
    width: 100%;
    display: inline-block;
    margin-bottom: 20px;
}
.messages__item {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 12px 12px 0px 12px;
    background-color: #fff;
    max-width: 85%;
    word-wrap: break-word;
    box-sizing: border-box;
    position: relative;
}

/* Visitor Message & Avatar */
.messages__item--visitor {
    float: right;
    max-width: 70%;
    padding: 10px 14px 10px 10px;
    background: #0392f8 !important;
    border: 1px solid #cfe6f7;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 500;
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    overflow: visible;
}
.messages__item--visitor::after {
    content: "";
    position: absolute;
    top: -19px;
    right: -18px;
    width: 26px;
    height: 26px;
    background-image: url("../../poc-image/c_logo_user3.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    background-color: #ffffff;
}

/* Operator Message & Avatar */
.messages__item--operator {
    float: left;
    color: #000;
    align-self: flex-end;
    font-size: 13px;
    box-shadow: 2px 3px 12px #00000040;
    text-align: justify;
    padding-left: 42px;
    overflow: visible;
}
.messages__item--operator::before {
    content: "";
    position: absolute;
    top: -19px;
    left: -15px;
    width: 28px;
    height: 28px;
    background-image: url("../../poc-image/chat.png");
    background-size: 50px;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    animation: pulseGlow 2s infinite;
}

.message-time {
    font-size: 11px;
    margin-top: 4px;
}
.messages__item--visitor .message-time {
    text-align: right;
    color: #ffffff;
}
.messages__item--operator .message-time {
    text-align: right;
    color: #000000;
}

/* Footer Input */
.chatbox__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: linear-gradient(90deg, #4f8fc0, #2a9d9d);
    color: #ffffff;
    box-shadow: 0px -10px 15px rgba(0, 0, 0, 0.1);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}
.chatbox__footer input[type="text"] {
    flex: 1;
    border: none;
    padding: 10px;
    border-radius: 30px;
    outline: none;
    font-size: 13px;
    margin-right: 3px;
    border: 1px solid #0002;
}
.chatbox__send--footer {
    background-color: white;
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 50px;
    border: none;
    outline: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.chatbox__send--footer:hover {
    background-color: #f0f0f0;
}
.mic-btn {
    margin: 0px 4px 0px 4px;
    font-size: 24px;
}
.send-svg {
    width: 18px; 
    height: 18px;
}

/* Loader Styles */
.loader-container {
    position: absolute;
    bottom: 30px;
    left: 10px;
}
.loader-img {
    width: 80px;
}

/* Chat UI Status, Ads, & Typing Indicators */
.bot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgb(10, 243, 22);
    margin-top: 2px;
}
.bot-status-dot {
    width: 8px;
    height: 8px;
    background-color: rgb(10, 243, 22);
    border-radius: 50%;
    animation: botBlink 1.4s infinite ease-in-out;
}
@keyframes botBlink {
    0%   { opacity: 1; }
    50%  { opacity: 0.3; }
    100% { opacity: 1; }
}

.idle-popup {
    position: absolute;
    bottom: 120px;
    right: 20px;
    background: linear-gradient(180deg, #f8fbff, #eef6fc);
    color: #1f2d3d;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    border: 1px solid #cfe6f7;
    z-index: 15;
    pointer-events: none;
    animation: idleFloat 2.5s ease-in-out infinite;
}
@keyframes idleFloat {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}

.typing-indicator {
    position: absolute;
    bottom: 70px;
    right: 20px;
    font-size: 11px;
    color: #6c757d;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    pointer-events: none;
}
.typing-indicator .dots::after {
    content: "";
    animation: dots 1.5s infinite;
}
@keyframes dots {
    0%   { content: ""; }
    33%  { content: "."; }
    66%  { content: ".."; }
    100% { content: "..."; }
}

.chatbox__message--ad {
    background: #fff8e1;
    border: 1px solid #ffd54f;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}
.ad-close-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 16px;
    line-height: 22px;
    cursor: pointer;
    transition: 0.2s;
}
.ad-close-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.1);
}

/* Floating WhatsApp Button */
.btn-whatsapp-pulse {
    color: white;
    position: fixed;
    bottom: 61px;
    right: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 0;
    height: 0;
    padding: 30px;
    text-decoration: none;
    border-radius: 50%;
    animation-name: pulseBtn;
    animation-duration: 1.5s;
    animation-timing-function: ease-out;
    animation-iteration-count: infinite;
    border: 1px solid #a2a2a2;
}
.btn-whatsapp-pulse:hover {
    color: #ecc233;
}
@keyframes pulseBtn {
    0%  { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
    80% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
}

/* Reaction & Feedback System */
.reaction-container {
    margin-top: 6px;
    display: flex;
    gap: 10px;
}
.reaction-btn {
    background: #f1f1f1;
    border: none;
    padding: 4px 8px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.2s ease;
    color: #555;
}
.reaction-btn:hover {
    background: #e0e0e0;
    color: #007bff;
}
.reaction-btn.active {
    background: #4caf50;
    color: white;
    cursor: not-allowed;
}
.dislike-btn.active {
    background: #e53935;
    color: white !important;
}

.reaction-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    overflow: auto;
    padding-top: 60px;
}
.reaction-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    border-radius: 20px;
}


/* Language Selection Overlay */
.language-selection {
    display: none; /* <--- Changed to none */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #0008;
    height: 100vh;
    z-index: 99999999999999;
}
.lng-box {
    background-color: #f1f1f1;
    padding: 10px;
    border-radius: 5px;
    position: absolute;
    top: 30%;
    left: 0;
    right: 0;
    width: 300px;
    margin: 0 auto;
    text-align: center;
}