/* ========================================
   استایل ویجت اعلان‌های داخلی - امتیاز ۳۳
   نسخه: 10.0 - تم شیشه‌ای بلوری
   رنگ‌های جدید: #7B68EE و #B026FF
   ======================================== */

/* ویجت اصلی اعلان - قرارگیری در سمت چپ بالا */
.cvam-notification-widget {
    position: fixed;
    top: 70px;
    left: 20px;
    z-index: 9999;
    direction: rtl;
}

/* آیکون زنگوله شیشه‌ای */
.cvam-notification-bell {
    position: relative;
    display: inline-block;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(123, 104, 238, 0.3);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.cvam-notification-bell .bell-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.cvam-notification-bell:hover {
    border-color: #B026FF;
    transform: scale(1.05);
    background: rgba(176, 38, 255, 0.12);
    box-shadow: 0 6px 20px rgba(176, 38, 255, 0.2);
}

/* شمارنده اعلان‌های نخوانده */
.cvam-notification-bell .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #B026FF, #7B68EE);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(176, 38, 255, 0.4);
    animation: badgePulse 1s ease infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ========================================
   دراپ‌داون اعلان‌ها - شیشه‌ای بلوری
   ======================================== */
.cvam-notification-dropdown {
    position: absolute;
    top: 55px;
    left: 0;
    right: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(123, 104, 238, 0.25);
    border-radius: 24px;
    z-index: 1000;
    display: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: fadeInDown 0.25s ease-out;
}

.cvam-notification-dropdown.active {
    display: block;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   دسکتاپ (عرض بیشتر از 1200px)
   ======================================== */
@media (min-width: 1200px) {
    .cvam-notification-widget {
        top: 80px;
        left: 30px;
    }
    .cvam-notification-dropdown {
        width: 420px;
        max-width: 420px;
    }
}

/* ========================================
   لپ‌تاپ (عرض بین 769px تا 1199px)
   ======================================== */
@media (min-width: 769px) and (max-width: 1199px) {
    .cvam-notification-widget {
        top: 70px;
        left: 20px;
    }
    .cvam-notification-dropdown {
        width: 380px;
        max-width: 380px;
    }
}

/* ========================================
   تبلت (عرض بین 481px تا 768px)
   ======================================== */
@media (min-width: 481px) and (max-width: 768px) {
    .cvam-notification-widget {
        top: 60px;
        left: 15px;
    }
    .cvam-notification-bell {
        width: 44px;
        height: 44px;
    }
    .cvam-notification-bell .bell-icon {
        font-size: 1.3rem;
    }
    .cvam-notification-dropdown {
        width: 360px;
        max-width: 360px;
    }
    .notifications-list {
        max-height: 400px;
    }
    .notification-item {
        padding: 12px 15px;
    }
}

/* ========================================
   موبایل (عرض کمتر از 480px)
   ======================================== */
@media (max-width: 480px) {
    .cvam-notification-widget {
        top: 10px;
        left: 10px;
    }
    .cvam-notification-bell {
        width: 40px;
        height: 40px;
    }
    .cvam-notification-bell .bell-icon {
        font-size: 1.2rem;
    }
    .cvam-notification-dropdown {
        left: 0;
        right: auto;
        width: 320px;
        max-width: calc(100vw - 30px);
        min-width: 280px;
        overflow-x: hidden;
    }
    .notifications-list {
        max-height: 350px;
    }
    .notification-item {
        padding: 12px 14px;
    }
    .notification-item .title {
        font-size: 0.85rem;
    }
    .notification-item .message {
        font-size: 0.75rem;
    }
    .notification-item .time {
        font-size: 0.65rem;
    }
    .dropdown-header {
        padding: 12px 14px;
        font-size: 0.85rem;
    }
}

/* ========================================
   موبایل خیلی کوچک (عرض کمتر از 360px)
   ======================================== */
@media (max-width: 360px) {
    .cvam-notification-widget {
        top: 8px;
        left: 8px;
    }
    .cvam-notification-bell {
        width: 36px;
        height: 36px;
    }
    .cvam-notification-bell .bell-icon {
        font-size: 1rem;
    }
    .cvam-notification-dropdown {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        left: 0;
    }
    .notifications-list {
        max-height: 300px;
    }
    .notification-item {
        padding: 10px 12px;
    }
}

/* ========================================
   هدر دراپ‌داون
   ======================================== */
.dropdown-header {
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(176, 38, 255, 0.08), rgba(123, 104, 238, 0.04));
    border-bottom: 1px solid rgba(123, 104, 238, 0.2);
    font-weight: bold;
    color: #7B68EE;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-header .mark-all-read {
    font-size: 0.7rem;
    cursor: pointer;
    color: #888;
    transition: all 0.2s ease;
    padding: 5px 12px;
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.03);
}

