/* Standardized Staff Notification System */
/* This file provides consistent notification styling across all staff dashboard pages */

/* Message Container */
#message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

/* Base Message Styling */
.message {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 300px;
    max-width: 500px;
    word-wrap: break-word;
    white-space: normal;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Message Types */
.message.success {
    background: linear-gradient(45deg, #27ae60, #229954);
    color: white;
    border-left: 4px solid #1e8449;
}

.message.error {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    border-left: 4px solid #a93226;
}

.message.warning {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
    border-left: 4px solid #d68910;
}

.message.info {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    border-left: 4px solid #2471a3;
}

/* Message Icons */
.message i {
    font-size: 1.2em;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

/* Message Text */
.message-text {
    flex: 1;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
    white-space: normal;
    text-align: left;
}

/* Slide-in Animation */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Fade-out Animation */
@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.message.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

/* Hover Effects */
.message:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

/* Close Button - Removed (no longer used) */

/* Responsive Design */
@media (max-width: 768px) {
    #message-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .message {
        min-width: auto;
        max-width: none;
        padding: 12px 16px;
        font-size: 0.9em;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .message-text {
        white-space: normal;
        word-break: break-word;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .message {
        border: 2px solid;
    }
    
    .message.success {
        border-color: #ffffff;
    }
    
    .message.error {
        border-color: #ffffff;
    }
    
    .message.warning {
        border-color: #ffffff;
    }
    
    .message.info {
        border-color: #ffffff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .message {
        animation: none;
    }
    
    .message.fade-out {
        animation: none;
        opacity: 0;
    }
    
    .message:hover {
        transform: none;
        transition: none;
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    .message {
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
}

/* Multiple Message Stacking */
.message:not(:last-child) {
    margin-bottom: 10px;
}

/* Loading State (for future use) */
.message.loading {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    color: white;
    border-left: 4px solid #5d6d7e;
}

.message.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Low Stock Notifications Styling */
.enhanced-notifications {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

.notification-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid;
    overflow: hidden;
    position: relative;
}

.notification-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.notification-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Notification Types */
.notification-card.critical {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #fff8f8 0%, #ffffff 100%);
    border: 1px solid #f8d7da;
}

.notification-card.warning {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #fff8f8 0%, #ffffff 100%);
    border: 1px solid #f8d7da;
}

.notification-card.info {
    border-left-color: #0d6efd;
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
    border: 1px solid #b6d7ff;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 16px;
}

.notification-card.critical .notification-icon {
    background: linear-gradient(135deg, #dc3545, #b02a37);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
}

.notification-card.warning .notification-icon {
    background: linear-gradient(135deg, #dc3545, #b02a37);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
}

.notification-card.info .notification-icon {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
}

.notification-details {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-count {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notification-card.critical .stock-count {
    background: #dc3545;
    color: white;
}

.notification-card.warning .stock-count {
    background: #dc3545;
    color: white;
}

.notification-card.info .stock-count {
    background: #0d6efd;
    color: white;
}

.notification-actions {
    flex-shrink: 0;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #5a6268;
}

.action-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.25);
}

.action-btn i {
    font-size: 11px;
}

/* Scrollbar Styling */
.enhanced-notifications::-webkit-scrollbar {
    width: 6px;
}

.enhanced-notifications::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.enhanced-notifications::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #bdc3c7, #95a5a6);
    border-radius: 3px;
}

.enhanced-notifications::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

/* Responsive Design for Notifications */
@media (max-width: 768px) {
    .notification-content {
        padding: 12px;
        gap: 8px;
    }
    
    .notification-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .product-name {
        font-size: 13px;
    }
    
    .action-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
}

/* Dark mode support for notifications */
@media (prefers-color-scheme: dark) {
    .notification-card {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .notification-card.critical {
        background: linear-gradient(135deg, #3a2a2a 0%, #2c3e50 100%);
    }
    
    .notification-card.warning {
        background: linear-gradient(135deg, #3a342a 0%, #2c3e50 100%);
    }
    
    .notification-card.info {
        background: linear-gradient(135deg, #2a3340 0%, #2c3e50 100%);
    }
    
    .product-name {
        color: #ecf0f1;
    }
}

/* Animation for new notifications */
.notification-card {
    animation: slideInFromTop 0.4s ease-out;
}

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