﻿/* Message Notification System - Apple/Google/Slack inspired */

.message-notification-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.msg-notification {
    width: 380px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    pointer-events: auto;
    transform: translateX(420px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .msg-notification.show {
        transform: translateX(0);
        opacity: 1;
    }

    .msg-notification.hide {
        transform: translateX(420px);
        opacity: 0;
    }

.msg-notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .msg-notification-content:hover {
        background: #f9fafb;
    }

.msg-notification-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .msg-notification-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .msg-notification-avatar .avatar-initials {
        color: white;
        font-weight: 600;
        font-size: 18px;
    }

.msg-notification-text {
    flex: 1;
    min-width: 0;
}

.msg-notification-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.msg-notification-sender {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-notification-thread {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-notification-message {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.msg-notification-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    margin-top: 6px;
}

    .msg-notification-count .count-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        background: #ef4444;
        color: white;
        border-radius: 10px;
        font-size: 11px;
        font-weight: 600;
    }

.msg-notification-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #9ca3af;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: -4px;
    margin-right: -4px;
}

    .msg-notification-close:hover {
        background: #f3f4f6;
        color: #374151;
    }

    .msg-notification-close i {
        font-size: 16px;
    }

.msg-notification-progress {
    height: 3px;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    width: 100%;
    transition: width 5000ms linear;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .message-notification-container {
        top: 60px;
        right: 12px;
        left: 12px;
    }

    .msg-notification {
        width: auto;
        max-width: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .msg-notification {
        background: #1f2937;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    }

    .msg-notification-content:hover {
        background: #374151;
    }

    .msg-notification-sender {
        color: #f9fafb;
    }

    .msg-notification-thread {
        color: #9ca3af;
    }

    .msg-notification-message {
        color: #d1d5db;
    }

    .msg-notification-count {
        color: #9ca3af;
    }

    .msg-notification-close {
        color: #6b7280;
    }

        .msg-notification-close:hover {
            background: #4b5563;
            color: #d1d5db;
        }
}

/* Animation for stacking effect */
.msg-notification:nth-child(2) {
    margin-top: -4px;
}

.msg-notification:nth-child(3) {
    margin-top: -8px;
}
