﻿/* ════════════════════════════════════════════════════════════════════
   📁 File: wwwroot/css/legal/mew-notifications.css
   ════════════════════════════════════════════════════════════════════

   🎯 Phase N5: Unified Notification Bell Styles
   - Big professional bell button
   - Animated badge + critical pulse
   - Tab navigation
   - Severity-colored list items
   - Smooth transitions

   ════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════
   🔧 CSS PATCH for SVG Bell Icon
   ════════════════════════════════════════════════════════════════════

   ضع هذا في بداية mew-notifications.css (استبدل قسم BIG BELL BUTTON)
   أو ضع كملف منفصل بعد mew-notifications.css

   ════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════
   🔔 BIG BELL BUTTON (Inline SVG version)
   ════════════════════════════════════════════════════════════ */

.mew-bell-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 !important;
}

    .mew-bell-btn:hover {
        background: rgba(13, 110, 253, 0.08);
        transform: scale(1.05);
    }

    .mew-bell-btn:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
    }

/* ─── SVG Bell Icon - BIG ─── */
.mew-bell-icon {
    width: 28px;
    height: 28px;
    color: #0d6efd;
    transition: transform 0.3s ease, color 0.2s ease;
    display: block;
}

.mew-bell-btn:hover .mew-bell-icon {
    color: #0a58ca;
}

/* Animation when new notification arrives */
.mew-bell-btn.has-new .mew-bell-icon {
    animation: bellShake 0.7s ease;
    color: #dc3545;
}

@keyframes bellShake {
    0%, 100% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(-15deg);
    }

    20% {
        transform: rotate(15deg);
    }

    30% {
        transform: rotate(-10deg);
    }

    40% {
        transform: rotate(10deg);
    }

    50% {
        transform: rotate(-5deg);
    }

    60% {
        transform: rotate(5deg);
    }
}

/* ─── Badge (count) ─── */
.mew-bell-badge {
    top: 2px !important;
    right: 2px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 3px 7px !important;
    min-width: 20px;
    background: #dc3545;
    color: white;
    border: 2px solid #fff;
    transform: translate(50%, -50%);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    animation: badgeBounce 0.5s ease;
}

    .mew-bell-badge.has-critical {
        background: #dc3545;
        animation: badgePulse 1.5s ease infinite;
    }

@keyframes badgeBounce {
    0% {
        transform: translate(50%, -50%) scale(0);
    }

    50% {
        transform: translate(50%, -50%) scale(1.3);
    }

    100% {
        transform: translate(50%, -50%) scale(1);
    }
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
    }
}

/* ─── Critical Dot (extra emphasis) ─── */
.mew-bell-critical-dot {
    bottom: 6px;
    left: 6px;
    width: 10px;
    height: 10px;
    background: #dc3545;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: criticalPulse 1.2s ease infinite;
}

@keyframes criticalPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.7;
    }
}

/* ════════════════════════════════════════════════════════════
   📋 DROPDOWN PANEL
   ════════════════════════════════════════════════════════════ */

.mew-bell-dropdown {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 10px !important;
}

/* ─── Header ─── */
.mew-bell-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    padding: 14px 18px;
    color: white;
}

    .mew-bell-header h6 {
        font-size: 15px;
        letter-spacing: 0.3px;
    }

        .mew-bell-header h6 i {
            font-size: 18px;
            margin-left: 4px;
        }

    .mew-bell-header .btn-link {
        font-size: 12px;
        transition: opacity 0.2s ease;
    }

        .mew-bell-header .btn-link:hover {
            opacity: 0.85;
        }

/* ════════════════════════════════════════════════════════════
   📑 TABS
   ════════════════════════════════════════════════════════════ */

.mew-bell-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0;
}

