/**
 * Real-time Login/Logout Notifications
 * Modern Messenger-style notification styling
 */

.realtime-notifications-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 380px;
}

.realtime-notification {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateX(400px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    border: 1px solid rgba(0, 0, 0, 0.05);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    min-width: 320px;
}

.realtime-notification.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.realtime-notification.login {
    border-left: 4px solid #10b981;
}

.realtime-notification.logout {
    border-left: 4px solid #6b7280;
}

.realtime-notification.message {
    border-left: 4px solid #3b82f6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.realtime-notification.message:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.notification-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-indicator i {
    font-size: 12px;
}

.status-indicator.online i {
    color: #10b981;
    animation: pulse-online 2s ease-in-out infinite;
}

.status-indicator.offline i {
    color: #6b7280;
}

@keyframes pulse-online {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

.notification-body {
    flex: 1;
    min-width: 0;
}

.notification-user {
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-status {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 2px;
}

.status-text.online {
    color: #10b981;
    font-weight: 500;
}

.status-text.offline {
    color: #6b7280;
}

.notification-time {
    font-size: 12px;
    color: #9ca3af;
}

.notification-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.notification-close i {
    font-size: 20px;
}

/* RTL Support */
[dir="rtl"] .realtime-notifications-container {
    left: 20px;
    right: auto;
}

[dir="rtl"] .realtime-notification {
    transform: translateX(-400px) scale(0.9);
}

[dir="rtl"] .realtime-notification.show {
    transform: translateX(0) scale(1);
}

[dir="rtl"] .realtime-notification.login {
    border-left: none;
    border-right: 4px solid #10b981;
}

[dir="rtl"] .realtime-notification.logout {
    border-left: none;
    border-right: 4px solid #6b7280;
}

[dir="rtl"] .status-indicator {
    left: -2px;
    right: auto;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .realtime-notifications-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .realtime-notification {
        min-width: auto;
    }
    
    [dir="rtl"] .realtime-notifications-container {
        left: 10px;
        right: 10px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .realtime-notification {
        background: #1f2937;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .notification-user {
        color: #f9fafb;
    }
    
    .notification-status {
        color: #d1d5db;
    }
    
    .notification-time {
        color: #9ca3af;
    }
    
    .notification-close {
        color: #9ca3af;
    }
    
    .notification-close:hover {
        background: #374151;
        color: #f9fafb;
    }
    
    .status-indicator {
        background: #1f2937;
    }
}

/* Smooth transitions for multiple notifications */
.realtime-notification:not(.show) {
    pointer-events: none;
}

/* Add bounce effect for login notifications */
.realtime-notification.login.show .status-indicator.online {
    animation: bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounce-in {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Message notification specific styles */
.notification-icon.message-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 12px;
    flex-shrink: 0;
}

.notification-icon.message-icon i {
    font-size: 24px;
    color: #ffffff;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 2px;
}

.notification-subject {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}
