/* ============================================================ */
/* ======= طبقة الخلفية المعتمة (Overlay) للنوافذ المنبثقة ======= */
/* ============================================================ */

.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.popup-overlay.active {
    display: flex;
}

body.popup-open {
    overflow: hidden;
}

.popup-modal-box {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* ============================================================ */
/* ======= الحاوية الرئيسية للنافذة ======= */
/* ============================================================ */

.popup-container {
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px 35px;
    position: relative;
    animation: fadeIn 0.3s ease;
    font-family: 'Amiri', serif;
    direction: rtl;
    text-align: center;
    color: #2c3e50;
}

.close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
}

.close-btn:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

.popup-content {
    text-align: center;
}

.popup-content h2 {
    font-size: 28px;
    color: #1a2a3a;
    margin-bottom: 20px;
    border-bottom: 3px solid #f5c842;
    display: inline-block;
    padding-bottom: 10px;
}

.popup-content h2 i {
    color: #f5c842;
    margin-left: 10px;
}

.popup-body p {
    font-size: 18px;
    line-height: 1.8;
    color: #34495e;
    margin-bottom: 15px;
}

.popup-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.popup-features .feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background-color: #f8f4ef;
    padding: 15px 25px;
    border-radius: 12px;
    min-width: 80px;
}

.popup-features .feature i {
    font-size: 30px;
    color: #f5c842;
}

.popup-features .feature span {
    font-size: 16px;
    color: #2c3e50;
}

/* ======= سياسة الخصوصية ======= */
.privacy-body h4 {
    font-size: 17px;
    color: #1a2a3a;
    margin: 20px 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.privacy-body h4 i {
    color: #f5c842;
}

.privacy-body h4:first-child {
    margin-top: 0;
}

.privacy-list {
    list-style: none;
    padding: 0;
    text-align: right;
}

.privacy-list li {
    font-size: 15px;
    line-height: 1.8;
    color: #34495e;
    padding: 6px 0 6px 0;
    padding-right: 22px;
    position: relative;
}

.privacy-list li::before {
    content: "•";
    color: #f5c842;
    font-size: 18px;
    position: absolute;
    right: 0;
}

/* ======= تسجيل الدخول / إنشاء حساب ======= */
.login-header {
    margin-bottom: 30px;
}

.login-header i {
    font-size: 60px;
    color: #f5c842;
    margin-bottom: 10px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 16px;
}

/* ======= رسالة الخطأ ======= */
.auth-error {
    background-color: #fdecea;
    color: #c0392b;
    border: 1px solid #f5b7b1;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 15px;
    margin-bottom: 20px;
    text-align: right;
}

/* ======= الفاصل "أو" بين تسجيل الدخول العادي وجوجل ======= */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #999;
    font-size: 14px;
    margin: 18px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0d5c8;
}

.auth-divider span {
    padding: 0 12px;
}

/* ======= زر المتابعة عبر جوجل ======= */
.google-signin-btn {
    width: 100%;
    padding: 13px;
    background-color: #ffffff;
    color: #2c3e50;
    border: 2px solid #e0d5c8;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Amiri', serif;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.3s, border-color 0.3s;
}

.google-signin-btn i {
    color: #db4437;
    font-size: 18px;
}

.google-signin-btn:hover {
    background-color: #f8f4ef;
    border-color: #d4b88c;
}

/* ======= نموذج تسجيل الدخول ======= */
.login-form .form-group {
    margin-bottom: 20px;
    text-align: right;
}

.login-form .form-group label {
    display: block;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.login-form .form-group label i {
    color: #f5c842;
    margin-left: 8px;
}

.login-form .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0d5c8;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Amiri', serif;
    transition: border-color 0.3s;
    background-color: #faf8f5;
}

.login-form .form-group input:focus {
    border-color: #f5c842;
    outline: none;
}

.login-btn-submit {
    width: 100%;
    padding: 14px;
    background-color: #f5c842;
    color: #1a2a3a;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-family: 'Amiri', serif;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.login-btn-submit:hover {
    background-color: #e0b032;
    transform: scale(1.02);
}

.login-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-btn-submit i {
    margin-left: 10px;
}

.register-link {
    margin-top: 15px;
    font-size: 15px;
    color: #7f8c8d;
}

