/* تحسين شكل الجدول المستخدم في manage.php */

.generaltable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    background: #fff;
}

.generaltable th, .generaltable td{
    padding: 12px 15px !important;
    text-align: left;
    border-bottom: 1px solid #ddd !important;
    color: #333 !important;
    font-size: 15px !important;
}

.generaltable th {
    background-color: #f5f5f5;
    font-weight: bold !important;
}

.generaltable tr:hover {
    background-color: #f1f1f1;
}

.generaltable td a {
    text-decoration: none;
}

.generaltable td a:hover {
    text-decoration: underline !important;
}

.mform .col-form-label label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 14px !important;
    color: #333 !important;
    margin-bottom: 5px;
}


/* الحاوية الكاملة */
.faqchat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Arial', sans-serif;
}

/* زر إظهار الشات */
.faqchat-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    border: none;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* اهتزاز الزر */
.faqchat-button.pulse {
    animation: faqchat-pulse 1.5s infinite;
}

@keyframes faqchat-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* نافذة الشات */
.faqchat-panel {
    display: none;
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    max-height: 500px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    flex-direction: column;
    animation: slideUp 0.4s ease-out;
}

/* رأس الشات */
.faqchat-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    text-align: center;
    padding: 12px;
    font-weight: bold;
    font-size: 18px;
    position: relative;
}

/* زر الإغلاق */
.faqchat-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

/* مربع البحث */
#faqchat-input {
    width: 90%;
    margin: 10px auto;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    display: block;
}

/* منطقة النتائج */
.faqchat-results {
    padding: 10px;
    overflow-y: auto;
    max-height: 380px;
    font-size: 14px;
    color: #333;
}

/* كل رسالة سؤال أو جواب */
.faqchat-item {
    margin-bottom: 12px;
}

/* شكل السؤال */
.faqchat-question {
    background: #e7f1ff;
    padding: 10px 15px;
    border-radius: 18px 18px 0 18px;
    display: inline-block;
    max-width: 80%;
    font-weight: bold;
    word-wrap: break-word;
    margin-bottom: 5px;
    cursor: pointer;
}

/* شكل الجواب */
.faqchat-answer {
    background: #f8f9fa;
    margin-top: 4px;
    padding: 10px 15px;
    border-radius: 18px 18px 18px 0;
    display: none;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 14px;
    color: #444;
}

/* دعم RTL */
html[dir='rtl'] .faqchat-widget {
    left: 20px;
    right: auto;
}

html[dir='rtl'] .faqchat-panel {
    left: 0;
    right: auto;
}

html[dir='rtl'] .faqchat-question {
    border-radius: 18px 18px 18px 0;
    text-align: right;
}

html[dir='rtl'] .faqchat-answer {
    border-radius: 18px 18px 0 18px;
    text-align: right;
}

/* حركة فتح الشات */
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* رابط إدارة الأسئلة */
.faqchat-manage-link {
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
}
html[dir='rtl'] .faqchat-header {
    text-align: center;
}

html[dir='rtl'] .faqchat-close {
    left: 10px;
    right: auto;
}
/* ألوان حسب اللغة */

/* العربية */
html[lang="ar"] .faqchat-header,
html[lang="ar"] .faqchat-button {
    background: linear-gradient(135deg, #0a655b, #07443e);
}

/* الإنجليزية */
html[lang="en"] .faqchat-header,
html[lang="en"] .faqchat-button {
    background: linear-gradient(135deg, #233876, #16224f);
}

/* الإسبانية */
html[lang="es"] .faqchat-header,
html[lang="es"] .faqchat-button {
    background: linear-gradient(135deg, #d36319, #9a4712);
}

/* الفلبينية */
html[lang="ph"] .faqchat-header,
html[lang="tl"] .faqchat-header,
html[lang="tl"] .faqchat-button,
html[lang="ph"] .faqchat-button {
    background: linear-gradient(135deg, #670b22, #420717);
}
