﻿/* CSS cho hệ thống thông báo */
.notification-dropdown {
    position: relative;
    margin-right: 1rem;
}

.notification-btn {
    position: relative;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    color: white;
    padding: 0;
    border: none;
}

    .notification-btn:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

    .notification-btn i {
        color: white;
        font-size: 1.2rem;
    }

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Điều chỉnh vị trí dropdown menu */
.notification-menu {
    position: absolute;
    top: 100%;
    left: 0 !important; /* Đặt vị trí bên trái thay vì bên phải */
    right: auto !important;
    width: 320px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transform-origin: top left; /* Thay đổi điểm gốc của transform */
}

    /* Thêm mũi tên chỉ vào icon thông báo */
    .notification-menu::before {
        content: '';
        position: absolute;
        top: -8px;
        left: 15px; /* Điều chỉnh vị trí sang bên trái */
        right: auto;
        width: 16px;
        height: 16px;
        background-color: white;
        transform: rotate(45deg);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        border-left: 1px solid rgba(0, 0, 0, 0.05);
    }

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-header {
    margin: 0;
    font-weight: 600;
    color: #1e293b;
    padding: 0;
    font-size: 1rem;
}

.mark-all-read {
    color: #3498db;
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 0;
}

    .mark-all-read:hover {
        color: #2980b9;
        text-decoration: underline;
    }

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    gap: 1rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
    color: #333;
    text-decoration: none;
}

    .notification-item:hover {
        background-color: #f8fafc;
        text-decoration: none;
    }

    .notification-item.unread {
        background-color: #f0f9ff;
    }

        .notification-item.unread:hover {
            background-color: #e0f2fe;
        }

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e0f2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .notification-icon i {
        color: #3498db;
        font-size: 1rem;
    }

.notification-content {
    flex: 1;
}

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

.notification-message {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.notification-time {
    color: #94a3b8;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.no-notifications {
    padding: 1.5rem 1rem;
    text-align: center;
}

.view-all {
    padding: 0.75rem;
    text-align: center;
    color: #3498db;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

    .view-all:hover {
        background-color: #f8fafc;
        color: #2980b9;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hiệu ứng khi có thông báo mới */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

.notification-badge.new-notification {
    animation: pulse 1.5s infinite;
}
