/* modirenab-chat.css */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.0.0/Vazirmatn-font-face.css');

#modirenab-chat-widget * {
    box-sizing: border-box;
    font-family: 'Vazirmatn', 'IRANSans', Tahoma, sans-serif;
    direction: rtl;
}

/* دکمه شناور */
#modirenab-chat-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #008eb2; /* رنگ سازمانی شما */
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    transition: transform 0.3s ease;
}
#modirenab-chat-fab:hover {
    transform: scale(1.1);
}
#modirenab-chat-fab svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

/* پنجره اصلی چت */
#modirenab-chat-box {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #f9f9f9;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#modirenab-chat-box.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* هدر چت */
#modirenab-chat-header {
    background-color: #008eb2;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 15px;
}
#modirenab-chat-header-info {
    display: flex;
    flex-direction: column;
}
#modirenab-chat-header-info span.subtitle {
    font-size: 11px;
    font-weight: normal;
    opacity: 0.8;
}
#modirenab-close-btn {
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    background: none;
    border: none;
    color: white;
}

/* محوطه پیام‌ها و فرم */
#modirenab-chat-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f4f6f8;
    background-image: url('data:image/svg+xml,%3Csvg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%23e5e7eb" fill-opacity="0.4" fill-rule="evenodd"%3E%3Ccircle cx="3" cy="3" r="3"/%3E%3Ccircle cx="13" cy="13" r="3"/%3E%3C/g%3E%3C/svg%3E'); /* پترن محو پس‌زمینه */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* فرم دریافت اطلاعات */
#modirenab-intro-form {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
#modirenab-intro-form p {
    font-size: 13px;
    color: #555;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}
#modirenab-intro-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
#modirenab-intro-form input:focus {
    border-color: #008eb2;
}
#modirenab-intro-form button {
    width: 100%;
    padding: 10px;
    background: #008eb2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s;
}
#modirenab-intro-form button:hover {
    background: #007696;
}

/* حباب‌های چت */
.modirenab-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    word-wrap: break-word;
}
.modirenab-msg.bot {
    background: white;
    color: #333;
    align-self: flex-start;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.modirenab-msg.user {
    background: #008eb2;
    color: white;
    align-self: flex-end;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ورودی پیام پایین */
#modirenab-chat-input-area {
    display: none; /* تا قبل از فرم مخفی است */
    padding: 10px 15px;
    background: white;
    border-top: 1px solid #eee;
    align-items: center;
    gap: 10px;
}
#modirenab-chat-input {
    flex: 1;
    border: none;
    padding: 10px;
    font-size: 13px;
    outline: none;
    background: #f4f6f8;
    border-radius: 20px;
}
#modirenab-chat-send-btn {
    background: none;
    border: none;
    color: #008eb2;
    cursor: pointer;
    font-weight: bold;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#modirenab-chat-send-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* دکمه انتقال به واتساپ */
#modirenab-whatsapp-btn {
    display: block;
    text-align: center;
    background: #25D366;
    color: white;
    text-decoration: none;
    padding: 12px;
    font-size: 13px;
    font-weight: bold;
    border-top: 1px solid #eee;
    transition: background 0.2s;
}
#modirenab-whatsapp-btn:hover {
    background: #1ebc5a;
}

/* ریسپانسیو برای موبایل */
@media (max-width: 480px) {
    #modirenab-chat-box {
        bottom: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    #modirenab-chat-fab {
        bottom: 15px;
        right: 15px;
    }
}

