/**
 * تنسيق CSS مخصص لنظام الإشعارات
 * مطابق للتصميم المطلوب (الوضع الداكن) ومُحسّن
 * @author NasDesigns
 */

/* =======================================
    1. تنسيقات الحاوية الرئيسية وزر الإشعارات
======================================= */
.ai-notifications-wrapper {
    position: relative;
    display: inline-block;
}

#ai-dalil-notification-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    color: #fff;
    font-size: 1.2rem;
    line-height: 52px;
}

#ai-dalil-notification-button:focus {
    outline: none;
}

/* =======================================
    2. تنسيقات شارة العدد (Badge)
======================================= */
.notification-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    padding: 3px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 50%;
    background-color: #dc3545;
    color: #fff;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* =======================================
    3. تنسيقات القائمة المنسدلة (Dropdown)
======================================= */
.notification-dropdown {
    width: 350px;
    background-color: #2b3035;
    border: 1px solid #3c4248;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    overflow: hidden;
    z-index: 1000;
    color: #f8f9fa;
}

.notification-dropdown .dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #212529;
    border-bottom: 1px solid #3c4248;
}

.notification-dropdown .dropdown-header h6 {
    margin: 0;
    font-size: 16px;
    color: #f8f9fa;
    font-weight: bold;
}

.notification-dropdown .dropdown-header .close-btn {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}
.notification-dropdown .dropdown-header .close-btn:hover {
    color: #fff;
}

.notification-dropdown .dropdown-footer {
    background-color: #212529;
    border-top: 1px solid #3c4248;
    text-align: center;
    padding: 12px;
}

.notification-dropdown .dropdown-footer a {
    color: #0d6efd;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.notification-dropdown .dropdown-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* =======================================
    4. تنسيقات عناصر القائمة (List Items)
======================================= */
.notification-list-short {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notification-list-short li {
    padding: 15px;
    border-bottom: 1px solid #3c4248;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
}

.notification-list-short li:last-child {
    border-bottom: none;
}

.notification-list-short li:hover {
    background-color: #3c4248;
}

.notification-item-link {
    display: flex;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.notification-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    margin-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    background-color: #212529;
}

.notification-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.notification-avatar .dashicons {
    font-size: 1.5rem;
}

.notification-content-text {
    flex-grow: 1;
}

.notification-content-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #f8f9fa;
}

.notification-content-text small {
    font-size: 12px;
    color: #adb5bd;
}

.read-notification {
    opacity: 0.7;
}

/* =======================================
    5. تنسيقات خلفيات الإشعارات
======================================= */
.notification-item.info {
    background-color: #0c4d66; /* لون أزرق */
}
.notification-item.info:hover {
    background-color: #0a4055;
}

.notification-item.success {
    background-color: #1a5e3b; /* لون أخضر */
}
.notification-item.success:hover {
    background-color: #144b2f;
}

.notification-item.danger {
    background-color: #6d2424; /* لون أحمر */
}
.notification-item.danger:hover {
    background-color: #551e1e;
}

.notification-item.warning {
    background-color: #695026; /* لون برتقالي */
}
.notification-item.warning:hover {
    background-color: #523f1e;
}

/* =======================================
    6. تنسيقات المعاينة في لوحة التحكم
======================================= */
.ai-dalil-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.ai-dalil-admin-panel {
    background-color: #fff;
    border: 1px solid #c3c4c7;
    padding: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    border-radius: 4px;
}

.notification-preview {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border-radius: 8px;
    color: #fff;
}
.notification-preview.default { background-color: #2b3035; }
.notification-preview.info { background-color: #0d6efd; }
.notification-preview.success { background-color: #198754; }
.notification-preview.danger { background-color: #dc3545; }
.notification-preview.warning { background-color: #ffc107; color: #212529; }

.notification-preview-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    margin-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #212529;
}
.notification-preview-icon.has-image {
    background-color: transparent;
}
.notification-preview-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.notification-preview-content {
    flex-grow: 1;
}
.notification-preview-content p {
    margin: 0;
    line-height: 1.4;
}
.notification-preview-content small {
    display: block;
    font-size: 12px;
    opacity: 0.7;
}

/* =======================================
    7. تنسيقات متجاوبة (للموبايل)
======================================= */
@media (max-width: 576px) {
    .notification-dropdown {
        width: 90%;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
    .ai-dalil-admin-grid {
        grid-template-columns: 1fr;
    }
}