.message-status {
    font-size: 12px;
    color: rgb(209, 2, 2);
    margin-top: 5px;
    text-align: right;
}

.chat-button-footer {
    padding: 8px 16px;
    background-color: #128c7e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'B Roya Bold', Arial, sans-serif;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    z-index: 1202;
    font-family: 'B Roya Bold', Arial, sans-serif;
    height: 620px;
}

.chat-modal-header {
    height: 60px;
    padding: 0px;
    background-color: #3496cd;
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'B Roya Bold', Arial, sans-serif;
    direction: rtl;
}
.time-grey {
    color: rgb(182, 181, 181); 
    font-size: 11px; 
}

.chat-close-button {
    background: #ff4d4d;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'B Roya Bold', Arial, sans-serif;
}

.chat-messages {
    padding: 10px;
    height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    border-bottom: 1px solid #ddd;
    font-family: 'B Roya Bold', Arial, sans-serif;
    background-color: #ece5dd;
    direction: rtl;
}

.message {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 5px;
    max-width: 80%;
    font-family: 'B Roya Bold', Arial, sans-serif;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    direction: rtl;
}

.user-message {
    background-color: #dcf8c6;
    color: #000;
    margin-left: auto;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 80%;
    margin-bottom: 10px;
    direction: rtl;
}

.admin-message {
    background-color: #fff;
    color: #000;
    margin-right: auto;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 80%;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    direction: rtl;
}

.user-message .response-text {
    background-color: #b2e2a1;
    color: #000;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 8px;
}

.admin-message .response-text {
    background-color: #f1f1f1;
    color: #000;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 8px;
}

.chat-input {
    width: 333px;
    display: flex;
    padding: 2px;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    font-family: 'B Roya Bold', Arial, sans-serif;
}
#userIDInput {
    width: 333px;
    display: flex;
    padding: 1px;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    font-family: 'B Roya Bold', Arial, sans-serif;
    font-size: 18px;
    text-align: center;
}


#phone-number-1 {
    width: 333px;
    display: flex;
    padding: 1px;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    font-family: 'B Roya Bold', Arial, sans-serif;
    font-size: 18px;
    text-align: center;
}

.chat-input textarea {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    font-family: 'B Roya Bold', Arial, sans-serif;
    height: 65px;
    outline: none;
    font-size: 12px;
    box-sizing: border-box;
    direction: rtl;
}

.chat-button-container {
    position: relative;
    width: 55px;
    height: 60px;
}

#phonnumber {
    position: absolute;
    bottom: 10px;
    left: 189px;
    padding: 0;
    background-color: #fdfeff;
    /*color: #3496cd;*/
    color: white;
    border: none;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    font-size: 18px;
    height: 30px;
    width: 153px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#sendMessage {
    position: absolute;
    bottom: 10px;
    left: 67px;
    padding: 0;
    background-color: #3496cd;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'B Roya Bold', Arial, sans-serif;
    height: 30px;
    width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#update {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding-top: 5px;
    background-color: #3496cd;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'B Roya Bold', Arial, sans-serif;
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.chat-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1200;
}

.chat-login-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 450px;
    padding: 20px;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    z-index: 1201;
    font-family: 'B Roya Bold', Arial, sans-serif;
}

.chat-login-Modal-image {
    width: 100%;
    height: auto;
    margin-bottom: 0px;
}

.chat-login-Modal-button {
    width: 250px;
    height: 30px;
    background-color: #3496cd;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    font-family: 'B Roya Bold', Arial, sans-serif;
}

.chat-login-Modal-button:hover {
    background-color: #2980b9;
}

.chat-login-modal input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    max-width: 100%;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

#closeloginModal {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: red;
    color: white;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    z-index: 1100;
}

.spacer {
    height: 30px;
}



.user-message {
    position: relative;
    background-color: #d7f8bf;
    color: #000;
    margin-left: auto;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 80%;
    margin-bottom: 10px;
    direction: rtl;
}



.delete-message-btn {
    position: absolute;
    bottom: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    background: #c0ddab;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: all 0.2s ease;
    z-index: 10;
}


.message-input-wrapper {
    position: relative;
    width: 100%;
}

#messageInput {
    width: 340px;
    height: 70px;                  
    padding: 5px 5px 5px 5px;    
    box-sizing: border-box;
    resize: none;
    direction: rtl;
    font-size: 13px;
    overflow-y: auto;             

}

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: #888;
    pointer-events: none;
    user-select: none;
    z-index: 100;
}
















/**********************************/
#unread-badge {
    position: fixed;
    bottom: 125px;           /* بالای دکمه ارسال */
    right: 20px;            /* گوشه پایین راست */
    background: #f44;      /* قرمز پررنگ */
    color: white;
    font-weight: bold;
    font-size: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(255,0,0,0.4);
    user-select: none;
    transition: all 0.3s ease;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}