/* ============================================
   نظام الإشعارات الذكية - ألوان عمر القضايا
   30 يوم → برتقالي
   60 يوم → أحمر فاتح
   ============================================ */

/* === البطاقات العادية (أقل من 30 يوم) === */
.case-normal {
    background-color: #ffffff;
    border-left: 4px solid #28a745;
    transition: all 0.3s ease;
}

.case-normal:hover {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
    transform: translateY(-2px);
}

/* === البطاقات التحذيرية (30-59 يوم) === */
.case-warning {
    background-color: #fff8f0;
    border-left: 4px solid #ff9800;
    transition: all 0.3s ease;
    animation: pulse-warning 2s infinite;
}

.case-warning:hover {
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
    transform: translateY(-2px);
}

/* === البطاقات الحرجة (60+ يوم) === */
.case-critical {
    background-color: #fff5f5;
    border-left: 4px solid #ff5252;
    transition: all 0.3s ease;
    animation: pulse-critical 1.5s infinite;
}

.case-critical:hover {
    box-shadow: 0 4px 12px rgba(255, 82, 82, 0.4);
    transform: translateY(-2px);
}

/* === أنيميشن التنبيه (برتقالي) === */
@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
    }
    50% {
        box-shadow: 0 2px 16px rgba(255, 152, 0, 0.4);
    }
}

/* === أنيميشن التحذير (أحمر) === */
@keyframes pulse-critical {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 82, 82, 0.3);
    }
    50% {
        box-shadow: 0 2px 20px rgba(255, 82, 82, 0.6);
    }
}

/* === أيقونة التنبيه === */
.case-aging-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 24px;
    animation: bounce 2s infinite;
}

.case-warning .case-aging-icon {
    color: #ff9800;
}

.case-critical .case-aging-icon {
    color: #ff5252;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* === شريط العمر === */
.case-age-bar {
    height: 4px;
    background: linear-gradient(90deg, #28a745, #ff9800, #ff5252);
    border-radius: 2px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.case-age-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

/* === Badge عمر القضية === */
.case-age-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 8px;
}

.case-age-badge.normal {
    background-color: #d4edda;
    color: #155724;
}

.case-age-badge.warning {
    background-color: #fff3cd;
    color: #856404;
}

.case-age-badge.critical {
    background-color: #f8d7da;
    color: #721c24;
}

/* === رسائل الإشعار === */
.aging-notification-banner {
    position: fixed;
    top: 80px;
    right: 20px;
    max-width: 400px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: slideInRight 0.5s ease;
}

.aging-notification-banner.warning {
    background-color: #fff8f0;
    border-right: 4px solid #ff9800;
    color: #856404;
}

.aging-notification-banner.critical {
    background-color: #fff5f5;
    border-right: 4px solid #ff5252;
    color: #721c24;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* === جدول القضايا === */
.cases-table tr.case-warning {
    background-color: #fff8f0 !important;
}

.cases-table tr.case-critical {
    background-color: #fff5f5 !important;
}

.cases-table tr.case-warning td:first-child::before {
    content: "🔔";
    margin-left: 8px;
}

.cases-table tr.case-critical td:first-child::before {
    content: "⚠️";
    margin-left: 8px;
}

/* === الثيم الداكن === */
@media (prefers-color-scheme: dark) {
    .case-warning {
        background-color: #3d2f1f;
        border-left-color: #ff9800;
    }

    .case-critical {
        background-color: #3d1f1f;
        border-left-color: #ff5252;
    }

    .aging-notification-banner.warning {
        background-color: #3d2f1f;
    }

    .aging-notification-banner.critical {
        background-color: #3d1f1f;
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .aging-notification-banner {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}