.mew-bell-tab {
    flex: 1;
    padding: 10px 8px;
    background: transparent;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border-bottom: 3px solid transparent;
    position: relative;
}

    .mew-bell-tab:hover {
        background: #fff;
        color: #495057;
    }

    .mew-bell-tab.is-active {
        color: #0d6efd;
        background: #fff;
        border-bottom-color: #0d6efd;
    }

    .mew-bell-tab i {
        font-size: 18px;
    }

    .mew-bell-tab .badge {
        font-size: 10px;
        padding: 2px 6px;
        min-width: 18px;
        border-radius: 10px;
    }

/* ════════════════════════════════════════════════════════════
   📜 LIST CONTAINER
   ════════════════════════════════════════════════════════════ */

.mew-bell-list-container {
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
}

    /* Custom scrollbar */
    .mew-bell-list-container::-webkit-scrollbar {
        width: 6px;
    }

    .mew-bell-list-container::-webkit-scrollbar-track {
        background: #f8f9fa;
    }

    .mew-bell-list-container::-webkit-scrollbar-thumb {
        background: #adb5bd;
        border-radius: 3px;
    }

        .mew-bell-list-container::-webkit-scrollbar-thumb:hover {
            background: #868e96;
        }

    /* ─── List Item ─── */
    .mew-bell-list-container .list-group-item {
        padding: 12px 16px;
        border-left: 4px solid transparent;
        border-right: none;
        border-top: none;
        border-bottom: 1px solid #f1f3f5;
        cursor: pointer;
        transition: all 0.15s ease;
    }

        .mew-bell-list-container .list-group-item:hover {
            background-color: #f8f9fa;
            border-left-color: #0d6efd;
        }

        .mew-bell-list-container .list-group-item.is-unread {
            background-color: #f0f7ff;
        }

            .mew-bell-list-container .list-group-item.is-unread:hover {
                background-color: #e1efff;
            }

        /* Severity indicators (right border for RTL) */
        .mew-bell-list-container .list-group-item.severity-critical {
            border-right: 4px solid #dc3545;
        }

        .mew-bell-list-container .list-group-item.severity-warning {
            border-right: 4px solid #ffc107;
        }

        .mew-bell-list-container .list-group-item.severity-info {
            border-right: 4px solid #0dcaf0;
        }

        .mew-bell-list-container .list-group-item.severity-success {
            border-right: 4px solid #198754;
        }

