/* ============================================================
   فایل: index-chat-identity-style.css
   تاریخ: ۱۴۰۴/۰۴/۰۸
   ============================================================ */

/* ===== استایل‌های پایه ===== */
.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;
}

.time-grey {
    color: rgb(182, 181, 181); 
    font-size: 11px; 
}

.spacer {
    height: 30px;
}

/* ===== مودال اصلی چت ===== */
.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;
}

.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;
}

.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;
}

/* ===== پیام‌ها ===== */
.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 {
    position: relative;
    background-color: #d7f8bf;
    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;
}

.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;
}

/* ===== بخش ورودی چت ===== */
.chat-input {
    width: 333px;
    display: flex;
    padding: 2px;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    font-family: 'B Roya Bold', Arial, sans-serif;
}

.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;
}

.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;
}

.chat-button-container {
    position: relative;
    width: 55px;
    height: 60px;
}

#phonnumber {
    position: absolute;
    bottom: 10px;
    left: 189px;
    padding: 0;
    background-color: #fdfeff;
    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;
}

/* ===== Badge پیام نخوانده ===== */
#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); }
}



/* ===== کانتینر اصلی مودال ===== */
.chat-login-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 270px;
    height: 500px !important;
    padding: 20px 18px 12px;
    background-color: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    z-index: 1201;
    font-family: 'VazirMatn', Arial, sans-serif;
    overflow-y: auto;
    box-sizing: border-box;
}

/* اسکرول‌بار مودال */
.chat-login-modal::-webkit-scrollbar {
    width: 4px;
}

.chat-login-modal::-webkit-scrollbar-thumb {
    background: #3496cd;
    border-radius: 4px;
}

/* ===== دکمه بستن ===== */
#closeSupportModal {
    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;
    transition: transform 0.2s;
}

#closeSupportModal:hover {
    transform: scale(1.1);
}

/* ===== تصویر هدر مودال (اختیاری) ===== */
.chat-login-Modal-image {
    width: 100%;
    height: auto;
    margin-bottom: 5px;
    border-radius: 6px;
}







/* ===== هر ردیف ورودی ===== */
.chat-input-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 10px;
    width: 100%;
}

/* برچسب بالای ورودی */
.input-label {
    font-size: 12px;
    color: black;
    text-align: center;
    padding-right: 3px;
    font-weight: 400;
}

/* ردیف شامل ورودی + دکمه */
.input-row {
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
}

/* ===== ورودی‌ها ===== */
.chat-input-group input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    text-align: center;
    box-sizing: border-box;
    font-family: 'VazirMatn', Arial, sans-serif;
    height: 25px;
    min-width: 0;
    background: #fafafa;
    transition: border-color 0.3s;
}

.chat-input-group input:focus {
    border-color: #3496cd;
    outline: none;
    background: #fff;
}

/* ===== دکمه‌های ارسال - کوچک و هم‌ردیف ===== */
.chat-login-Modal-button {
    flex: 0 0 68px;
    height: 25px;
    background-color: #3496cd;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'VazirMatn', Arial, sans-serif;
    transition: all 0.25s ease;
    padding: 0 6px;
    white-space: nowrap;
}

.chat-login-Modal-button:hover:not(:disabled) {
    background-color: #2980b9;
    transform: scale(1.02);
}

.chat-login-Modal-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* ===== پیام‌های خطا ===== */
.loginErrors {
    color: #e74c3c;
    text-align: center;
    font-size: 10px;
    height: 16px;
    line-height: 16px;
    margin: 0;
    visibility: hidden;
    transition: visibility 0.2s;
}

.loginErrors.show {
    visibility: visible;
}

/* ===== تایمر و کانتینرهای متفرقه ===== */
#timer-display {
    font-size: 12px;
    color: #555;
    text-align: center;
    padding: 2px 0;
}

#chat-input-container {
    width: 100%;
}

/* ===== ریسپانسیو برای موبایل ===== */
@media (max-width: 480px) {
    .chat-login-modal {
        width: 80vw;
        height: 60vh;
        max-height: 640px;
        padding: 16px 14px 10px;
    }
    
    .chat-login-Modal-button {
        flex: 0 0 60px;
        font-size: 14px;
        height: 32px;
    }
    

    
    #captcha-modal-2 .captchaInput {
        width: 65px;
        height: 28px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .chat-login-modal {
        padding: 12px 10px 8px;
    }
    
    .chat-login-Modal-button {
        flex: 0 0 52px;
        font-size: 14px;
        height: 30px;
    }
    
    .chat-input-group input {
        height: 30px;
        font-size: 15px;
        padding: 4px 6px;
    }
    
    .input-label {
        font-size: 10px;
    }
}
/* ===== توضیح زیر هدر ===== */
.modal-description {
    font-size: 11px;
    color: red;
    text-align: center;
    margin: 2px 0 10px 0;
    padding: 0 5px;
    font-family: 'sans-serif';
    line-height: 1.5;
}



