/* استایل اصلی جعبه چت */
#chat-box {
    width: 100%;
    padding: 12px 30px; /* هماهنگ با padding منوی کشویی */
    height: 400px;
    overflow-y: auto;
    background: #fafafa;
    margin-bottom: 15px;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    border-radius: 25px;
    border: 1px solid #5cb85c !important;
    outline: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box; /* اضافه شده */
}

/* فرم ارسال پیام (چیدمان عمودی) */
#chat-form {
    display: flex;
    flex-direction: column; /* چینش عمودی */
    gap: 8px; /* فاصله بین عناصر */
}

#chat-form input[type="text"],
#chat-form input[type="file"] {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 15px;
    font-size: 16px;
    border-radius: 25px;
    border: 1px solid #5cb85c !important; /* رنگ سبز ملایم برای حاشیه */
    outline: none;
    transition: border-color 0.3s;
}

#chat-form input[type="text"]:focus,
#chat-form input[type="file"]:focus {
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.5);
}

#chat-form textarea#chat-message {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 15px;
    font-size: 16px;
    font-family: inherit;
    border-radius: 25px;
    border: 1px solid #5cb85c !important;
    outline: none;
    transition: border-color 0.3s;
    background: #fff;
    resize: none; /* کاربر نتونه با موس تغییر بده */
    overflow-y: auto;
    line-height: 1.5;
    min-height: 40px;   /* ≈ دو خط */
    max-height: 135px;  /* ≈ 6 خط با line-height 1.5 */
}

#chat-form textarea#chat-message:focus {
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.5);
}



/* دکمه ارسال */
#chat-form button {
    padding: 12px 25px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 4px 8px rgba(0,115,170,0.3);
}

#chat-form button:hover {
    background: #005177;
    box-shadow: 0 6px 12px rgba(0,81,119,0.6);
}

/* هر پیام */
.message {
    margin-bottom: 14px;
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

/* حباب پیام */
.message .bubble {
    padding: 12px 18px;
    border-radius: 20px;
    display: inline-block;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 2px 6px rgb(0 0 0 / 0.05);
    word-wrap: break-word;
}

/* پیام‌های خود کاربر */
.message.me {
    align-self: flex-end;
    text-align: right;
}

.message.me .bubble {
    background-color: #dcf8c6;
    color: #000;
    border-bottom-right-radius: 0;
}

/* پیام‌های طرف مقابل */
.message.them {
    align-self: flex-start;
    text-align: left;
}

.message.them .bubble {
    background-color: #fff;
    border: 1px solid #ddd;
    border-bottom-left-radius: 0;
}

/* نام فرستنده و دکمه حذف */
.message strong {
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-message-btn {
    background: transparent;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    margin-left: 10px;
    transition: color 0.3s;
}

.delete-message-btn:hover {
    color: #c0392b;
}

/* متادیتا پیام (تاریخ و تیک خواندن) */
.message .meta {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    user-select: none;
}

/* تیک خواندن */
.ticks {
    color: #27ae60;
    margin-left: 8px;
    font-weight: bold;
}

/* واکنش‌گرایی برای موبایل */
@media (max-width: 480px) {
    #chat-box {
        height: 300px;
        padding: 10px;
    }

    #chat-form input[type="text"],
    #chat-form input[type="file"] {
        font-size: 14px;
        padding: 10px 12px;
    }

    #chat-form button {
        padding: 10px 18px;
        font-size: 14px;
    }

    .message {
        max-width: 90%;
    }

    .message .bubble {
        font-size: 14px;
        padding: 10px 14px;
    }
}

/* استایل عنوان چت */
.chat-header {
    font-size: 14px;
    font-weight: 500;
}

/* اعلان پیام جدید */
#new-message-alert {
    display: none;
    text-align: center;
    background: #fff3cd;
    padding: 8px;
    cursor: pointer;
    border: 1px solid #ffeeba;
    margin-bottom: 10px;
    border-radius: 6px;
    font-weight: 600;
    color: #856404;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
}

#new-message-alert:hover {
    background: #ffe8a1;
}

/* نمایش فایل‌های ارسال شده در پیام */
.message .bubble img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 12px;
    margin-top: 5px;
    display: block;
}

.message .bubble a.chat-file-link {
    display: inline-block;
    margin-top: 5px;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.message .bubble a.chat-file-link:hover {
    text-decoration: underline;
}

/* پلیر صوتی داخل پیام */
.message .bubble audio {
    margin-top: 5px;
    width: 180px;
    outline: none;
}

/* استایل منوی کشویی */
#doctor-selector {
    width: 100%;
    padding: 12px 30px; /* کمی پهن‌تر شدن */
    font-size: 16px;
    border-radius: 25px; /* ایجاد حالت بیضی */
    border: 1px solid #5cb85c; /* رنگ سبز ملایم برای حاشیه */
    outline: none;
    background-color: #fff;
    color: #333;
    margin-top: 10px;  /* فاصله بیشتر از نوشته بالای منو */
    margin-bottom: 20px; /* فاصله بیشتر از نوشته پایین */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* سایه روی کادر */
    box-sizing: border-box; /* اضافه شده */
}

/* تغییرات هنگام فوکوس */
#doctor-selector:focus {
    border-color: #0073aa;
    background-color: #f0f8ff; /* پس‌زمینه روشن‌تر هنگام فوکوس */
    box-shadow: 0 0 10px rgba(0, 115, 170, 0.5); /* سایه روشن‌تر هنگام فوکوس */
}

/* استایل برای آیکون‌های منوی کشویی */
#doctor-selector option {
    padding: 10px;
    font-size: 15px;
    background-color: #fff;
}

/* حالت hover بر روی آیکون‌ها */
#doctor-selector option:hover {
    background-color: #f0f8ff;
    color: #0073aa;
}



/* استایل منوی کشویی سمت پزشک */
#user-selector {
    width: 100%;
    padding: 12px 30px; /* کمی پهن‌تر شدن */
    font-size: 16px;
    border-radius: 25px; /* ایجاد حالت بیضی */
    border: 1px solid #5cb85c; /* رنگ سبز ملایم برای حاشیه */
    outline: none;
    background-color: #fff;
    color: #333;
    margin-top: 10px;  /* فاصله بیشتر از نوشته بالای منو */
    margin-bottom: 20px; /* فاصله بیشتر از نوشته پایین */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* سایه روی کادر */
    box-sizing: border-box; /* اضافه شده */
}

/* تغییرات هنگام فوکوس */
#user-selector:focus {
    border-color: #0073aa;
    background-color: #f0f8ff; /* پس‌زمینه روشن‌تر هنگام فوکوس */
    box-shadow: 0 0 10px rgba(0, 115, 170, 0.5); /* سایه روشن‌تر هنگام فوکوس */
}

/* استایل برای آیکون‌های منوی کشویی */
#user-selector option {
    padding: 10px;
    font-size: 15px;
    background-color: #fff;
}

/* حالت hover بر روی آیکون‌ها */
#user-selector option:hover {
    background-color: #f0f8ff;
    color: #0073aa;
}



/* استایل برای تکمه استارت */
.start-consult-wrapper {
    margin-top: 40px;
    text-align: center;
}

.start-consult-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #0073aa, #005177);
    color: #fff;
    padding: 14px 40px; /* عرض دکمه افزایش یافت */
    border-radius: 30px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 8px 16px rgba(0, 115, 170, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

/* افکت هاور */
.start-consult-btn:hover {
    background: linear-gradient(135deg, #0088cc, #006699);
    color: #fff; /* رنگ متن ثابت می‌ماند */
}



.chat-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 15px;
}