.register-link a {
    color: #f5c842;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}

/* ======= عرض الشعار (logo1) ======= */
.logo-display {
    text-align: center;
}

.logo-display .logo-large {
    max-width: 100%;
    max-height: 200px;
    margin-bottom: 15px;
    /* انتقال سلس عند تبديل الوضع الليلي/النهاري */
    transition: filter 0.3s;
}

.logo-display p {
    font-size: 18px;
    color: #34495e;
}

.logo-display .logo-desc {
    font-size: 16px;
    color: #7f8c8d;
    margin-top: 10px;
}

/* ======= معلومات المشرف العام (logo2) — شخص واحد ======= */
.supervisor-info {
    text-align: right;
    margin-top: 10px;
}

.supervisor-avatar {
    text-align: center;
    margin-bottom: 20px;
}

.supervisor-avatar i {
    font-size: 80px;
    color: #f5c842;
    background-color: #f8f4ef;
    padding: 20px;
    border-radius: 50%;
}

/* صورة المشرف الدائرية (تظهر حصرياً في نافذة logo2) */
.supervisor-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f5c842;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.supervisor-details h3 {
    font-size: 26px;
    color: #1a2a3a;
    text-align: center;
}

.supervisor-details .title {
    text-align: center;
    color: #7f8c8d;
    font-size: 18px;
    margin-bottom: 8px;
}

/* سطر "الإطار" الوظيفي (يظهر تحت الصفة مباشرة) */
.framework-line {
    text-align: center;
    color: #594c03;
    font-size: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.framework-line i {
    color: #f5c842;
}

.committee-role {
    background-color: #f8f4ef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.committee-role h4 {
    font-size: 18px;
    color: #1a2a3a;
    margin-bottom: 10px;
    border-bottom: 2px solid #f5c842;
    padding-bottom: 8px;
}

.committee-role ul {
    list-style: none;
    padding: 0;
}

.committee-role ul li {
    padding: 8px 0;
    font-size: 16px;
    color: #34495e;
    border-bottom: 1px solid #eee;
    padding-right: 25px;
    position: relative;
}

.committee-role ul li::before {
    content: "•";
    color: #f5c842;
    font-size: 20px;
    position: absolute;
    right: 0;
}

.committee-role ul li:last-child {
    border-bottom: none;
}

/* ============================================================ */
/* ======= قائمة أعضاء لجنة الإشراف (نافذة supervision) ======= */
/* ============================================================ */

.committee-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: right;
}

.committee-member-card {
    background-color: #f8f4ef;
    border: 2px solid #e8ddd0;
    border-radius: 16px;
    padding: 20px;
    transition: border-color 0.3s;
}

.committee-member-card:hover {
    border-color: #f5c842;
}

.committee-member-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.committee-member-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f5c842, #d4980f);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 15px rgba(212, 152, 15, 0.3);
}

.committee-member-icon i {
    font-size: 24px;
    color: #ffffff;
}

.committee-member-titles h3 {
    font-size: 19px;
    color: #1a2a3a;
    margin: 0 0 6px;
}

.committee-role-badge {
    display: inline-block;
    background-color: #fff8e1;
    color: #b8860b;
    border: 1px solid #f5c842;
    border-radius: 20px;
    padding: 3px 14px;
    font-size: 13px;
    font-weight: 700;
}

.committee-member-framework {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #7f8c8d;
    margin: 0 0 14px;
    padding-right: 4px;
}

.committee-member-framework i {
    color: #f5c842;
}

.committee-member-tasks h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #1a2a3a;
    margin: 0 0 8px;
}

.committee-member-tasks h4 i {
    color: #f5c842;
    font-size: 14px;
}

.committee-member-tasks ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.committee-member-tasks ul li {
    font-size: 14px;
    color: #34495e;
    line-height: 1.7;
    padding: 4px 0 4px 0;
    padding-right: 18px;
    position: relative;
}

.committee-member-tasks ul li::before {
    content: "•";
    color: #f5c842;
    font-size: 16px;
    position: absolute;
    right: 0;
}

/* ======= البحث ======= */
.search-header {
    margin-bottom: 25px;
}

.search-header i {
    font-size: 50px;
    color: #f5c842;
}

.search-header h2 {
    margin-top: 5px;
}

.search-form {
    margin-bottom: 20px;
}

.search-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input-wrapper input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e0d5c8;
    border-radius: 12px;
    font-size: 18px;
    font-family: 'Amiri', serif;
    background-color: #faf8f5;
    transition: border-color 0.3s;
}

.search-input-wrapper input:focus {
    border-color: #f5c842;
    outline: none;
}

.search-btn-submit {
    padding: 14px 24px;
    background-color: #f5c842;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    color: #1a2a3a;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn-submit:hover {
    background-color: #e0b032;
}