/* Icon coloring */
.mew-notif-icon {
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

    .mew-notif-icon.severity-critical {
        background: #fee;
        color: #dc3545;
    }

    .mew-notif-icon.severity-warning {
        background: #fff8e1;
        color: #f57c00;
    }

    .mew-notif-icon.severity-info {
        background: #e3f2fd;
        color: #0288d1;
    }

    .mew-notif-icon.severity-success {
        background: #e8f5e9;
        color: #2e7d32;
    }

/* Title and meta */
.mew-notif-title {
    font-weight: 600;
    font-size: 13px;
    color: #212529;
    line-height: 1.4;
    margin-bottom: 2px;
}

.mew-notif-summary {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mew-notif-meta {
    font-size: 11px;
    color: #adb5bd;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* New badge */
.mew-notif-new-badge {
    font-size: 9px;
    padding: 2px 6px;
    background: #0d6efd;
    color: white;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ─── Empty State ─── */
.mew-empty-icon {
    font-size: 56px;
    color: #dee2e6;
    display: block;
    margin: 0 auto;
}

/* ════════════════════════════════════════════════════════════
   📌 FOOTER
   ════════════════════════════════════════════════════════════ */

.mew-bell-footer {
    background: #f8f9fa;
    padding: 12px 18px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

    .mew-bell-footer a {
        font-size: 13px;
        color: #0d6efd;
        transition: color 0.2s ease;
    }

        .mew-bell-footer a:hover {
            color: #0a58ca;
        }

/* ════════════════════════════════════════════════════════════
   🌙 DARK MODE SUPPORT
   ════════════════════════════════════════════════════════════ */

[data-theme="dark"] .mew-bell-icon {
    color: #6ea8fe;
}

[data-theme="dark"] .mew-bell-dropdown {
    background: #2b2c40;
}

[data-theme="dark"] .mew-bell-tabs {
    background: #232333;
    border-bottom-color: #3f3f5a;
}

[data-theme="dark"] .mew-bell-tab.is-active {
    background: #2b2c40;
    color: #6ea8fe;
}

[data-theme="dark"] .mew-bell-list-container {
    background: #2b2c40;
}

    [data-theme="dark"] .mew-bell-list-container .list-group-item {
        background-color: #2b2c40;
        border-bottom-color: #3f3f5a;
        color: #e7e7e7;
    }

        [data-theme="dark"] .mew-bell-list-container .list-group-item:hover {
            background-color: #353551;
        }

        [data-theme="dark"] .mew-bell-list-container .list-group-item.is-unread {
            background-color: #1a3050;
        }

[data-theme="dark"] .mew-notif-title {
    color: #e7e7e7;
}

[data-theme="dark"] .mew-bell-footer {
    background: #232333;
    border-top-color: #3f3f5a;
}

/* ════════════════════════════════════════════════════════════
   🍞 TOAST CONTAINER (for severity-driven toasts)
   ════════════════════════════════════════════════════════════ */

#notifToastContainer {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
}

[dir="rtl"] #notifToastContainer {
    left: auto;
    right: 20px;
}

.notif-toast {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    position: relative;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid #0d6efd;
}

[dir="rtl"] .notif-toast {
    border-left: none;
    border-right: 4px solid #0d6efd;
}

.notif-toast.is-leaving {
    animation: toastSlideOut 0.25s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(-110%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

[dir="rtl"] @keyframes toastSlideIn {
    from

{
    transform: translateX(110%);
    opacity: 0;
}

to {
    transform: translateX(0);
    opacity: 1;
}

}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-110%);
        opacity: 0;
    }
}

.notif-toast--critical {
    border-color: #dc3545;
}

.notif-toast--warning {
    border-color: #ffc107;
}

.notif-toast--success {
    border-color: #198754;
}

.notif-toast--info {
    border-color: #0dcaf0;
}

.notif-toast__icon {
    font-size: 22px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.notif-toast--critical .notif-toast__icon {
    background: #fee;
    color: #dc3545;
}

.notif-toast--warning .notif-toast__icon {
    background: #fff8e1;
    color: #f57c00;
}

.notif-toast--success .notif-toast__icon {
    background: #e8f5e9;
    color: #198754;
}

.notif-toast--info .notif-toast__icon {
    background: #e3f2fd;
    color: #0288d1;
}

.notif-toast__body {
    flex: 1;
    min-width: 0;
}

.notif-toast__title {
    font-weight: 700;
    font-size: 13px;
    color: #212529;
    margin-bottom: 2px;
}

.notif-toast__message {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 4px;
}

.notif-toast__meta {
    font-size: 11px;
    color: #adb5bd;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notif-toast__close {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

    .notif-toast__close:hover {
        color: #495057;
    }

.notif-toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(13, 110, 253, 0.5);
}

.notif-toast--critical .notif-toast__progress {
    background: rgba(220, 53, 69, 0.5);
}

.notif-toast--warning .notif-toast__progress {
    background: rgba(255, 193, 7, 0.5);
}

.notif-toast--success .notif-toast__progress {
    background: rgba(25, 135, 84, 0.5);
}

/* ════════════════════════════════════════════════════════════
   📱 RESPONSIVE
   ════════════════════════════════════════════════════════════ */

@media (max-width: 575px) {
    .mew-bell-dropdown {
        min-width: 320px !important;
        max-width: 95vw !important;
    }

    .mew-bell-tab span:not(.badge) {
        display: none;
    }

    .mew-bell-tab i {
        font-size: 20px;
    }

    #notifToastContainer {
        top: 70px;
        left: 10px;
        right: 10px;
        max-width: none;
    }
}
