/**
 * Live Notifications CSS
 * Compatible with dark mode and mobile devices
 */

/* Toast Container */
.notification-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow), 0 0 0 1px rgba(0,0,0,0.05);
    padding: 16px;
    min-width: 320px;
    max-width: 400px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    z-index: 10000;
    transform: translateX(450px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
    cursor: default;
}

.notification-toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Type-specific colors */
.notification-toast[data-type="success"] {
    border-left: 4px solid #28a745;
}

.notification-toast[data-type="error"] {
    border-left: 4px solid #dc3545;
}

.notification-toast[data-type="warning"] {
    border-left: 4px solid #ffc107;
}

.notification-toast[data-type="info"] {
    border-left: 4px solid #007bff;
}

.notification-toast[data-type="message"] {
    border-left: 4px solid #667eea;
}

.notification-toast[data-type="task"] {
    border-left: 4px solid #f093fb;
}

.notification-toast[data-type="timeclock"] {
    border-left: 4px solid #4facfe;
}

.notification-toast[data-type="user"] {
    border-left: 4px solid #43e97b;
}

/* Priority indicator */
.notification-toast[data-priority="high"] {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px var(--shadow), 0 0 0 1px rgba(0,0,0,0.05);
    }
    50% {
        box-shadow: 0 4px 20px var(--shadow), 0 0 0 3px rgba(220, 53, 69, 0.3);
    }
}

/* Icon */
.notification-toast-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 18px;
}

.notification-toast[data-type="success"] .notification-toast-icon {
    color: #28a745;
}

.notification-toast[data-type="error"] .notification-toast-icon {
    color: #dc3545;
}

.notification-toast[data-type="warning"] .notification-toast-icon {
    color: #ffc107;
}

.notification-toast[data-type="info"] .notification-toast-icon {
    color: #007bff;
}

.notification-toast[data-type="message"] .notification-toast-icon {
    color: #667eea;
}

.notification-toast[data-type="task"] .notification-toast-icon {
    color: #f093fb;
}

.notification-toast[data-type="timeclock"] .notification-toast-icon {
    color: #4facfe;
}

.notification-toast[data-type="user"] .notification-toast-icon {
    color: #43e97b;
}

/* Content */
.notification-toast-content {
    flex: 1;
    min-width: 0;
}

.notification-toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    word-wrap: break-word;
}

/* Close button */
.notification-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
    width: 24px;
    height: 24px;
}

.notification-toast-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Notification Bell Icon (for nav) */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.notification-bell:hover {
    background: var(--hover-bg);
}

.notification-bell i {
    font-size: 20px;
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #dc3545;
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Notification Panel */
.notification-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 380px;
    max-height: calc(100vh - 80px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px var(--shadow);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
}

.notification-panel.show {
    display: flex;
}

.notification-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-panel-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.notification-panel-actions {
    display: flex;
    gap: 8px;
}

.notification-panel-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    transition: background-color 0.2s, color 0.2s;
}

.notification-panel-action:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.notification-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.notification-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notification-item:hover {
    background: var(--hover-bg);
}

.notification-item.unread {
    background: var(--bg-primary);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 8px;
    width: 4px;
    height: 4px;
    background: #007bff;
    border-radius: 50%;
}

.notification-item-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-primary);
    font-size: 16px;
}

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

.notification-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.4;
}

.notification-item-message {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-item-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.notification-empty i {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 12px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .notification-toast {
        right: 10px;
        left: 10px;
        min-width: unset;
        max-width: unset;
        top: 70px;
    }
    
    .notification-panel {
        right: 10px;
        left: 10px;
        width: auto;
        top: 60px;
    }
}

/* PWA Support */
@media (display-mode: standalone) {
    .notification-toast {
        top: 90px; /* Account for status bar on mobile */
    }
    
    .notification-panel {
        top: 70px;
    }
}
