﻿/* ==============================================
   Notifications Module Styles
   أنماط وحدة الإشعارات
   ============================================== */

/* Notification Center Container */
.notification-center-container,
.preferences-container,
.reminders-container,
.log-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Page Header */
.page-header h2 {
    display: flex;
    align-items: center;
    font-weight: 600;
}

.page-header h2 i {
    font-size: 1.75rem;
}

/* ==============================================
   Notification List Styles
   ============================================== */

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Unread notification */
.notification-unread {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.05) 0%, var(--bs-body-bg) 100%);
    border-left: 3px solid var(--bs-primary);
}

.notification-unread .notification-title {
    font-weight: 600;
}

/* Read notification */
.notification-read {
    opacity: 0.85;
}

/* High priority notification */
.notification-high {
    border-left: 3px solid var(--bs-warning);
}

.notification-high .notification-icon i {
    color: var(--bs-warning);
}

/* Urgent notification */
.notification-urgent {
    border-left: 3px solid var(--bs-danger);
    background: linear-gradient(135deg, rgba(var(--bs-danger-rgb), 0.05) 0%, var(--bs-body-bg) 100%);
}

.notification-urgent .notification-icon i {
    color: var(--bs-danger);
}

/* Notification Icon */
.notification-icon {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-light);
    border-radius: 50%;
}

.notification-icon i {
    font-size: 1.5rem;
    color: var(--bs-primary);
}

.priority-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--bs-danger);
    border: 2px solid var(--bs-body-bg);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Notification Content */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.notification-title {
    font-size: 0.95rem;
    color: var(--bs-heading-color);
    margin: 0;
}

.notification-time {
    white-space: nowrap;
    font-size: 0.8rem;
}

.notification-message {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Notification Actions */
.notification-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.notification-item:hover .notification-actions {
    opacity: 1;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bs-light);
    border: none;
    color: var(--bs-secondary-color);
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--bs-primary);
    color: white;
}

/* ==============================================
   Filter Tabs
   ============================================== */

.notification-filters .nav-pills {
    gap: 0.5rem;
}

.notification-filters .nav-link {
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    color: var(--bs-secondary-color);
    background: var(--bs-light);
    border: 1px solid transparent;
}

.notification-filters .nav-link:hover {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

.notification-filters .nav-link.active {
    background: var(--bs-primary);
    color: white;
}

/* ==============================================
   Quick Links
   ============================================== */

.quick-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--bs-body-color);
    transition: all 0.2s ease;
}

.quick-link-card:hover {
    border-color: var(--bs-primary);
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.05) 0%, var(--bs-body-bg) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.quick-link-card i {
    font-size: 2rem;
    color: var(--bs-primary);
}

.quick-link-card span {
    font-weight: 500;
}

/* ==============================================
   Preferences Table
   ============================================== */

.preferences-table th {
    font-weight: 500;
    font-size: 0.875rem;
    vertical-align: middle;
    white-space: nowrap;
}

.preferences-table td {
    vertical-align: middle;
}

.preferences-table .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    cursor: pointer;
}

/* ==============================================
   Empty State
   ============================================== */

.empty-state {
    background: var(--bs-light);
    border-radius: 0.75rem;
}

.empty-state h4 {
    color: var(--bs-heading-color);
    margin-bottom: 0.5rem;
}

/* ==============================================
   Log Table
   ============================================== */

#logTable th {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    background: var(--bs-light);
}

#logTable td {
    vertical-align: middle;
}

/* ==============================================
   RTL Support
   ============================================== */

html[dir="rtl"] .notification-unread,
html[dir="rtl"] .notification-high,
html[dir="rtl"] .notification-urgent {
    border-left: none;
    border-right: 3px solid;
}

html[dir="rtl"] .notification-unread {
    border-right-color: var(--bs-primary);
}

html[dir="rtl"] .notification-high {
    border-right-color: var(--bs-warning);
}

html[dir="rtl"] .notification-urgent {
    border-right-color: var(--bs-danger);
}

html[dir="rtl"] .notification-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .notification-actions {
    flex-direction: row-reverse;
}

/* ==============================================
   Responsive
   ============================================== */

@media (max-width: 768px) {
    .notification-item {
        flex-wrap: wrap;
    }

    .notification-actions {
        opacity: 1;
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }

    .notification-header {
        flex-direction: column;
    }

    .quick-link-card {
        padding: 1rem;
    }

    .quick-link-card i {
        font-size: 1.5rem;
    }
}

/* ==============================================
   Navbar Notification Dropdown
   ============================================== */

.dropdown-notifications .dropdown-menu {
    width: 380px;
    max-width: 90vw;
}

.dropdown-notifications-list {
    max-height: 320px;
    overflow-y: auto;
}

.dropdown-notifications-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.dropdown-notifications-item:last-child {
    border-bottom: none;
}

.dropdown-notifications-item:hover {
    background: var(--bs-light);
}

.dropdown-notifications-item.unread {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.05) 0%, var(--bs-body-bg) 100%);
}

.badge-notifications {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    line-height: 18px;
}

/* Menu badge */
.notification-menu-badge {
    margin-left: auto;
    font-size: 0.7rem;
}

html[dir="rtl"] .badge-notifications {
    right: auto;
    left: -6px;
}

html[dir="rtl"] .notification-menu-badge {
    margin-left: 0;
    margin-right: auto;
}

/* Badge pulse animation for high priority */
.badge-pulse {
    animation: badge-pulse-anim 2s infinite;
}

@keyframes badge-pulse-anim {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(var(--bs-danger-rgb), 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(var(--bs-danger-rgb), 0);
    }
}

/* Marked/unread items in dropdown */
.dropdown-notifications-item.marked {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.08) 0%, var(--bs-body-bg) 100%);
    position: relative;
}

.dropdown-notifications-item.marked::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--bs-primary);
}

html[dir="rtl"] .dropdown-notifications-item.marked::before {
    left: auto;
    right: 0;
}

/* Dropdown notification actions */
.dropdown-notifications-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dropdown-notifications-item:hover .dropdown-notifications-actions {
    opacity: 1;
}

.dropdown-notifications-actions a {
    padding: 0.25rem;
    color: var(--bs-secondary-color);
    transition: color 0.2s ease;
}

.dropdown-notifications-actions a:hover {
    color: var(--bs-primary);
}

/* Scrollable container */
.scrollable-container {
    overflow-y: auto;
    max-height: 320px;
}

/* Custom scrollbar */
.scrollable-container::-webkit-scrollbar {
    width: 6px;
}

.scrollable-container::-webkit-scrollbar-track {
    background: transparent;
}

.scrollable-container::-webkit-scrollbar-thumb {
    background: var(--bs-border-color);
    border-radius: 3px;
}

.scrollable-container::-webkit-scrollbar-thumb:hover {
    background: var(--bs-secondary-color);
}