/* Container for human support buttons */
.mn-chat-human-support {
    display: flex;
    gap: 8px;
    padding: 10px;
    background-color: #f4f6f8;
    border-top: 1px solid #e1e4e8;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Base button styling */
.mn-human-btn {
    flex: 1;
    padding: 10px 5px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none !important;
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 600;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mn-human-btn:hover {
    opacity: 0.85;
}

/* Specific colors */
.mn-btn-whatsapp {
    background-color: #25D366; /* رنگ سازمانی واتساپ */
}

.mn-btn-bale {
    background-color: #2ab2a2; /* رنگ سازمانی پیام‌رسان بله */
}

/* اصلاح رنگ و افکت دکمه ضربدر بستن چت */
#modirenab-close-btn {
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#modirenab-close-btn svg {
    width: 24px;
    height: 24px;
    fill: #ffffff !important;
    transition: transform 0.2s;
}
#modirenab-close-btn:hover svg {
    transform: scale(1.1) rotate(90deg);
}

/* استایل تولتیپ پاپ‌آپ (پیام دعوت به گفتگو) */
#mn-chat-tooltip {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: #ffffff;
    padding: 12px 35px 12px 15px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
    z-index: 9998;
    border: 1px solid #f0f0f0;
    animation: slideUpTooltip 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
#mn-chat-tooltip .tooltip-content strong {
    display: block;
    color: #008eb2;
    font-size: 13px;
    margin-bottom: 5px;
}
#mn-chat-tooltip .tooltip-content p {
    margin: 0;
    font-size: 12px;
    color: #555;
}
#mn-tooltip-close {
    position: absolute;
    top: 6px;
    right: 6px;
    background: transparent !important; /* حذف بک‌گراند اضافه */
    border: none;
    cursor: pointer;
    color: #999;
    padding: 2px;
    display: flex;
    transition: color 0.2s;
}
#mn-tooltip-close:hover {
    color: #333;
}
/* مثلث پایین پاپ‌آپ */
#mn-chat-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    transform: rotate(45deg);
}
@keyframes slideUpTooltip {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* زیباسازی و تمیزتر شدن فرم ثبت اطلاعات */
#modirenab-intro-form {
    border: 1px solid #eaeaea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border-radius: 14px;
}
#modirenab-intro-form input {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 13px;
    transition: all 0.3s ease;
}
#modirenab-intro-form input:focus {
    background: #ffffff;
    border-color: #008eb2;
    box-shadow: 0 0 0 3px rgba(0, 142, 178, 0.1);
}

/* طراحی مینیمال نوار پیام */
#modirenab-chat-input-area {
    display: flex;
    padding: 8px 12px;
    background: #ffffff;
    border-top: 1px solid #ebedf0;
    align-items: center;
    gap: 5px;
}
#modirenab-chat-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 14px;
    padding: 8px 5px;
    outline: none;
    color: #333;
}
/* دکمه‌های آیکونی بدون بک‌گراند */
#modirenab-chat-send-btn, #modirenab-chat-emoji-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9aa0a6; /* رنگ خاکستری ملایم */
    transition: color 0.2s, transform 0.2s;
}
#modirenab-chat-send-btn svg, #modirenab-chat-emoji-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}
#modirenab-chat-emoji-btn svg {
    fill: none; /* چون این آیکون خطی است */
}
/* تغییر رنگ هنگام هاور */
#modirenab-chat-send-btn:hover {
    color: #008eb2; /* رنگ آبی مدیرناب */
    transform: scale(1.1);
}
#modirenab-chat-emoji-btn:hover {
    color: #555;
    transform: scale(1.1);
}



.typing-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background-color: #f1f1f1;
  border-radius: 12px;
  width: fit-content;
  margin-bottom: 10px;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  float: left;
  margin: 0 2px;
  background-color: #999;
  display: block;
  border-radius: 50%;
  opacity: 0.4;
  animation: typing 1s infinite;
}

.typing-indicator span:nth-of-type(1) { animation-delay: 0s; }
.typing-indicator span:nth-of-type(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-of-type(3) { animation-delay: 0.4s; }

@keyframes typing {
  0% { opacity: 0.4; transform: translateY(0px); }
  50% { opacity: 1; transform: translateY(-3px); }
  100% { opacity: 0.4; transform: translateY(0px); }
}