/* Real-time Social Media Notifications */

/* Notification Container */
#notifications-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    pointer-events: none;
}

/* Notification Cards */
.notification {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    margin-bottom: 0.5rem;
    pointer-events: all;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 350px;
    overflow: hidden;
}

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

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    position: relative;
}

.notification-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.notification-text {
    flex: 1;
    margin-right: 0.5rem;
}

.notification-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.notification-message {
    color: #6b7280;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.notification-action {
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
    transition: background-color 0.2s;
}

.notification-action:hover {
    background: #2563eb;
    text-decoration: none;
}

.notification-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.notification-close:hover {
    color: #6b7280;
    background: #f9fafb;
}

/* Notification Types */
.notification.post-reaction {
    border-left: 4px solid #ef4444;
}

.notification.post-reply {
    border-left: 4px solid #3b82f6;
}

.notification.new-follower {
    border-left: 4px solid #10b981;
}

.notification.post-mention {
    border-left: 4px solid #f59e0b;
}

.notification.profile-view {
    border-left: 4px solid #8b5cf6;
}

.notification.new-post {
    border-left: 4px solid #06b6d4;
}

/* Priority Levels */
.notification.priority-high {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
    border-color: #fecaca;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.15);
}

.notification.priority-low {
    opacity: 0.9;
    transform: scale(0.95);
}

/* Connection Status Indicator */
.signalr-status {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 1001;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.signalr-status.connected {
    background: #10b981;
    animation: pulse-green 2s infinite;
}

.signalr-status.reconnecting {
    background: #f59e0b;
    animation: pulse-yellow 1s infinite;
}

.signalr-status.disconnected,
.signalr-status.failed {
    background: #ef4444;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes pulse-yellow {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* Real-time Updates */
.reaction-pulse {
    animation: reaction-pulse 0.6s ease-out;
}

@keyframes reaction-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #6b7280;
}

.typing-dots {
    display: inline-flex;
    margin-right: 0.5rem;
}

.typing-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #9ca3af;
    margin: 0 1px;
    animation: typing-dot 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing-dot {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Refresh Indicator */
.refresh-indicator {
    background: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    text-align: center;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.refresh-indicator:hover {
    background: #2563eb;
}

.refresh-indicator i {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Notification Badge */
.notification-badge {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    display: none;
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 10;
}

/* Real-time disabled state */
.realtime-disabled {
    opacity: 0.7;
    pointer-events: none;
}

.realtime-disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    z-index: 5;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    #notifications-container {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
    }
    
    .notification {
        max-width: none;
        transform: translateY(-100px);
    }
    
    .notification.notification-show {
        transform: translateY(0);
    }
    
    .notification-content {
        padding: 0.75rem;
    }
    
    .notification-title {
        font-size: 0.8125rem;
    }
    
    .notification-message {
        font-size: 0.75rem;
    }
    
    .signalr-status {
        bottom: 0.5rem;
        right: 0.5rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .notification {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .notification-title {
        color: #f9fafb;
    }
    
    .notification-message {
        color: #d1d5db;
    }
    
    .notification-close:hover {
        background: #374151;
    }
    
    .typing-indicator {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .refresh-indicator {
        background: #4b5563;
    }
    
    .refresh-indicator:hover {
        background: #6b7280;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .notification,
    .reaction-pulse,
    .typing-dots span,
    .refresh-indicator i {
        animation: none;
    }
    
    .notification {
        transition: opacity 0.2s;
    }
}

/* Focus styles for accessibility */
.notification-action:focus,
.notification-close:focus,
.refresh-indicator:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}