/* ===== NOTIFICATION ITEM STYLES ===== */
/* Using your restaurant color palette */

.notification-item {
    /* Using restaurant color palette variables */
    --unread-bg: var(--primary-50); /* #FFE5E7 */
    --read-bg: var(--neutral-50); /* #F8F9FA */
    --out-of-stock: rgba(231, 76, 60, 0.1);
    --low-stock: rgba(243, 156, 18, 0.1);
    --accent-blue: var(--success); /* #3498DB */
    --accent-red: var(--error); /* #E74C3C */
    --accent-orange: var(--warning); /* #F39C12 */
    --accent-gray: var(--neutral-medium); /* #636E72 */
    --accent-secondary: var(--secondary); /* #F4A261 */

    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: var(--radius);
    transition: var(--transition);
    background-color: var(--unread-bg);
    border-left: 4px solid var(--accent-secondary);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.notification-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), transparent);
    opacity: 0.1;
}

/* Hover Effects */
.notification-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
    background-color: color-mix(in srgb, var(--unread-bg) 90%, white);
}

/* Read State */
.notification-item.read {
    background-color: var(--read-bg);
    border-left-color: var(--accent-gray);
    opacity: 0.8;
}

.notification-item.read:hover {
    opacity: 1;
    background-color: color-mix(in srgb, var(--read-bg) 90%, white);
}

/* Notification Types */
.notification-item.out_of_stock {
    background-color: var(--out-of-stock);
    border-left-color: var(--accent-red);
}

.notification-item.low_stock {
    background-color: var(--low-stock);
    border-left-color: var(--accent-orange);
}

/* Unread States with Type Specifics */
.notification-item.unread.out_of_stock {
    background-color: color-mix(in srgb, var(--out-of-stock) 90%, white);
    animation: pulse-red 2s infinite;
}

.notification-item.unread.low_stock {
    background-color: color-mix(in srgb, var(--low-stock) 90%, white);
    animation: pulse-orange 2s infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); }
}

@keyframes pulse-orange {
    0%, 100% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(243, 156, 18, 0); }
}

/* Header Layout */
.notification-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

/* Notification Elements */
.notification-icon {
    font-size: 18px;
    flex-shrink: 0;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.9);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.notification-item.read .notification-icon {
    color: var(--neutral-medium);
    background: var(--neutral-light);
}

.notification-item.out_of_stock .notification-icon {
    color: var(--accent-red);
}

.notification-item.low_stock .notification-icon {
    color: var(--accent-orange);
}

.notification-short {
    flex: 1;
    min-width: 200px;
    font-weight: 600;
    color: var(--neutral-dark);
    line-height: 1.4;
}

.notification-date {
    font-size: 0.75rem;
    color: var(--neutral-medium);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-date i {
    font-size: 0.75rem;
}

/* Status Badges */
.notification-status {
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.notification-status.read-status {
    color: var(--neutral-medium);
    background-color: var(--neutral-light);
}

.notification-item.unread .notification-status {
    color: var(--primary-dark);
    background-color: var(--primary-50);
    box-shadow: 0 2px 4px rgba(230, 57, 70, 0.2);
}

.notification-item.out_of_stock .notification-status {
    color: var(--accent-red);
    background-color: rgba(231, 76, 60, 0.15);
}

.notification-item.low_stock .notification-status {
    color: var(--accent-orange);
    background-color: rgba(243, 156, 18, 0.15);
}

/* Details Section */
.notification-details {
    padding: 12px;
    margin-top: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--neutral-dark);
    transition: var(--transition);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.notification-item.expanded .notification-details {
    max-height: 500px;
    opacity: 1;
    margin-top: 12px;
}

.notification-details p {
    margin: 8px 0;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-details p i {
    color: var(--primary);
    font-size: 0.875rem;
    width: 16px;
}

.notification-details strong {
    color: var(--neutral-dark);
    font-weight: 600;
    min-width: 100px;
    display: inline-block;
}

/* Delete Button */
.btn-delete-single {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--neutral-medium);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    padding: 6px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 12px;
    right: 12px;
}

.btn-delete-single:hover {
    color: var(--error);
    background: rgba(231, 76, 60, 0.1);
    border-color: var(--error);
    transform: rotate(90deg);
}

.btn-delete-single i {
    font-size: 14px;
}

/* Counter Badge */
.cart-count {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: var(--neutral-dark);
    border-radius: 50%;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 5px;
    display: none;
    line-height: 1;
    min-width: 20px;
    min-height: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cart-count:not(:empty) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Empty State */
.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--neutral-medium);
    font-style: italic;
    background: var(--neutral-50);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

.notification-empty i {
    font-size: 48px;
    color: var(--neutral-light);
    margin-bottom: 16px;
    display: block;
}

/* Highlight Animation for New Notifications */
@keyframes highlight {
    0% { 
        background-color: var(--secondary-light);
        transform: scale(1.02);
    }
    100% { 
        background-color: inherit;
        transform: scale(1);
    }
}

.new-notification {
    animation: highlight 0.5s ease-out;
}

/* Notification Type Indicators */
.notification-type-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), transparent);
    opacity: 0.3;
}

.notification-item.out_of_stock .notification-type-indicator {
    background: linear-gradient(90deg, var(--accent-red), transparent);
}

.notification-item.low_stock .notification-type-indicator {
    background: linear-gradient(90deg, var(--accent-orange), transparent);
}

