/* --- Container chính (Popup giữa màn hình) --- */
#tt-noti-widget-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Căn giữa tuyệt đối */
    width: 400px;
    max-width: 90%;
    max-height: 80vh; /* Không cao quá 80% màn hình */
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    pointer-events: none; /* Để click xuyên qua vùng trống xung quanh */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- Header của Widget --- */
.tt-noti-header {
    background: linear-gradient(135deg, #0073aa, #005177);
    color: #fff;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: scale(0.9); /* Thu nhỏ nhẹ khi ẩn */
}

/* Khi active thì hiện lên và scale về kích thước thật */
.tt-noti-header.active {
    opacity: 1;
    transform: scale(1);
}

.tt-noti-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tt-noti-badge {
    background-color: #d63638;
    color: white;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* --- Danh sách thông báo --- */
#tt-noti-list {
    overflow-y: auto;
    padding: 5px;
    pointer-events: none;
    /* Scrollbar mượt mà */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}

/* Scrollbar cho Webkit (Chrome, Safari) */
#tt-noti-list::-webkit-scrollbar {
    width: 6px;
}
#tt-noti-list::-webkit-scrollbar-track {
    background: transparent;
}
#tt-noti-list::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
}

/* --- Từng Item thông báo --- */
.tt-noti-item {
    background-color: #fff;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 15px 20px;
    position: relative;
    pointer-events: auto;
    /* Animation xuất hiện: Trượt từ dưới lên một chút */
    animation: fadeInUp 0.5s ease-out forwards;
    border-left: 5px solid #0073aa;
    transition: all 0.3s ease;
}

/* Hiệu ứng xuất hiện ở giữa màn hình */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hiệu ứng khi xóa: Mờ dần và thu nhỏ */
.tt-noti-item.removing {
    opacity: 0;
    transform: scale(0.9);
    margin-bottom: 0;
    padding: 0;
    height: 0;
    overflow: hidden;
}

.tt-noti-content {
    flex-grow: 1;
    padding-left: 15px; /* SỬA: Đổi từ padding-right sang padding-left để cách nút đóng bên trái */
}

.tt-noti-content p {
    margin: 0;
    color: #333;
    font-size: 15px;
    line-height: 1.5;
}

/* Nút đóng (X) */
.tt-noti-close-btn {
    background: #f0f2f5;
    border: none;
    color: #888;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tt-noti-close-btn:hover {
    background-color: #d63638;
    color: #fff;
    transform: rotate(90deg);
}