.search-filters {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-filters label {
    font-size: 16px;
    color: #34495e;
    cursor: pointer;
}

.search-filters input[type="radio"] {
    accent-color: #f5c842;
    margin-left: 5px;
}

.search-results .hint {
    color: #999;
    font-size: 16px;
    text-align: center;
    padding: 20px;
}

/* ======= أنيميشن ======= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======= تنسيقات للشاشات الصغيرة ======= */
@media (max-width: 500px) {
    .popup-container {
        padding: 25px 20px;
        max-height: 90vh;
    }

    .popup-content h2 {
        font-size: 22px;
    }

    .popup-features {
        gap: 15px;
    }

    .popup-features .feature {
        padding: 10px 15px;
        min-width: 60px;
    }

    .login-form .form-options {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .search-input-wrapper {
        flex-direction: column;
    }

    .search-filters {
        gap: 10px;
    }

    .supervisor-photo {
        width: 100px;
        height: 100px;
    }

    .committee-member-header {
        flex-wrap: wrap;
    }

    .committee-member-icon {
        width: 46px;
        height: 46px;
    }

    .committee-member-icon i {
        font-size: 20px;
    }
}

/* ============================================================ */
/* ======= الوضع المظلم للنوافذ المنبثقة ======= */
/* ============================================================ */

body.dark-mode .popup-container {
    background-color: #2d2d3d;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark-mode .close-btn {
    color: #999;
}

body.dark-mode .close-btn:hover {
    color: #e74c3c;
}

body.dark-mode .popup-content h2 {
    color: #f0e6d3;
    border-bottom-color: #f5c842;
}

body.dark-mode .popup-content h2 i {
    color: #f5c842;
}

body.dark-mode .popup-body p {
    color: #c0c0c0;
}

body.dark-mode .popup-features .feature {
    background-color: #3d3d4d;
}

body.dark-mode .popup-features .feature span {
    color: #e0e0e0;
}

body.dark-mode .popup-features .feature i {
    color: #f5c842;
}

body.dark-mode .privacy-body h4 {
    color: #f0e6d3;
}

body.dark-mode .privacy-list li {
    color: #c0c0c0;
}

body.dark-mode .login-header p {
    color: #aab7c4;
}

body.dark-mode .auth-error {
    background-color: #3d2626;
    color: #ff8a80;
    border-color: #5c3535;
}

body.dark-mode .auth-divider {
    color: #aab7c4;
}

body.dark-mode .auth-divider::before,
body.dark-mode .auth-divider::after {
    border-bottom-color: #4a4a5a;
}

body.dark-mode .google-signin-btn {
    background-color: #2d2d3d;
    border-color: #4a4a5a;
    color: #e0e0e0;
}

body.dark-mode .google-signin-btn:hover {
    background-color: #3d3d4d;
    border-color: #f5c842;
}

body.dark-mode .login-form .form-group label {
    color: #e0e0e0;
}

body.dark-mode .login-form .form-group input {
    background-color: #3d3d4d;
    border-color: #4a4a5a;
    color: #e0e0e0;
}

body.dark-mode .login-form .form-group input:focus {
    border-color: #f5c842;
}

body.dark-mode .register-link {
    color: #aab7c4;
}

body.dark-mode .register-link a {
    color: #f5c842;
}

body.dark-mode .logo-display p {
    color: #c0c0c0;
}

body.dark-mode .logo-display .logo-desc {
    color: #aab7c4;
}

/* انعكاس ألوان شعار الموقع داخل النافذة المنبثقة في الوضع المظلم */
/* نفس التقنية المستخدمة لشعاري الهيدر وصورة البسملة: تحوّل الأسود إلى أبيض */
/* والرمادي الغامق إلى رمادي فاتح، مع الحفاظ تقريباً على الألوان المشبعة */
body.dark-mode .logo-display .logo-large {
    filter: invert(1) hue-rotate(180deg);
}

body.dark-mode .supervisor-photo {
    border-color: #f5c842;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

body.dark-mode .supervisor-details h3 {
    color: #f0e6d3;
}

body.dark-mode .supervisor-details .title {
    color: #aab7c4;
}

body.dark-mode .framework-line {
    color: #f5c842;
}

body.dark-mode .committee-role {
    background-color: #3d3d4d;
}

body.dark-mode .committee-role h4 {
    color: #f0e6d3;
    border-bottom-color: #f5c842;
}

body.dark-mode .committee-role ul li {
    color: #c0c0c0;
    border-bottom-color: #4a4a5a;
}

body.dark-mode .committee-role ul li::before {
    color: #f5c842;
}

body.dark-mode .committee-member-card {
    background-color: #3d3d4d;
    border-color: #4a4a5a;
}

body.dark-mode .committee-member-card:hover {
    border-color: #f5c842;
}

body.dark-mode .committee-member-titles h3 {
    color: #f0e6d3;
}

body.dark-mode .committee-role-badge {
    background-color: #3d3420;
    color: #f5c842;
    border-color: #f5c842;
}

body.dark-mode .committee-member-framework {
    color: #aab7c4;
}

body.dark-mode .committee-member-tasks h4 {
    color: #f0e6d3;
}

body.dark-mode .committee-member-tasks ul li {
    color: #c0c0c0;
}

body.dark-mode .search-header h2 {
    color: #f0e6d3;
}

body.dark-mode .search-header i {
    color: #f5c842;
}

body.dark-mode .search-input-wrapper input {
    background-color: #3d3d4d;
    border-color: #4a4a5a;
    color: #e0e0e0;
}

body.dark-mode .search-input-wrapper input:focus {
    border-color: #f5c842;
}

body.dark-mode .search-filters label {
    color: #c0c0c0;
}

body.dark-mode .search-results .hint {
    color: #777;
}