/* Responsive Design */
@media (max-width: 600px) {
    .notification-item {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .notification-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        position: relative;
        padding-right: 40px; /* Space for delete button */
    }

    .notification-short {
        min-width: 100%;
        order: 1;
        font-size: 0.9375rem;
    }

    .notification-date {
        order: 2;
        font-size: 0.75rem;
    }

    .notification-status {
        order: 3;
        margin-top: 4px;
        align-self: flex-start;
    }

    /* Fix delete button positioning for mobile */
    .btn-delete-single {
        position: absolute;
        top: 0;
        right: 0;
        width: 28px;
        height: 28px;
    }
    
    .notification-details {
        font-size: 0.8125rem;
        padding: 10px;
    }
    
    .notification-details p {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .notification-details strong {
        min-width: auto;
        margin-right: 8px;
    }
}

@media (max-width: 480px) {
    .notification-item {
        padding: 10px;
    }
    
    .notification-short {
        font-size: 0.875rem;
    }
    
    .notification-icon {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

/* Accessibility Improvements */
.notification-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .notification-item {
        --unread-bg: rgba(230, 57, 70, 0.1);
        --read-bg: rgba(0, 0, 0, 0.2);
        --out-of-stock: rgba(231, 76, 60, 0.2);
        --low-stock: rgba(243, 156, 18, 0.2);
    }
    
    .notification-item:hover {
        background-color: rgba(230, 57, 70, 0.2);
    }
    
    .notification-item.read:hover {
        background-color: rgba(0, 0, 0, 0.3);
    }
    
    .notification-short {
        color: var(--neutral-light);
    }
    
    .notification-date {
        color: var(--neutral-light);
    }
    
    .notification-icon {
        color: var(--primary-light);
        background: rgba(0, 0, 0, 0.3);
    }
    
    .notification-item.read .notification-icon {
        color: var(--neutral-light);
        background: rgba(0, 0, 0, 0.2);
    }
    
    .notification-details {
        background-color: rgba(0, 0, 0, 0.3);
        color: var(--neutral-light);
        border-color: var(--neutral-medium);
    }
    
    .notification-details p i {
        color: var(--primary-light);
    }
    
    .notification-details strong {
        color: var(--neutral-light);
    }
    
    .btn-delete-single {
        background: rgba(0, 0, 0, 0.3);
        border-color: var(--neutral-medium);
        color: var(--neutral-light);
    }
    
    .btn-delete-single:hover {
        background: rgba(231, 76, 60, 0.3);
        color: var(--error);
        border-color: var(--error);
    }
    
    .notification-empty {
        background: rgba(0, 0, 0, 0.2);
        color: var(--neutral-light);
        border-color: var(--neutral-medium);
    }
    
    .notification-empty i {
        color: var(--neutral-medium);
    }
    
    .cart-count {
        background: linear-gradient(135deg, var(--secondary-dark), var(--secondary));
        color: var(--neutral-light);
    }
    
    @keyframes highlight {
        0% { 
            background-color: rgba(244, 162, 97, 0.3);
            transform: scale(1.02);
        }
        100% { 
            background-color: inherit;
            transform: scale(1);
        }
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .notification-item {
        border-width: 2px;
        border-left-width: 4px;
    }
    
    .notification-details {
        border-width: 2px;
    }
    
    .btn-delete-single {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .notification-item,
    .btn-delete-single {
        transition: none;
    }
    
    .notification-item:hover {
        transform: none;
    }
    
    .btn-delete-single:hover {
        transform: none;
    }
    
    .new-notification {
        animation: none;
    }
    
    @keyframes pulse-red,
    @keyframes pulse-orange,
    @keyframes highlight {
        animation: none;
    }
    
    .notification-item.unread.out_of_stock,
    .notification-item.unread.low_stock {
        animation: none;
        border: 2px solid;
    }
    
    .notification-item.unread.out_of_stock {
        border-color: var(--accent-red);
    }
    
    .notification-item.unread.low_stock {
        border-color: var(--accent-orange);
    }
}

/* Print Styles */
@media print {
    .notification-item {
        break-inside: avoid;
        border: 1px solid #000;
        border-left-width: 3px;
        margin-bottom: 15px;
    }
    
    .btn-delete-single {
        display: none;
    }
    
    .notification-icon {
        display: none;
    }
    
    .notification-item:hover {
        transform: none;
        box-shadow: none;
    }
    
    .notification-details {
        max-height: none !important;
        opacity: 1 !important;
        display: block !important;
        border: 1px solid #ccc;
    }
}

/* Expand/Collapse Animation */
.notification-item {
    transition: all 0.3s ease;
}

.notification-item.expanded {
    padding-bottom: 16px;
}

/* Stock Level Indicators */
.stock-level {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.stock-level.indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.stock-level.high .indicator-dot {
    background-color: var(--success);
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
}

.stock-level.medium .indicator-dot {
    background-color: var(--warning);
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.5);
}

.stock-level.low .indicator-dot {
    background-color: var(--error);
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.5);
}

/* Priority Badges */
.priority-badge {
    position: absolute;
    top: 8px;
    right: 50px;
    background: var(--error);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    z-index: 1;
}

.priority-badge.high {
    background: var(--error);
}

.priority-badge.medium {
    background: var(--warning);
    color: var(--neutral-dark);
}

.priority-badge.low {
    background: var(--success);
}