.dropdown-header .mark-all-read:hover {
    color: #B026FF;
    background: rgba(176, 38, 255, 0.1);
}

/* ========================================
   لیست اعلان‌ها و اسکرول بار
   ======================================== */
.notifications-list {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* اسکرول بار سفارشی - شیشه‌ای */
.notifications-list::-webkit-scrollbar {
    width: 5px;
}

.notifications-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #B026FF, #7B68EE);
    border-radius: 10px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: #B026FF;
}

/* هر آیتم اعلان */
.notification-item {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-item:hover {
    background: rgba(176, 38, 255, 0.06);
    transform: translateX(-3px);
}

/* اعلان نخوانده */
.notification-item.unread {
    background: rgba(123, 104, 238, 0.06);
    border-right: 3px solid #B026FF;
}

/* عنوان اعلان */
.notification-item .title {
    font-weight: bold;
    color: #B026FF;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

/* متن اعلان */
.notification-item .message {
    font-size: 0.75rem;
    color: #1a1a2e;
    line-height: 1.5;
    margin-bottom: 6px;
}

/* زمان اعلان */
.notification-item .time {
    font-size: 0.65rem;
    color: #aaa;
    display: block;
    margin-top: 8px;
}

/* حالت خالی بودن لیست */
.notifications-list .empty-state {
    padding: 50px 20px;
    text-align: center;
    color: #aaa;
    font-size: 0.85rem;
}

/* ========================================
   انیمیشن برای اعلان جدید
   ======================================== */
@keyframes notificationPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(176, 38, 255, 0.6);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(176, 38, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(176, 38, 255, 0);
    }
}

.cvam-notification-bell.has-new {
    animation: notificationPulse 0.6s ease 2;
}

/* ========================================
   انیمیشن ورود آیتم جدید
   ======================================== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-item.new {
    animation: slideInRight 0.3s ease forwards;
}

/* ========================================
   جلوگیری از اسکرول افقی در کل صفحه
   ======================================== */
html, body {
    overflow-x: hidden;
    max-width: 100%;
    position: relative;
}

/* ========================================
   حالت دارک (اختیاری - برای کاربرانی که تم دارک دارند)
   ======================================== */
@media (prefers-color-scheme: dark) {
    .cvam-notification-bell {
        background: rgba(26, 26, 46, 0.9);
        border-color: rgba(123, 104, 238, 0.3);
    }
    
    .cvam-notification-dropdown {
        background: rgba(26, 26, 46, 0.95);
        border-color: rgba(123, 104, 238, 0.25);
    }
    
    .dropdown-header {
        background: linear-gradient(135deg, rgba(176, 38, 255, 0.12), rgba(123, 104, 238, 0.06));
        color: #7B68EE;
    }
    
    .notification-item {
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }
    
    .notification-item .message {
        color: rgba(255, 255, 255, 0.85);
    }
    
    .notification-item .time {
        color: #888;
    }
    
    .notification-item:hover {
        background: rgba(176, 38, 255, 0.1);
    }
    
    .notification-item.unread {
        background: rgba(123, 104, 238, 0.1);
    }
    
    .notifications-list .empty-state {
        color: #888;
    }
}